AMAZON SDE -1 Interview Experience and suggested Preparation strategy.

I recently got offer from Amazon For SDE -1.

Location - Hyderabad ( India )

I have 6 months work experience.

Interview details - total 5 round ( 1 online coding + 4 face to face )

1st round ( Hackerearth platform) - two questions were there. I solved 1 out of them. One was easy medium (dfs, bfs based) and second was string based question.

Face to face rounds-

2nd - one array is given which is level order traversal of a full binary tree.while traversing if the node is of odd level we will visit its left child then right child and if level is even will visit right child then left child.we have to form the tree using given traversal.

3rd - 10 mins discussion about current work .

Q1. https://leetcode.com/problems/top-k-frequent-elements/

What if data size is too large can not store in memory, ie. stored in file and you are getting input as stream.Given approach like divide the file in smaller parts ( multi hashmap + heap)
See below link for sol.

https://zpjiang.me/2017/11/13/top-k-elementes-system-design/

The interviewer was Dev manager . Didn't asked me to write full code. Just pseudo code.
And full code for heapify function.

4th -

Q1.https://leetcode.com/problems/longest-consecutive-sequence/
Q2.https://leetcode.com/problems/kth-smallest-element-in-a-bst/

Instead of kth smallest . he asked kth largest.
Full code was required for both question.

5th - 2 Behavioral Questions + 1Technical

Q1. Tell me an instance where your manager told you “ Dont do this”.
Q2. don’t remember

Q3. A story based question was there like A plant is there . It will drop two seeds one at left one at right. Any one or both of them can convert to grown up plant. Then again they will drop seeds left and right.
Finally boils down to full binary tree is there. Any node is either plant or empty space (NULL). At any level length of pipes required to water the plant is distance between left most node ( grown up plant ) - rightmost node ( grown up plant).

Main focus was how will you store the full binary tree representation.if you make tree. Let say n (number of level ) is too high. Eg 1000. How much memory it will consume. Is it feasible for much larger n.

Finally i took approach . I will store it in file in a searlized tree manner.
https://leetcode.com/problems/serialize-and-deserialize-binary-tree/
The will traverse level by level and calculate the value required for each level.

Suggested preparation strategy -

1 .Start topic wise. Filter questions on leetcode for each topic and solve some easy , some medium and some hard problems.

2. Solve top interview questions list on leetcode
https://leetcode.com/problemset/all/?listId=wpwgkgt
Sort with difficulty level and solve all of the.

3. Solve top 100 liked questions
https://leetcode.com/problemset/all/?listId=79h8rn6

After 1 step .Parallely solve topics which you feel need more practice like Dynamic programming / graphs etc. with step 2 / 3.

Understand the logic behind each solution properly. Don’t memorise it.
I was rejected during my 3rd year of college , I had appeared for internship at amazon .

I was asked to find the element which appears once.
I told him the hashmap approach . Then told him the xor approach, i,e to take xor of all numbers.but i didnt knew why this solution works.
I was rejected at that time.

Comments (6)