Round 1 HackerEarth Test shared (Coding)

There were a total of 2 sections having 3 problems based on arrays and strings.

Section-1 (Easy)

Problem 1:

N noble people from the court of King Bob are standing in a line (1 to M. Each person is either wise or strong (not both). His prime advisor advised Bob that all wise people should be standing first followed by strong people (first means lower index). Bob cannot change the order of the noble people standing but he can do one thing ask his court magician to transform the type of person standing at any position. You are given the type of N persons as a string (‘S’ means strong and ‘W’ means wise).

Determine the minimum number of times the magician must apply his trick so that the ordering is as per his advisor’s advice.

Notes:

  • It is possible that after applying the magic trick, the number of either form of people becomes 0.
  • Bob can ask his magician to change the same type of person several times.

TC 1:

Input : n = 10, str = “SSWWSWWSWW”

Output: 4

TC 2:

Input : n = 5, str = “S”

Output : 0

Problem 2:

Given an integer array A of the size N. Find the sum of values in the array that has a different parity from that of their index in the array.

Calculate the sum of values of A[i] for all i where, A[2] mod 2 ‡ i mod 2

Note: 1-based indexing is used.

TC 1:

Input : n = 3, arr[] : {33,43,38}

Output: 81

TC 2:

Input : n = 4, arr[] : {2,3,4,5}

Output: 14

Section-2 (Medium)

Problem 3:

Given a string S1 of length L1 consisting of Latin uppercase alphabets only and a string S2 of length L2 consisting of characters T’ and ‘F’ only.

Generate a lexicographically smallest string S of length (L1 + 12 – 1) such that a substring of length L1 in string S starting at index / (0 ≤ i < L2) is equal to S1 if and only if the ith element of S2 is ‘T (without quotes) else not. If no such string can be generated, print “-1” (without quotes).

Notes:

A string a is lexicographically smaller than a string b if and only if one of the following holds:

  • a is a prefix of b, but a # b;
  • In the first position where a and b differ, the string a has a letter that appears earlier in the alphabet than the corresponding letter in b.

Find the lexicographically smallest string S which satisfies the given condition.

TC 1:

Input : S1 = “ABCA”, S2 = “TFFF”

Output: “ABCAAAA

I was able to solve both easy questions but could not solve the medium completely as it was unclear to me.

Got the call from HR the next day, that I had passed the OA and he scheduled Round 2 on Google Meet.

Wheelseye Technologies Interview Experience For SDE-I

Previous Position – Software Engineer II

Location – Bengaluru, India

Years of Experience – 1.5 years of Experience

Cold emailed to HR. Got a positive reply to go ahead!

Similar Reads

Telephonic Conversation with HR (5-10 mins)

The recruiter informed me that my resume was shortlisted and he would like to proceed ahead for the interviews. He explained a little about Wheelseye Technology and asked about my background and questions like – YOE, CTC etc....

Round 1: HackerEarth Test shared (Coding) :

There were a total of 2 sections having 3 problems based on arrays and strings....

Round 2: DSA (Virtual round)

The interviewer was an SDE with 4 YOE. We started with our introductions and then jumped straight to problem-solving-...

Contact Us