Amazon Interview Experience | On-Campus for Summer Internship

Arthak
Coding Blocks
Published in
4 min readAug 30, 2019

Round 1: Online Assessment — 2hrs

This round had four parts, first of which had seven programs that we had to debug in a time span of 15 minutes. Problems were quite easy, but for this round, only C++ and Java were allowed. So Incase you code in Python practice a bit in Java or C++ for just in case.

The second part consisted of 24 logical reasoning questions which had to be done in 35 minutes. These questions were pretty easy to moderate, although I got them in about 25 minutes time management is key here, as some students had some problem with time in this part.

The third round consisted of 2 coding questions that are given below:

1: https://www.geeksforgeeks.org/pair-with-largest-sum-which-is-less-than-k-in-the-array/. It can be done in O(N log N) by first sorting the array then using binary search for the pair.

2: https://www.geeksforgeeks.org/program-round-robin-scheduling-set-1/.The second question was to find out the average waiting time of processes in Round Robin scheduling.

In the fourth part, there were a lot of questions on work ethics and your personality, although it did not seem really important but this was a key part of the test as a lot of students who did everything correctly but did not fill this form seriously did not get selected.

52 students were shortlisted for the interview round among 250 students.

Round 2:(Face to Face interview — 1 hour 30 minutes)

At the beginning of this round, the interviewer asked me to introduce myself and talk about my Research Intern at IIIT Delhi. I did so and then moved further to explain two of my projects. He did not ask about any other thing in my Resume.

The first question he asked was that I am given a special Binary Tree in which the leaf nodes form a Doubly Linked List and the left pointer of leftmost leaf node and the right pointer of rightmost leaf node points to itself and I had to print the inorder traversal of this tree. I solved this quickly by identifying the leftmost leaf node because it points to itself while doing inorder traversal and saving the pointer to the element to it’s right in the linked list and continuing the inorder traversal so that when my node points to this saved pointer, I know that the node is a leaf node and continue the process.

He then changed this question by saying that the left pointer of the leftmost leaf node now points to NULL. So my solution needed a change, and now I traverse to the rightmost leaf node and traversed the link list till I reach the leftmost leaf node, store it as a pointer and used my earlier solution.

He again changed the question by saying that both left of leftmost leaf node and right of rightmost node points to NULL now. I took some time but reached the solution by observing that all nodes in the tree except the leftmost leaf node were being pointed by two nodes. So I traversed the tree and saved the count of each pointer that occured as either left or right of any node in a map and while doing traversal if a node had a count of 2 in this map then it was a leaf node and I could do the Inorder traversal. He asked me to write the code for this, so I wrote it’s code and he pointed a that there is a bug in this code and I resolved it (I wasn’t accounting for NULL values in the map).

The next question was about implementing a Shuffle feature in a music app. So I told him an algorithm to shuffle the list randomly, while making sure that no song is repeated.

Next, he moved on to ask about some questions about the complexity of BSTs, AVL trees, and their uses. Then he asked me if two nodes are swapped in a BST, correct it (https://www.geeksforgeeks.org/fix-two-swapped-nodes-of-bst/). He was satisfied with my solution.

He asked briefly about some basic questions in DBMS and OS like ACID properties, caching etc.

He then asked about the complexities of Min and Max Heaps and their uses.

This was the end of the interview and the interviewer asked me if I had something to ask, so I asked 3–4 questions to him and the interviewer seemed pretty satisfied.

At the end of this round, 14 students were selected for the Summer Internship.

--

--