Amazon Interview Experience
- 28 MCQs based on Data Structures & Algorithms, Database Management Systems, Operating Systems, Predicting C and C++ output.
- 2 coding questions:
Note: Test conducted on mettl platform, do atleast 1.5 coding questions for good chance
Pen Paper Round: Given 2 questions, discuss the approach with an assigned mentor and write code on paper handling all test cases. Make sure the presentation is neat, good variable names are used, comments are given to explain what each block of the code does, use least time and space complexity.
The questions were:
- Count all possible paths from top left to the bottom right of an (m X n) matrix(similar to below link but the matrix was also given which was filled with either 0s or 1s, the path can only be made of 1s)
- Find the vertical sum of a binary tree
Technical Round 1:
- Given a linked list, connect the first to last, last to second, second to second last and so forth.
Input: 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> NULL Output: 1 -> 6 -> 2 -> 5 -> 3 -> 4 -> NULL
- Next greater element in an array
After writing code, just do a dry run, it should handle all corner cases. The interviewer is going to count the number of errors.
Technical Round 2: The interviewer was very friendly and gave me hints and a lot of time.
- He asked me about my projects(basic level and didn’t go deep), the 4th year project even though I didn’t mention it in my resume.
- The coding question was to count the number of turns in a binary tree.
I told him some observations and asked him for some hint, he simplified the question and made the question given a node and the root, find the number of turns in the path. After some time, I was able to come up with an answer. He asked to optimize and I came up with an answer after some more thinking.
Technical Round 3:
- Tell me about yourself
- Given an array, left index and right index, return the sum between the given indices in less than O(n) time. Segment trees
- Building heaps, merge sort, insertion sort, count inversions in an array
- Basic Database Management Systems & Operating Systems questions like :
Tips: I kept solving questions from the following link. Have some good projects, some certifications if possible on a resume, I used a website zety for building a resume. Practice typing or writing code instead of reading it. I am deeply indebted to GeeksforGeeks for providing all the necessary resources.