Interviewed for Amazon SDE – II with total experience of 1.5 years.
Round 1 (Telephonic Screening):
Q1. Given a number ‘n’ find the total number of binary string of length ‘n’ such that there should be at least one pair of consecutive 1s in a string. Example: for n = 5, 10011, 11101, 11111 are valid and 10101, 10001 are invalid.
Q2. Design classes for the problem, there can be ‘m’ states and for each state there can be ‘n’ political parties. Currently the counting of votes is happening, define functions for following operations (expected complexity O(1)):
- updating the total votes for a party in a state
- get leading party for a state at current time
Onsite Rounds: After 3 weeks of telephonic screening.
Round 2 (Algo and DS):
Q2. Given k sorted arrays, you need to select one element from each array such that the difference of maximum element and minimum element of the selected elements is minimum. Example for k = 3
1 13 27 30
16 20 29
2 3 14 18 19 22 25 28
ans: 2 selected elements (27, 29, 28)
Most optimal solution plus neat code on paper was expected for both problems. I took half an hour each for both the problem. The interview went well.
Round 3 (LLD):
Design Chess, make neat class diagram for each entity, explain relation between the entities, explain how the complete follow will take place i.e. which class/function will take the input, how that input is processed and what values will be returned.
Interviewer dug deep in some classes and asked to write complete function definitions for some functions.
The interviewer was very interactive, gave hints wherever he wanted to dig deep. At the end I created pretty good design. This round also went well.
Round 4 (HM):
There were two interviewer both of them were of manager rank, one of them asked me the question and the other shadowed the interview.
He started with a lot of behavioural questions:
- One time I took an initiative in my team.
- An idea i had which improved customer experience
- An idea disapproved by the team
- How is code review done and many more…
Go through the amazon leadership principle, they are very obsessed about them and try to ask to question around them only, do have an experience prepared for some of the crucial ones like customer obsession, dive deep, earn trust, have backbone; disagree and commit from your previous projects.
Then he asked to design HLD of library system, what should be the DB structure, which type of DB should be used (NoSQL or SQL) and why?
I answered all the questions with great confidence (do remember to answer behavioural question with confidence, your body language matters the most in HM rounds). This round also went pretty well.
Round 5 (HLD and LLD):
Design Railway Booking System, both HLD and LLD is expected in this round. What should be the different components in the system, do we need micro services, how these will interact? what should be the DB structure and classes in the system. I really got confused in this round and went way of road. After a lot of struggle I managed few classes and a DB structure but it was not end to end. This round was bad.
Round 6 (Bar Raiser):
He again started with a lot of behavioural questions, most of them were on customer obsession.
HLD for Instagram, What should be DB structure, kind of Database should be used, sharding policy and some other design related questions.
He also asked an Algo question:
Given a list known ratios, find ratios for the query list.
A B 0.3 (means A/B = 0.3)
B C 0.2
D A 2
A C (Find A/C)
After the bar raiser, the HR told me that response from my interviewers are good and thats it for the day. After 4 days i got a call from her, she congratulated me as I made it and the offer was extended to me. The overall experience was very good. The HR was very supportive and guided me time to time, telling me what to prepare, how to answer, which leadership principle to focus on for each round.
- For SDE 2, Amazon don’t focus on algo and DS much, just go through the standard question on G4G and that will be sufficient.
- Do prepare design well, both LLD and HLD is expected out of you. Educative.io is a very good source for it, its not free but its worth it.
- For LLD prepare list for standard questions which you can find easily in Amazon experiences and try to create solution first by your own then just search them online.
- Be very confident in HM round, if HM finds you fit for the role, he will fight for you even if all other are against you.
- Most important of all, Prepare the Leadership principle very well, keep a story ready for at least few of them.
- Last but not the least, believe in yourself anything is possible, almost everyone told me that they not gonna hire a 1.5 year experienced guy for SDE II, but they did, so trust yourself and go grab it.