In September an Amazon Recruiter reached out to me for SDE2 Backend role.
Experience: 2 years 2 months at that time
Entire process took ~2½ months, one round was rescheduled.
OA (3rd week of Sept 2024)
Two questions (Medium/Hard), don't remember exact questions. All testcases were passing in both problems. Some scenarios and questions for tech decisions, and lot's of behavioral kinda questions.
Round 1: DSA (Last Week of Oct 2024)
-
You have given
2n + 1numbers. Each number has his pair except one number.
Every pair numbers are adjacent. You need to find that number who does not have his pair. -
You are given a binary tree.
a. You need to remove leaf node one by one and print the leaf nodes one by one. You can remove leaf node in any order.
b. Remove a leaf node and after removing that node if it's parent became leaf node remove that node first and so on..
c. Remove all leaf node first than remove all new leaf node and so on.
I had optimal solution in all cases. Binary search in 1; DFS code for 2a, same works for 2b as well and DFS for 2c as well but slightly different with maintaing current level and using vector<vector<int>> for return type.
Talked to interviewer for couple of mins and then dropped off.
Round 2: LLD (Last Week of Oct 2024)
Leadership principles - went amazing
I had network issue in this round, lost around 5 mins.
I was asked to implement Amazon Locker. It's a service where users can choose a locker in building full of lockers and get their parcel delivered there. They get an OTP to access that locker. If they don't pick up their item in 7 days, item is returned and locker should be vacated. System should know which lockers are available to be booked, and if items are not picked locker should become available again. User can pick any locker from available lockers in nearby location.
I implemented almost all the required functionalities with modular code, but was unable to finish the 7 days thing. I also overcomplicated the data structures a bit, but interviewer asked me why I needed it and I was quickly able to see that we actually can do something much simpler. We had verbal discussion on the 7 day expire policy and idea was LGTM according to interviewer.
Talked about the "Just Walk Out" concept difficulties and their solutions for some time with the interviewer.
Round 3: HLD/HM (2nd Week of Nov 2024)
Leadership principles - went amazing
In this round, we were running out of time and got less than 35 mins for whole design portion.
Clarified Problem: You have a huge area of around 10 mil km². You have sensors in every 10 km² that send you tempareture data. Design a system to show current temprature and also supports to query past tempratures.
I listed all the functional and non-functional requirements, did QPS and storage estimates. My whole design was based on Amazon tech. There were a LOT of cross questions like push vs pull model, why we need a particular component etc and I was not able give good answer for two. I was also not able to add a SQL database I wanted for recent data. It was discussed verbally and I also added how we can add some ML and show future predictions etc.
Talked to interviewer for couple of mins about the team and what they do and then dropped off.
Round 4: Bar raiser (3rd Week of Nov 2024)
Leadership principles: went pretty good
Interviewer started with 2 sum in an unsorted array, I quickly gave 3 ideas for that, O(n * n), O(n * log(n)) and O(n). He didn't ask me to implement any of those.
Followup: Assume that you already have a function vector<vector<int>> getPairs(vector<int> arr, int target) which returns pairs that sum upto target in array arr. Write a code for vector<vector<int>> getKDimensions(int k, vector<int> arr, int target) where you pick k distinct indices from arr that sum upto target. You must use the getPairs function above.
This one had a short recursive code with exponential time complexity - there's no way to avoid that. I didn't exactly remember the function signature for vector insert(), interviewer was okay with it and code was LGTM according to interviewer. I was also not sure about time complexity as the code was slightly complicated to analyse the time complexity and I was a bit lazy to think too much - I told him what & why I thought and that I might be off by a factor of n. He said "okay that's fine" didn't question it further.
Talked to interviewer for ~10 mins about their old days in tech as they were very experienced.
Compensation (1st Week of Dec 2024)
https://leetcode.com/discuss/compensation/6123742/Amazon-SDE-II-India


