I had an OA + 3 phone screen rounds that I had to clear
November 2024 (3rd week): Got a mail asking to apply for SDE-1 if I am interested (they had my mail since I had tried to get a summer internship there)
November 2024 (last week): Got the OA link (easy)
1st question: Find the maximum level sum of a tree. Basically find the sum of each level of a binary tree and return the max sum
2nd question: It was an array question. It involved sorting and two pointers (it was easy)
December 2024 (last week): Got a mail saying I have a virtual interview the next day. Had 2 rounds in 2 days.
Round-1 (DSA):
Introduce yourself, where I work, etc
Every round is programming language agnostic
1st question: Find the largest subarray with sum 0
2nd question: https://leetcode.com/problems/course-schedule-ii/ - Instead of courses, it was software packages
Time + space complexity of everything
Round-2 (LP + LLD):
Introduce yourself, some Amazon Leadership Principles (LP) questions
1st question: Design a data structure in which you can store historical search terms and their frequency of search. When a user inputs a new search text (search_input), return the top K most frequent search terms that have the same prefix as search_input. Also, every time there is a search being made (a search input being given) the search terms and their frequency should be updated in the trie/map. (if its a new term, frequency is 1, otherwise increment the frequency of the search term)
I used Trie to get the prefix terms and then explained the brute force approach of getting all terms with the prefix and getting their frequency from a hashmap and heap to get top K
The interviewer asked me to optimize for time and compromise space. After 20 minutes of long back and forth and multiple clues I managed to come at the optimal approach. You just store the frequency map of the search terms of every word under the current Trie Node in every node of the prefix Trie. When the user queries you get the top K from the map using heap and return it.
The interviewer told me at the end that my code structure is good and that this round wasn't focused on DSA but rather how I write code, etc. But I still felt bad about it since I needed so much help and time to arrive at the solution
I thought I got rejected since I didn't hear back until the next week
Jan 2025 (1st week): Got a mail saying I have round-3 the next day
Round-3 (LP + DSA):
Introduce yourself and talk about your college projects (since I wasn't in a project in my current company yet)
Had 5 LPs for around 20m. Felt exhausted by the end of it.
He asked me in which language I was comfortable in and I said Java. He then asked me a few questions on Java
- What is static used for? (To access something without having to create an Object. They will be allocated memory as soon as the program runs)
- Can methods be static? (yes)
- Can properties (class variables) be static? (yes)
- Can classes be static? (I said I wasn't sure)
- What's the default value of variables inside a method if you don't initialize? (it was null but I said 0 for int, false for boolean etc and then he asked me to run a code on online IDE and was proven wrong. I quickly corrected by saying I'm sorry I got it mixed up with arrays which have these default values)
- What's the default value of properties? (0 for int, false for boolean, cuz they get initialized by the constructor)
- What's the need of a constructor? (memory allocation, initlization of properties, intial code block if any)
- Say you want to run some code before the constructor, how would you do that? (static block)
Then I had one easy recursion question that can be optimzied using memoization
1st question: Say you have V units of money. If you give it to the bank, they'll give you back V/2, V/3, V/4 units of money in exchange. The bank will only give the integer parts and keep the fractional parts. Find the maximum amount of money you can get.
Ex:
Input: 12
Output: 13
Explanation: 12 -> 6, 4, 3 -> 13. If you split the 6 again, it'll be 3+2+1=6 so no point. Same with 4. and If you try to exchange 3, you'll get 1+1+0 = 2 so you won't exchange. So max you can get is 13
I got a call from an Amazon recruiter the same week saying I cleared the interview
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 Exp: 2 months internship + 2.5 months of exp @ CHWTIA
I'm lucky to be under probation so my notice period is just 30 days


