It was a weekend drive. They asked me to bring my own laptop.
Round 1: Coding Round (90 mins) via Hacker Rank
Q1) Given a binary String which represents the target state. Minimum number of flips needed to convert a same size Binary String (with all 0’s) to target state. A flip also causes all the right bits to be flipped.
Input : 00101 (Represents Target)
Output : 3
00000 -> 00111 -> 00100 -> 00101
Q2 ) You have been given a special and normal status of alphabets.
e.g. “01111001111111111011111111” represents “abcdefghijklmnopqrstuvwxyz”. Here 0 represents normal character and 1 represents special character.
Given an Input String S and a number k, find the maximum continuous sub array with maximum k number of number elements. There is no constraint on special character.
S = “giraffe”, K = 1, “011110011111111110111111”
Output : 3
normal characters : a, g, f
one of the possible solution : gir (as this has only one normal character)
Q3) There are cards and each card has an identity. e.g. HC1 has ID 1, this ID also represents the cost of the card. Your sister already have some cards and you want to gift her cards which she do not have already. Program is to return the max number of cards you can buy for her.
Constraint : You have amount d, and want to buy as many distinct card as you can.
e.g. Sister Cards = [2, 3, 5], D : 7 Card you buy : 1, 4
Output : 2
I was able to solve all above with all test cases passed.
Round 2: (1 hour)
It was a face to face round.
Q1) Given a sorted dictionary of an alien language having N words and k starting alphabets of standard dictionary the task is to complete the function which returns a string denoting the order of characters in the language. (here)
I was not able to think in manner of a graph and my solution was not optimal.
Q2) Given a matrix mat of size M*N. Traverse and print the matrix in spiral form. (here)
Due to first question approach they were not sure and told me if needed they will reach out to me next week.
- Groupon Interview Experience | Set 4 (SDE2 for Experienced)
- Microsoft Interview experience | Set 114 (2.5 Years Experienced for SDE2)
- Amazon Interview Experience for SDE2 | 3+ years Experienced
- Ixigo Interview Experienced for SDE2 Backend
- Walmart Interview Experience for SDE2 | Set 19 (3.8 years experience)
- Traveloka Interview Experience for SDE2
- OYO Rooms Interview Experience | Set 5 (For SDE2)
- Amazon Interview Experience | Set 154 (For SDE2)
- Amazon Interview Experience | Set 431 (For SDE2)
- Amazon Interview Experience | Set 260 (For SDE2)
- Flipkart Interview Experience for SDE2 (2.5 yr Exp.)
- Interview Experience of Amazon - SDE2
- Amazon Interview Experience SDE2
- Amazon Interview Experience | Set 381 (For SDE2)
- Amazon Interview experience | Set 324 (For SDE2)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.