I have recently fumbled my interview rounds for the SDE-II role at Amazon big time. I think it's worth sharing. Since all of my professional work experience so far has been for early stage startups, I didn't get a chance to work on stuff where horizontally scaling the servers was necessary. So, my long-term goal is to work at a place that has a product with a lot of users. Amazon is one of them, despite how bad rep they get for their work culture.

I applied to a few positions on Amazon's career portal a few months back because even though Amazon looked very busy breaking their own records in laying off employees, their careers page also had a few recent openings. Anyway, after 3-ish days, I received an OA, which had 2 problems to be solved in 90 minutes, a "work-style simulation" based on their "leadership" principles and a somewhat basic system design quiz.

Online Assessment

It had two problems, surprisingly both problems were based on bitwise operations. First problem was of medium difficulty, I cannot share the exact problem, but it was based on range XOR sum queries (via prefix XORs), and was trivial if you knew the ball knowledge:

XOR_SUM(a[i]..a[j]) = pref[j]^pref[i-1];

Second problem was this one, it was hard but I was able to come up with a greedy approach where we start with 0 as our candidate answer for final AND, and try to get 1 at each position of our candidate answer starting from MSB to LSB, where we check the feasibility of including m least expensive elements using at most k total increments.

I was able to solve first problem within ~15 minutes, and spent the rest of the time on the second problem.

I also skimmed through the Amazon LPs before the OA, so I don't mess up the workstyle assessment questions.

Round - 1

Interviewer was SDE-2, he was younger than me, he joined 5 minutes late, I was already nervous pro max and panicking because this was my first time interviewing for FAANG, he joined and said don't worry we'll extend by 5 minutes. We introduced ourselves, and he jumped to problem solving right away.

First problem was this one, which I knew how to do, so I told the optimal solution, stated complexity, asked if I should start writing code, coded it up, we were past 20 minutes by now.

Then he asked the second problem this one, for which I was able to come up with a brute force BFS solution, but I ran out of time. I regret picking java as my language of choice for the interview. Also, my solution wasn't really optimal, the interviewer tried to give me hints, but I crumbled under pressure of time running out since he had mentioned in the beginning he is expecting optimal solutions to BOTH problems. As soon as the interview was over, the hint he gave clicked, but it was already too late. I was not able to complete the bfs(...) function because it's standard and I have run out of time. He said now he has to ask me some questions based on LPs, which he asked and I answered.

Round - 2

Two weeks went by, and my second round was scheduled, this guy looked really tensed for some reason. After introduction, he asked me to write API for music library app, expectation was to tell class design for entities and only requirement was that he wanted low latency for getTopKPlayedSongs(k) and getTopKPlayedSongs(artistId, k), addSong(artist, song). I started with listing out entities like Player, Artist, User, Song, Library etc, and then I went blank, I knew how to do getTopKSongs(k) in O(log n) with a HashMap<Count, Set<SongId>> and a TreeSet<SongId,Count> combo, which I told when I ran out of time, but again, the expectation was to get a "production-level" code in 30 minutes.

It requires at least one soft yes to get to round 3 and round 4, and knew immediately after second interview was over that I didn't get it.

Key takeaway is, time is way more limited in these interviews, you get ~20 minutes to explain and code the optimal solution. Good thing is, I was able to solve every problem so far, so we're past "wtf do i even do here man" stage, so that's some progress, but need to work on time and not panicking.

We're just not there yet gang, the grind must go on, maybe in next 6 months :)