Round 1 (Online Assessment)
Questions:
- Find the maximum level sum of a tree. Basically find the sum of each level of a binary tree and return the max sum.
- An array question involving sorting and two pointers (it was easy).
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 2 (DSA)
Questions:
- Introduce yourself, where you work, etc.
- Find the largest subarray with sum 0.
- Course Schedule II - Instead of courses, it was software packages. Discuss time and space complexity of everything.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 3 (LP + LLD)
Questions:
- Introduce yourself and discuss Amazon Leadership Principles (LP).
- Design a data structure to store historical search terms and their frequency. When a user inputs a new search text (
search_input
), return the top K most frequent search terms that have the same prefix assearch_input
. Update the search terms and their frequency accordingly.
Candidate's Approach
- Used Trie to get the prefix terms.
- Explained a brute force approach using a hashmap and heap to get top K.
- Optimized approach: Store the frequency map of search terms under the current Trie Node in every node of the prefix Trie. Querying retrieves the top K from the map using a heap.
Interviewer's Feedback
The interviewer mentioned that the code structure was good and that this round wasn't focused on DSA but rather on how the candidate writes code.
Round 4 (LP + DSA)
Questions:
-
Introduce yourself and discuss your college projects.
-
Java-related questions:
- What is static used for?
- Can methods be static?
- Can properties (class variables) be static?
- Can classes be static?
- What’s the default value of variables inside a method if you don’t initialize?
- What’s the default value of properties?
- What’s the need of a constructor?
- How to run some code before the constructor?
-
Recursion question:
- Say you have
V
units of money. If you give it to the bank, they’ll give you backV/2
,V/3
,V/4
units of money in exchange. Find the maximum amount of money you can get. - Example:
Input: 12 Output: 13 Explanation: 12 -> 6, 4, 3 -> 13.
- Say you have
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Compensation
- Base: 19,17,000
- Sign-on bonus: 6,47,000 + 5,18,000 (2 years)
- RSU: 15,56,000 (5% + 15 + 40% + 40%) (4 years)
Current Experience: 2 months internship + 2.5 months of experience at CHWTIA.
Notice period is just 30 days due to probation.