Amazon | SDE2 Offer | Chennai | July 2020
Anonymous User
4108

Status: B.E Comp Science from tier-3 college, 3 years experience.
Position: SDE at an Indian product based company.

This is going to be a long post. I like writing :p
The first part will be the interview experience itself, the second one will be personal experience, tips, musings etc,

Recruiter reached out to me on LinkedIn regarding this job opportunity. Fortunately I was already preparing for about 2-3 months (mostly cp) so I agreed and she setup the online assessment about a week later.

Online assessment
2 questions. The first problem was a BFS based question, easy-medium. Solved it with ease, all test cases passed. Second problem was an array based problem again easy-medium. Had a small bug in my code that I couldn’t find and started panicking a bit. Fortunately since I solved the first one quick, left me a lot of time for this one. Found the issue, fixed it, all test cases passed.

After this the recruiter informed me we can start the interview process. I requested for about 2-3 weeks for prep and I got that much. She sent over a few docs regarding the process and things to revise. First two rounds happened on the same day, one after the other.

First round (DS/Algo/Problem solving)
Straightaway started with the problems.

  1. Remove all duplicates from a string, preserving the order of characters (easy) - Sort of like a warm up question. Discussed the approach, then wrote up the code.
  2. Bottom view of a binary tree (medium) - Knew the approach already. We had a discussion over it, then wrote up the code. Made a dry run over it with a test case.
  3. Given a list of adjacent petrol pumps, check if a circular tour is possible. Next petrol pump will be some ‘d' distance away and each petrol pump can give you ‘p’ units of petrol (medium) - Without thinking much gave him a naive O(n^2) solution of taking each petrol pump as starting point and checking. Surprisingly he okayed it and asked me to write code for it. This wasted time. After I wrote the code he asked if I can optimise it. Now about 10ish minutes were left and I got a little panicky. I realised an optimisation which will make it O(n), discussed it. I wrote the code hurriedly but wasn’t 100% sure it would work, before I could test it, time was up.

Second round (DS/Algo/Problem solving)

  1. Max in windows of size k (medium) - Gave an approach quickly as I had solved it before. He realised this and asked me to come up with different approaches. I gave him 3 different ways to solve it, then he asked me to code up any 1 of them. I coded up the dequeue based O(n) solution. He did a dry run with a test case.
  2. Minimum coin change (medium) - Given a list of coin denominations, find the combination with min number of coins that summed up to a target. Then I did not know it is a variation of coin change dp problem, so I gave a greedy approach. Realised it won’t work and switched to dp based solution. Worked out the recursion, then formed a bottom up dp from it. He asked me to code. Mid way through he said he wants the actual combination of denominations and not just the number of coins in that combination. I had to quickly modify the code, there wasn’t much time left for thinking had to straightaway write the code for it. At the start too about 5-10 mins were wasted as there was some misunderstanding regarding whether multiple coins of same denomination are allowed or not. But I managed to finish the code in time.

Recruiter called me up 2-3 days later and informed me we will move on to the next rounds. She didn’t have much feedback but said problem solving feedback is good. Again 2 rounds happened next week on the same day, back to back.

System design round
Asked me to introduce myself, my role currently in depth. Then a few Leadership Principles (LP) questions were asked. Also delved into some technical aspects of a project mentioned on my resume. Asked me the trade-offs/design choices I had made in it, reasoning for it etc.
Then he asked me to design a massively multiplayer online game like Pubg. Asked clarifications and framed a definite problem statement for myself, did some capacity estimation. Gave a rough architecture, then he immediately deep dived into how to match players, find players of same level, handling peak game time when many are online etc. I tried to separate concerns for the mobile client and server, pre spawning of game rooms in anticipation of peak time, cut off time after which game can be started with less players/bots, thread/process for handling a single game which will receive 100 (players) * 60 (fps) updates per second over sockets etc.
I like real world problem solving, so I did well. We were still discussing approaches and time was up. Initially he said he wanted to try and get a low level diagram too but we spent a lot of time on the high level architecture itself.

Hiring manager round
Again started with me introducing myself and then into LPs. His approach was interesting. He would ask a LP question, then delve into some technical aspects of my answer. He went deep into the technologies I mentioned to check my understanding of it. LP questions can sometimes throw up a surprise and only experience can help you there. For example - I was explaining how we solved a file fetching issue in my current job by using an in-memory cache like Redis. He asked me what other choices did you have? What could be the potential issues with your in-memory cache approach? It forces you to think. I thought for a while and said that serialising/deserialising over network could be an issue with using Redis for large chunks of data.
Be prepared to justify any technical choice you had to make, even realise potential pitfalls in the best approach. Then he asked me to design a system like the Youtube recommendation system. I decided an architecture which uses a message queue into which analytics events regarding views/likes/time spent on video are being pushed, a Lambda to batch analytics requests, NoSQL store for big data, offline ML model which will generate recommendations. What recommendations can be given when the ML model is still training for a new user? Use a simple market basket algorithm which will give recommendations based on similar users (what Amazon retail site uses) till recommendations generated. This round I felt, went really well.

HR contacted me, setup the final bar raiser round for next week. She did not have any feedback from the last rounds.

Bar raiser round
Intro, LPs. Gave me a programming problem, for each element find the first element larger than it to it’s right. I had feeling a stack would work, after working out a few examples found the solution. After coding it up, interviewer asked me to reduce the lines of code. First time I had encountered this. He said there are a few redundancies in code, I checked and removed whatever I could. Follow up - use the same stack to find the first number smaller than each element to it’s left. A little head scratching then I got the solution. Again he asked me to modify existing code itself with minimal change. Took only a one line change actually.
About 40 mins were over by this point. He said for the design problem, he’ll consider my performance from earlier rounds. I deduced that either design rounds either went really well or really bad 🙂

About a few days later, got a call saying I had been selected! Very satisfying experience. Finally got into a FAANG company. Overall process was very smooth, I was kept well informed. Hiring Manager later called me up, asked me to shoot any questions I like. Explained about the role, tech etc. This was a really nice gesture. He also urged me to call him up for any doubts I have before I joined 2 months later (have a notice period of 2 months). Compensation details - https://leetcode.com/discuss/compensation/865832/Amazon-or-SDE2-or-Chennai

Tips

  • Coding - Start practicing on codeforces, leetcode, hackerrank etc. If you are focusing on just interview prep, leetcode is the best. Coding is the most important part of any FAANG interview. Create a routine, attempt problems daily, set a cutoff after which you can look at the solution, then code it up yourself. Don’t just read the solution, always code it up yourself after understanding. This is called up solving and is very important, this is the way your standard of problem solving will go up. Have a healthy mix of problems that you can solve with some effort and one that is just beyond you. Don’t fall into the 20 Easy/70 Medium/30 Hard trap, if you can solve a problem that you know you couldn’t have yesterday or a week back, you’re doing well. There is no hurry. But keep at it relentlessly.
  • Focus areas for Amazon - Trees, Graphs (BFS, DFS, Topo sort), DP, Stack/Queues. Amazon usually asks DS heavy questions. Though Amazon sometimes repeats their questions, interviewers can twist the problem, ask for different approaches or ask follow ups. If you don’t practice enough you are trusting your luck to get you through. Also quick solving and coding up is required.
  • Personally, I maintained a Google sheet with problem name, link, difficulty, comments, learning of every problem I solved. Green fill colour for problem solved on my own, orange if I solved with editorial, red if I couldn’t solve. Reds motivated me to practice more and soon there wore more and more greens even for LC Hard questions.
  • Low level design (LLD) - This was my weak point, having worked mostly on haphazardly written procedural code. Understand SOLID principles of object oriented design. For design patterns please refer Chritopher Okhravi’s playlist - , he is amazing. I would go through a single design pattern, then on my own think up and code an example where it could be applied, then wrote situations where it can be applied. Helped me understand design patterns deeply. Gave me confidence in solving LLD problems. Also try and come up with LLD for random problems (design library, online reader, music player, furniture factory, kitchen etc.)
  • High level design (HLD) - This was my strong point. Fortunate to have worked for a new team, that was scaled from the ground up for 3 years I was there. If in a rush, I would recommend g.r.o.k.k.ing system design interview, it is sort of a crash course. If you have the time, do it the right way. Understand how things work deeply. How a web server handles each request, does it spawn a thread or a process, thrashing between processes, penalty of disk access over RAM access, bottlenecks of network latency vs network bandwidth, TLS, TCP three way handshake, load balancing, sharding, SQL vs NoSQL, message queues and it’s philosophy, async processing, data structures used in DB indexes etc.
  • I love going through architecture of software giants on http://highscalability.com/. It makes things so interesting. HLD is actually real world problem solving. Gaurav Sen’s channel is also pretty good - . We used to work in the same company 😛
  • Dynamic programming may/may not be useful to you as a developer. LLD and HLD skills will be invaluable throughout your career.
  • Leadership Principles/Behavioural - This is Amazon specific and they care about it. For each LP, write down examples from your real life work. If nothing relates, don’t make up stories. Just give an example of how you impacted the team positively and solved a problem. In general companies look for a team player who can also lead. Should be helpful, reliable and have confidence in his/her abilities.

Aside from all this, I believe in India brand name is a big thing to land interviews unfortunately. I know a few startups who allow graduates only from ‘IIT/BITS’ (premier Indian universities) to apply. You can’t even apply or send in your resume! I desperately hope I am wrong about this but you do need either a good college or company on your resume (for big companies). Sometimes even that may not be enough, I joined my company as a Web Developer. A year back when I was looking to switch, I would land no interviews from big companies. Even getting referrals wasn’t enough. In one case, a senior PM I knew referred me for a big online payment co, despite this I wasn’t even called for interviews and got a rejection mail in a few days.
Things changed once I was promoted at my current company. I applied internally and passed all interviews, got promote to SDE. For those who don’t have a brand name on the resume, do not lose heart. Keep preparing and applying, whether you will be called or not for an interview is not in your hands. Even back then as a web developer I landed a few offers at good startups/product companies after a long struggle.
You can also read my recent Uber interview fail here - https://leetcode.com/discuss/interview-experience/730072/Uber-or-SE2-or-Hyderabad-or-July-2020-Reject

This was a great journey for me. Although the destination is important, this journey definitely made me a better developer. There were moments of anxiety and panic attacks too. At the end of each day I asked myself, did I give my 100% today and am I better than I was last week? Remember the easiest person you can fool is yourself. Enjoy the journey, learn as much as you can. Don’t let an interview decide your worth. Keep your spirits up!

“Life is a shipwreck, but we must not forget to sing in the lifeboats.” - Voltaire

Comments (10)