Amazon Interview Experience | 6-Months Internship for SDE-1 (On-Campus)
1st Round Details (Coding test): Coding round on their own platform. It consisted of 4 sections.
- 7 debugging questions (C++/Java).
- 2 coding questions.
- Psychometric test based on Leadership principles.
- Aptitude and Logical reasoning.
2nd Round Details (F2F technical round 1): Introduced myself and jumped right into coding. The following two questions were asked.
- Given a binary tree, write a function to check if the tree is a mirror image of itself or symmetrical. This was done using recursion with time complexity of O(n) and space-complexity of O(1). We discussed the approach and the interviewer was satisfied with it. I was asked to code it completely, covering all edge cases and having no bugs.
- Given a string of 1’s and 0’s, we can flip the 1’s to 0’s and the 0’s to 1’s. Find the minimum amount of flips required to make the string monotone increasing (all the 0’s on the left, and 1’s on the right). This was a dynamic programming question. I didn’t get the approach right on the go, but the interviewer gave me a hint, and I was able to code it. He wanted the most optimized solution which I got in the end.
Note: The above link is somewhat similar and the space complexity of the solution can be optimized even more.
3rd Round Details (F2F technical round 2): Again, just introduced myself and jumped right into coding. The following two questions were asked.
- Given a row-wise and column-wise sorted matrix, return the kth highest number. I solved this using a max-heap. The interviewer was satisfied with it and asked me to code it from scratch (including the class for a heap). I think it could have been optimised even more.
- Given the employees of an organization, each employee can mail two other employees, and so on. The CEO is at the root. Calculate the time taken for ‘m’ mails sent by the CEO to reach all the employees. This was a binary tree question and can be solved by finding the height of the tree.
Note: The above link is for kth the smallest element.
This was the last round and there were no HR questions, questions about my projects, or other topics.