Amazon Job interview Experience
pic
Hrishikesh Ugale
Profile
IT Product
CTC/Stipend
Login to view this
Criteria
Login to view this
Session
2020-21
Status
Accepted Offer
Round 1

Computer Based Test Interview

Time
60 mins
Difficulty
Difficult
Interview Experience

It consisted of several MCQs based on OOPs concepts, Operating Systems related questions, Aptitude Questions, Predicting output of given snippet of code, finding error in the code snippet, etc. Test was conducted on platform owned by Amazon itself (Amazon has its own interview and online test tool). Questions were random and mostly different for all.

There were 2 coding questions. Any programming language of choice was allowed (Java, C, C++, Python, Javascript, etc). I preferred Java. Questions were as follows.

1. Duplicate a linked list wherein each node has a next pointer and a random pointer. Next pointer points to the next node while random pointer may point to any random node (Including the node itself). Solution was expected to be in O(1) extra space and O(n) time. (Detailed solution available on Geeksforgeeks)

2. Finding triplet with given sum. Solution expected in O(n^2) time complexity. (Solution: Sort the array and then use two two pointers at extreme ends. Similar question available on leetcode)

Shortlists were announced 2-3 days after the test. Most people who solved both coding questions correctly got shortlisted. (Coding questions were random for all)

Round 2

Technical Interview

Time
60 mins
Difficulty
Medium
Interview Experience

Round started with short introduction. Interviewer first gave a short introduction about himself and then asked me to introduce myself. Then he quickly moved to coding round. Two coding questions were asked.

1) Post Order Traversal of a Tree without recursion. He gave me a example test case to build my solution. He first asked me to discuss my approach. We had a discussion for about 20 min and then he asked me to code it. He then gave few more test cases for dry run of code and asked me to explain the output for those test cases. Finally he was satisfied with the solution and we moved to next question.

2) Dynamic Programming problem. I don't remember the exact question but I was give a square matrix of size nxn with some weights at each location. Initial position is (0,0) and destination is (n-1, n-1). I was asked to find the path with minimum weight provided I am allowed to move only either diagonally downward or straight to right. (Typical variation of DP problem. Many similar problems available of GFG and Leetcode). I first gave him a recursive solution and then optimized it by memoization. This was relatively easy problem as I had practiced DP problems before and question was done in 20 min.

Round 3

Technical Interview

Time
90 mins
Difficulty
Difficult
Interview Experience

For this round there were two interviewers. Both of them were very friendly. They first introduced themselves to me and asked me about my areas of interest, hobbies, projects. I told them that I have worked on android app projects and developed android application for college fest (AXIS). Interviewer then asked me many questions about the design of the application, backend tools, database structure, APIs used, ways to optimize it, ways to generalize it for increasing the flexibility and dynamic nature of application. This discussion went for about 30 minutes.

Then he moved to coding round. Again two coding questions were asked.

1) This was a Java based question. He asked me to design a class KMachine. This class should have a method called startStream(), getStream(), getKsum(). When startStream() method is called, class will take an infinite stream of numbers as input. Everytime getStream() is called, one number in the stream gets processed. when getKSum() is called, I must return the sum of K greatest numbers that have been processed until the getKSum() was called. This was actually a medium level problem but made complicated to look. It was based on Heap data structure where a min heap of size K was to be used and every time when size exceeds K, top most element needs to be removed. A variable is needed to keep track of numbers that enters the heap and numbers that are eliminated from the heap. After a detailed discussion with interviewer for about 30 minutes I was able to code it and he was satisfied with the solution.

2) Another dynamic programming problem very similar to that in previous round. This time it was a rectangular matrix, and each position has certain amount of gold. Initial position can be anywhere in first column and destination is last column. I was asked to find out maximum amount of gold that can be collected it I can move either diagonally up, diagonally down or straight rightward. I was able to give optimum solution in 15-20 minutes.

Round 4

Technical Interview

Time
60 mins
Difficulty
Medium
Interview Experience

I felt this round was very different. Interviewer did not ask my name, neither told his name. Moment I joined interview, he asked me to have some water and get ready for next 50 - 60 min of interview as he wants no interruption in between. (I was bit scared when I heard this :|). He then gave me a coding question. Question was slightly similar to greedy approach problems that I had practiced earlier. Question was that you are designing a railway safety module wherein you will get the information of arrival time, departure time and platform number for each train in form of an object named Train. Train object has a attribute named flag which is by default green. Given arraylist of train, you need to find out all the trains that might collide with any other train and for all such trains, I need to set attribute flag to red. Solution is expected in O(n) time complexity and O(1) extra space.
I was bit confused and could not get the solution for first 10 minutes. I tried to use similar logic used in job scheduling problem (famous greedy problem on GFG). Interviewer was quite silent and didn't give any hints. He was just listening to my approach and commenting if I was going in right direction or not. Then he gave me a test case and asked me to think solution based on the given test case. After thinking for a while, I was able to modify the logic in greedy problem to suit to this problem. I discussed solution with him and then he asked me to code it. I quickly coded it and I could sense that he was satisfied with the solution.

Then he asked to close the code editor and moved to behavioral round. He asked me several behavioral questions and I answered them based on my experience at internship and college projects. Some of the questions that I remember are listed below.

1) Tell me about a time when you learned something new on your own.
2) Tell me about a time when you had to finish something in a very strict deadline and how did you manage to do it.
3) Tell me about a time when you had disagreement with your teammate and how did you handle it?
4)Tell me about a time when you took some calculated amount of risk.
5)Tell me about a situation where you failed in doing a given task and what in way do you see it (Your views about why you failed)?

(Behavioral questions are based on Amazon Leadership Principles. Answers should be such that you should relate it to one or more leadership principles of Amazon)