Current Status: New Grad(Dec 2019), BA in CS
Position Applied: Software Development Engineer 1 (2020 New Grad) @ Seattle
Hey all, so I've posted this thread back 2 months ago when I first got my OAs. Since then, I've passed the Final Virtual Interviews and I wanted to repost because this is now a full on post for those who had the same questions that I did! :) I was very anxious leading up to this interview, so to me, I want to help those who helped me!!
My Experience:
Current Timeline:
I know that there are a lot of other posts out there discussing the OA's, but they're very non-chalant about it (i.e skip description of OA's). I'll talk about it here because someone else could be looking for them as well!
Part 1: Debugging Code
So, for the the first OA, it's a basic debugging assessment. You are given 7 functions/methods and there's a bug in there that isn't producing the correct output. They aren't hard to decipher, if you read the prompt and function title (it tells you what it's doing). I was an idiot and just skimmed the first two so I wasted a lot of time trying to figure it out :(
You get 7 of these and you're just trying to find syntaxical error and/or if the function is MISSING a variable. Usually, you do NOT need to change more than 1/2 lines of code. If you're doing more than 1/2 lines of code (maybe max 3??), you probably read the question/function wrong.
Part 2: Technical Questions and Personality
For part 2, it's what most of you (or if you've never done an OA) have already experience. I got 2 medium questions, which were both on leetcode (sort of...they were different variations). The entire technical question is 70 minutes, so use your time wisely.
Q1: https://leetcode.com/problems/search-a-2d-matrix-ii/
So, while I did get this question, mine was asking for a different return value. In this leetcode example, it asks to return a boolean value, however, in my OA, it asked for specific coordinates. It's basically the same thing, just wanted to give a heads up. Another great problem to practice was this: https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/. I had solved this one about 1-2 weeks before this OA, and it's another good source to practice searching a 2D matrix. I spent about maybe roughly 15-20 minutes solving this one since I knew I had to implement a binary search.
Q2: https://leetcode.com/problems/copy-list-with-random-pointer/
Now, this one took the most time because I've never seen it and I was so confused at what they were saying in the Amazon prompt. But it's basically the same exact question, where they give you a class Node to use and you're just making a deep copy. I spent almost 40 minutes trying to solve this one, only to realize that I just needed to use a dictionary to store where the nodes were pointing next. Then, build a new list that pointed to the correct new direction.
Part 3: Simulation and Logic
For this section, the total allotted time was 2 and a half hours, so be prepared to sit through a very long process. I had a cup of coffee by my side and took a restroom break earlier. The simulation was about 1 hour and 15 minutes for me and then I spent 30 minutes on the logic portion.
Simulation:
During the simulation, you watch videos that simulates what the current problem you and your team are running into. You get "fake" emails that tells you that there is an error in the system, here are the logs, what do you think the error could be? There is 5 total modules with 5 different problems that you're trying to do. I don't think this simulation gives the exact experience, but it does give a insight into what might occur when different things are all happening at once. I would consider reading through: https://www.amazon.jobs/en/principles and https://medium.com/@scarletinked/are-you-the-leader-were-looking-for-interviewing-at-amazon-8301d787815d. The simulation is basically trying to see if you are incorporating these Leadership Principles into your decisions. I honestly felt like a drone during this simulation as I felt like I had to answer in their ways, even though there are different approaches to how to attack a problem. But I will end my rant here.
Logic:
I'm about 100% sure that all of you, domestic and international, have taken a standardized LOGIC portion where they test for your problem solving. In this section, you have 35 minutes to solve 25 questions. They are all multiple choice.
1st Round - SDE 3, been at Amazon for a couple of years
So, my first round was by far my weakest round. I think it was because I was very anxious and nervous about it. But, he came into the chatroom and introduced as an SDE 3. Then, we jumped straight into code.
I don't remember the exact question, but it was something along the lines of:
Q1: Given a line or multiple line of texts, return N least frequently used words from that text. In the case of a tie, return them alphabetically.
Solution: I stated the brute force solution, which would've been an O(n^2) runtime solution with O(n) space. However, I optimized it quickly to using a min-heap, which is O(n) runtime and O(n) space complexity. It's a rather straight forward question if you've seen min-heaps before. However, my interviewer was NOT very well versed with Python and the Heapq library. So, when I told him that we would use "heapq.heapify(list)", that it'll sort for us based on the first value of the tuple, which is the frequency, and then the second value, which is the actual string, he kept asking me to show him where I'm doing the sorting. So, I easily could've been tilted, but I just kept pushing on and explaining it to him.
After this, I was given a second question, with about 10-15 minutes left and he wanted me to write as much code as I could, but I wouldn't be penalize if I couldn't.
Q2: Given a list of integers, return a list of intervals that clearly identifies all the possible ranges.
Ex: input = [9,2,4,5,6,-1] => output = ["-1", "2", "4-6", "9"]
Solution: When I saw this question, I remembered passing through Leetcode for intervals, but I'd never actually did it. So, I just calmed down real quick and started by stating any solution since I was out of time. I told my interviewer that I would use a sorting function to get the ranges in order and then just do a 2 pointer traversal of left and right to find the ranges. The runtime would be O(nlogn) and space would be O(n). I was able to write code for it, but there were some minor bugs that I identified with him (which he seemed pleased about). Then, with about 5 minutes left, he changed one of the criteria to what happens if it was a stream of integers, instead of a static list (just a discussion here).
After this interview, I had 15 minutes of break where I literally went to go sit on my bed and just calmed down and just try to forget that round so that it didn't impact my next one.
2nd Round - SDE 2, been at Amazon for a couple of years
This interview was a system design round where I felt very very very happy about. For those needing help with System design, watch Gaurav Sen (if you're reading this, thank you for all of your videos). I also read CTCI on how to think about system design. If I had to tell you one thing that I learned from watching videos, CTCI, and other sources (Gronking The System Design Interview), it is to SLOW DOWN and let the interviewer guide you. Instead of trying to obviously solve it, think about what the interviewer is wanting out of this question.
Q1: Design a Load Balancer
The given requirements at the very beginning was that this was a LB that was designed to take an incoming object, called MessageLogs, that contains a message_id and a message_payload containing information. You have 20,000 machines at your disposal, design a LB to delegate these messages.
Solution: So, this is a lot of back and forth with the interviewer asking questions and uncertainties. But after about 5-10 minutes of just conversing and writing down features that he wanted this LB to do, I started to design the class LoadBalancer with an ability to delegate the tasks. While it was real code, I didn't actually write deep logic to solve it, I just wrote a lot of comment on top of my code to let the interviewer know what I was doing, how to implement and so on. From there, we talked about how would a database look like if we wanted to store these information from the users. Overall, I felt that this was my strongest round. After about 30 minutes, he stopped me by saying, "Wow, this looks really good, let's move on.". I was so goddamn relieved. After that, I had 3 LPs and then 5-10 minutes after to talk to him about his work, his challenges, and other questions.
LPs:
After this interview, I did the same thing. I went to go sit on my bed, drink a glass of water, and just tried to relax again.
3rd Round - SDM, been at Amazon for 6+ years
This round was definitely taunting to me because it was the last one and I felt like I had a decent first round, great second round, so I needed to end on a good note.
Q1: Given a map of characters (english alphabet) where each character has a corresponding value, take the weak password (input) and return all possible strong passwords.
Ex. map = {'a' = @, 'b' = 5, 'c' = 2, ....}, input = 'abc', output = ['ab2', 'a5c', '@bc', ....]
Solution: This was just a simple backtracking question, kinda like valid parenthesis. The optimal runtime is O(2^n) and space complexity is also O(2^n) for the recursive stack that you build. Simple question, I finished in about 10 minutes.
Q2: Given a list of words, return a list of all possible 2 words that can combined to form a larger word inside of the list of words
Ex: input = ['chicken', 'nugget', 'chickennugget'], output = [['chicken', 'nugget']]
Solution: So, this one, I've never seen before, and it took me awhile to figure it out. I very quickly stated the brute force, which would've ran in O(n^3) with O(n) space complexity, because we need to iterate over every possible index and then trying every possible pair. I eventually figured out the optimal solution, which would've been to pre-compute all possible substrings from the list of words. So, build a dictionary that contains every possible substring, map = {'c', 'ch', 'chi', 'chic',......} and then iterate over every possible pair (2 for loops) and try to check if it's a possible substring. This would run in O(n^2) and O(n) space. After this, he added a requirement of what happens if it was k words instead of 2 words.
LPs:
After this, we had about 5 minutes left and I really bombarded him with questions. I asked him a lot of questions about his work/contributions, being a manager, and other things about amazon. He said he really loved my questions and that no one has ever asked him a lot of these questions. So, I felt really good because our conversation was very light-hearted and fun.
Overall
After this, I literally didn't know what the outcome would be. I've read from Blind, Leetcode discussions, Google, Reddit, etc that if you didn't have 3 good interviews, then you probably won't get it. So, I felt very down for the next couple of days and just kind of accepted that I didn't get in. I got an email over the next 3 days saying that I was accepted, but I was on a waitlist. I'm still happy that I made passed it, but I'm a little bit sad because of the waitlist. Anyway, my overall experience was definitely really good. I know others didn't have the same experience, but I tried my best to keep moving forward as well.
Preparation
So, far, on my leetcode, I've done about 170-180 problems (40 easy, 120 medium, and 20 hard). I've also read Cracking the Coding Interview and Elements of Programming Interviews. Besides that, I've read Leetcode discuss section almost every night religiously. I've read others experience about how to prepare and I've seen people doing 25 LC questions to over 200 LC questions. I really think it just depends on who you are. I honestly wish I could just give the recipe to studying, but it really just comes down to grinding it out and UNDERSTANDING what you're doing. If you are struggling with BFS, then do every DFS problem and turn it into a BFS (and vice versa). If you're struggling with stacks, study stacks. I also think picking an easy interviewing language is another factor. I ultimately learned Python because it was easy to use and I was already using it for my undergrad research, data science and machine learning class.
So, I've been studying for the last 3 months, usually 4-5 hours every saturday. Then, throughout the week, after work and school, I try to do at least 1 per night (but sometimes I'm too tired with work or homework). I am also VERY VERY fortunate to have an amazing group of friends, between 5-7 of us who are wanting to get into FAANG, so we get together to study every saturday and/or throughout the week on discord. If you can, I HIGHLY recommend finding a group because it not only motivates you, but you get to practice and see different approaches.
Final Thoughts
And lastly, I am NOT the smartest nor will I graduate in the top 50% of my class, but I think I just really enjoy solving problems. I know that it'll get tiring, boring, and at times, you wonder why a company is basing their candidates on algorithms that they'll never use at work (I have yet to use a single algorithm at my work). But, keep going, it'll be worth it in the end! So far, I've applied to about 200+ jobs since mid-September. I've gotten OA's from maybe...less than 50 of them? And only have 1 offer so far. So, keep going and keep practicing!! I BELIEVE!
Thank you to the LC community for all the help and encouragement!