Amazon Interview | Set 23

I was recently interviewed for SDE1 position in Amazon Bangalore. 1 online coding test followed by 5 rounds of F2F onsite interviews.

Online Coding Test (4 Problems, 2 hours) From Interviewstreet
All below problems had multiple test cases for which the code was validated against.
1. Code for converting floating point decimal number to binary numbers. If the number cannot be converted, state so.
2. Given an integer array A of size n. Given an integer k < n. Construct an array B, such that
B[i] = min{A[i], A[i+1], A[i+2], A[i+3], ……., A[i+k]}
Solve in time complexity better than O(nk).
Hint: use min Heaps
3. A singly liked list. Can have a loop. Detect it and find the size of list.
4. A singly link list and a number ‘K’, swap the Kth node from the start with the Kth node from the last. Check all the edge cases.
Sample Input: 1->2->3->4->5->6->7->8 and K = 3
Sample Output : 1->2->6->4->5->3->7->8

Sample Input: 1->2->3->4->5->6->7->8 and K = 10
Sample Output: print error “LIST IS OF LESSER SIZE”.

Face to face: Round 1(Technical, 1 hour):
1. Given a K sorted array. Sort it with minimum time complexity.
O(nlogk) solution was expected. Code was required.
2. Given a file with many product name of an company. You have to find out unique name in the file. Suppose mobile,laptop,notepad,desktop,pen,mobile,pen .. etc is given we have to print laptop,notepad,desktop. Pen and mobile should be remove due to duplicity. 

Code was required.I gave o(n) time complexity solution for it using 1 hash table and Doubly Link List. 





Face to face: Round 2(Technical, 1 hour):
1. Given a Sorted array with one missing number. I have to find first missing number.Code was required. I gave solution with o(logn) time complexity.

2. Give a Building with n floor. A person can take 1 step or 2 step to climb. Find the number of ways to reach nth floor. Code was required



Face to face: Round 3(Technical, 1 hour 20 minutes):
1. Given an Sorted Array with duplicates I have to find first index of any duplicates. Suppose 12222333355578999 first Index of 2 in 1. Code was required.I gave O(logn) Solution.

2. Given an binary tree. Traverse it in zig-zag manner. Code was required.Solved using a 2 stack.

3. In a snake ladder game without snake and ladder :). If some one is playing then we have to find probability to win the game of any player. Condition of winning is if you are on 96 and 5 comes in dice then you loose the game and If you are at 96 and 4 comes then only you will win the game. But you cant use dice more than Y time.

I gave o(XY) Solution through DP. Where X is sum.

Interviewer was very happy after that.



Face to face: Round 4(Manager, 1 hour 20 minutes):
1. Tell me about yourself.
2. Why do you wish to move out of current job?
3. Explain in detail the current project. Intention was to understand whether I had good depth of knowledge of the project and team I was working in.
4. How big is the team & what is your role?
5. Proudest project that I have worked in my current company. Details.
6. Any instances where you are not satisfied with what you did?
7. Any instances that you felt the need for improvement in some areas, which could have helped you technically and professionally. Any negative feedbacks.
9. Write the code to store Binary Search Tree in Doubly Link list. Code was required.
10. Petrol and distance problem given in Geeks for Geeks. http://www.geeksforgeeks.org/find-a-tour-that-visits-all-stations/



Face to face: Round 5(Manager, 1 hour 10 minutes):
1. Tell me about yourself. It starts with a basic intro round, where your communication skills are judged.
2. Why changing the job?
3. Explain in detail the current project. In depth information.
4. What will you do if your module is dependent on some one else and you are stuck due to him. I told him to that I will create stub ( Template of desire data using edge case conditions) 
5. Write the full code of finding a Name and phone in simple phone(In which abc all come on 1 using pressing speed and time duration) using sub string of name. I gave 2 solution 1 using suffix tree and 2 using hash table and KMP Algorithm. He told me to write full code of  this problem using hash table and KMP Algorithm. I wrote the full and Manager was satisfied with my answer. 

Three days later I was informed that I was not selected. With below mail :-



Thanks for your interest in Amazon. We appreciate you sparing time towards discussions with us. After the detailed discussions with you and internal discussions thereafter, we regret that we do not have a suitable opening at present that does justice to your aspirations and capabilities. Hence we would not be able to take it forward at this juncture.

With your permission, we will retain your details in our database and would get in touch with you, should there be a suitable opening in future.

Wish you all the best in your endeavors.

I am still not able to find the correct reason behind it. And Now I am frustrated.

This article is compiled by anonymous user. If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.


Write your Interview Experience or mail it to contribute@geeksforgeeks.org



My Personal Notes arrow_drop_up


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.