Round 1: Online Test (2 hours)
The online test was conducted on the Aspiring Minds platform. The test had the following sections:
1. Code Debugging
3. The verbal and logical reasoning
5. Workplace survey
The code debugging questions were fairly simple. Aptitude, verbal and logical reasoning sections were of moderate difficulty level. Coding round was medium-hard ( judging by the coding platform and time constraints). Workplace survey and feedback sections were given equal importance for shortlisting. There were 200 students who appeared for the test out of which 15 students were shortlisted.
Round 2: Technical Interview (2 hours)
There was only one face to face round. The interviewer introduced himself and then asked me to introduce myself. We had some discussion about my hobbies for 15-20 minutes and then we started discussing some Data Structures and Algorithms problems. Following were the problems asked in the interview.
1. Given two linked lists, where each linked list represents a number ( each node contains one digit), you have to design an algorithm to add these two numbers and store the result in another linked list. I told him that I have already seen this problem, so he quickly asked my the approach to solve it. Then he asked me to solve it with various constraints (you cannot reverse the linked list, no extra space, cannot use recursion, etc.). I gave all the approaches that I could think of and then we discussed the time and space complexities of each approach. The discussion went on for 5 to 10 minutes.
2. Give an x n matrix, where each cell contains a distinct integer, you can start from any position and then move to an adjacent cell ( shares side) if the number in the adjacent cell is one greater than the current cell. You have to find the length of the longest path in the matrix. I gave a BFS + minHeap approach. I did not consider the constraint that all the elements in the matrix are distinct, so the interview asked me to optimize the approach and clarified that all the elements are distinct. Then I gave simple BFS approach and we discussed the time and space complexities of all the approaches that we discussed. After discussing the solution, he asked me to write a code for the exact solution that we discussed. It took me 5-10 minutes to complete the code. He kept the code aside and reviewed it at the end of the interview. Then we moved on to discuss some more problems.
3. Given two strings, find the longest common subsequence. This was a standard problem, so he asked me to explain everything about DP ( recursion, base case, optimal substructure, overlapping subproblem, memoization, etc.) We discussed DP concepts for some time and then we analyzed the time and space complexity of the LCS problem.
4. He asked me some core concepts of hashing like the hash function, probing techniques, load factor, etc. Then he asked me what would I do to improve the performance of hashing if I am implementing it in my own project. The interviewer was looking for the word “custom hash function”, I came to that point after 5 minutes and then we moved on to the next question.
5. Given a binary tree, write an algorithm to connect nodes at the same level. This was again a standard problem and I gave the solution instantly. Then he added some more constraints( without using recursion, with recursion, full binary tree, general binary tree, etc.), I was not able to solve it using recursion, so he gave me a hint by asking about different types of traversal. I was able to solve it using post-order traversal after the hint.
He reviewed my code and he was satisfied with it, so we did not discuss much on it. Then we discussed the work culture at Amazon and other IT companies, what is the role of an SDE, etc. I was particularly curious about the team sizes at Amazon and how they collaborate to work on a project.
Verdict: Selected 🙂