Amazon SDE2 Interview Experience
I recently completed interview loop for Amazon SDE2 role India.
Applied through career portal in last week of August.
Experience : Nearly 3.2 years at time of application.
Entire process took nearly 2 months as need to reschedule couple of interview as I had travel plans
OA:
Two questions (Medium-Hard)
Don't remember exact questions. First one was medium and based on string and hashing and second was little hard.
First qustion: all test cases passed
Second: Hard question based on sliding window algorithm. 10/11 passed, 11 got TLE, couldn't optimise.
Telephonic Screening Round:
Discussion over system design of TinyURL.
Round 1: Coding
-Leadership principles
-Serialise and Deserialise binary tree. I didn't know exactly solution of this problem (however it's a standard problem)
First I gave solution having left and right subtree in parenthesis. Then he asked me to remove redundant space in serialized string,
Then I gave some BFS algo, which turned out to be O(N) space complexity solution,
Then He asked me to optimise in space and give DFS algo, Eventually I figurd it out and it turned out to be the solution he was expecting.
-Follow up: Serialisation and Deserialisation of n-ary tree.
I did dry run over my previous solution logic (with list of next nodes connections) which was working for n-ary tree.
Round 2: Coding
-Good grind on leadership principles
-Given two integer arrays and for each element of first array, print largest integer which is less than the element. First I discussed Binary search approach with O(nLogN) time complexity.
I asked interviewer if there is any constraint on first array order (query elements order), If not then we can assume some linear sorting algo (Didn't implemented the sorting also) and after sorting both array we can run two-pointers alogic on both array.
-Count maximum area of island, for which I gave bfs based soulution. Discussion over the code for solution.
-Follow up : Assume the grid represent globe, (I took liitle time in understanding what he wanted to ask), Then made couple of line changes in previous solution and did dry run.
moving to right from rightmost column will land in leftmost column in same row and vice-versa for row-columns.
Round 3: HM (system design)
-Good grind on leadership principles, little struggled in a scenerio.
-Design of Pastebin services
In this round, we were running out of time and got 25-30 min for design.
he gave me time to note down requirements by myself, couple of minutes later I asked if he would like to add anything,
He said it's fine and ask me to start writing services.
I directly jummped to services but missed to ask few question related to text size and all which I was planning to ask in capacity estimations
I explaned him end to end flow, why I used components and all stuff.
Later I asked if he could comment where I can improve since it was my first time appearing in HM-system design interview (apart from amazon telephonic), he told me that few things which I missed should be upfront. Rest he said it's okay for a 3.5 year of experience, but for this role the used to operate with someone around 5 year of exp.
Round 4: Bar raiser
this round was resheduled on same day I had it, by mistake I joined older link, which was still there in new mail.
After that I joined another one after around 8-9 minutes.
Question:
-Word ladder : I gave BFS solution,
while writing the solution, I got little confused and thought of using priority queue but later I said we don't need it and give simple queue based solution.
-Follow up : print all ladders of minimum length.
for this I told her first we will find the minimum length from above solution and then print all paths using DFS and shall omitt/optimise when path length surpasses the minimum.
-Some scenarios discussed for leadership principles.
here I did a mistake, she asked me to tell something which I hadn't told in earlier rounds, but I told a scenario which was already discussed in one of the round. I realised this later after interview because the loop took nearly two months.
Edit:
Got to know around 1 week later that they want to have additional LLD round as it's a competency for SDE-2 role.
Question:
-Design of Movie ticket booking system
Interviewers Feedback : Emphasize more on Design principles, Database schema design and end-to-end flow rather than creating object and class relation. Was good on requirement collections. However I answered all questions he asked and I felt it was okay.