Background:
- PhD from a US medical school and BS from a non-US school.
- No CS background; good coding skills in Matlab and Python; enrolled in an online course on data structures/algorithms during the pandemic.
- Experience: < 1 year (non-SDE role)
- Interviewed for software/ML roles at Google, Amazon, and Facebook between June and September 2020
Google: Applied online and let a recruiter know whom I knew (not very well though).
- Phone interview: One LC medium question related to search in an array. I couldn't figure out that a binary search could be used. So, I went with a linear search approach. It took ~40 minutes for me to implement that non-optimal solution. So, the interviewer didn't have time for follow-up questions like an improvement, analysis, etc. As expected, I was not taken to the next steps. However, it was an eye-opening interview for me - I realized that SDE was not just fun to learn in 2-3 weeks!
Amazon: Contacted a recruiter via LinkedIn. The recruiter asked me to take an online assessment.
- Online assessment: Two questions from AMCAT in 90 minutes. My coding style was good, one team manager told the recruiter!
- Virtual onsite:
- Round 1: System design + LP - A simple system (available in almost all relevant resources). However, it was my first design interview, and it did not go well. I was in the right direction, but couldn't manage the time well, so I missed to discuss some important parts.
- Round 2: Coding + LP - Most important reviews (not directly from LC, closest match: #347). I came up with multiple solutions and coded the one using heap data structure; answered follow-up questions, including analyses. I guess it was the "bar-raiser".
- Round 3: Coding + LP - Graph problem (directly from LC, one of the island problems). I didn't practice this one beforehand but was able to come up with a solution. However, I couldn't code it. This round didn't go well.
- Round 4: Coding + LP - Topological sorting (not directly from LC, closest match: #210). The interviewer was looking for a specific way to solve, so s/he guided me in that direction whenever I was trying in my ways. Overall, this round went well.
- Offer: SDE I (entire process took ~3 months)
Facebook: The recruiter contacted me (perhaps s/he got my resume from another role I applied to).
- Phone interview: Two questions in 45 minutes; both questions were FB-tagged LC medium. I did "pretty good" according to the recruiter.
- Virtual onsite:
- Round 1: Behavioral - Typical behavioral questions, and an FB-tagged LC easy problem as the warmup coding in the end.
- Round 2: Coding - (Q1) Search in array (not directly from LC, closest match: #162). Binary search was a bit tricky to apply, but it impressed the interviewer. (Q2) Subarray sum (directly from LC hard). I figured out the solution but didn't have time left for coding.
- Round 3: Coding - Interval sorting (not directly from LC, but could be characterized as a combination of 2-3 FB-tagged LC medium). It looked like the interviewer studied LC and designed the problem carefully to test multiple knowledge levels. I did well with one hint in the beginning.
- Round 4: Distributed system design - Similar to designing Yelp, but not exactly the same. I needed little guidance.
- Round 5: ML system design - Image/text classification, or at least, I (re)formulated the problem as a classification one. The interviewer asked a lot of questions. I couldn't finish all the details on time but covered many parts.
- Offer: E4 (entire process took ~5 months, because of E4 hiring freeze)
Take home:
- Practice! Here is an example of how the practice can be handy! For FB's phone interview, I took ~35 minutes to wrap up the first question. So, we had less than 10 minutes, and the interviewer gave the second question but asked me to tell how I would solve it (no need to write the code). Fortunately, I practiced that particular problem (and studied related topics extensively), so I gave two solution approaches within a minute. Then s/he asked if I could write the code. I took ~7 minutes to code and to analyze. The interviewer was super happy and mentioned that it was "great"!
- Persistence! Try to solve at least one (old/new) problem everyday. I kept track of how many problems I would solve each day via github (to keep myself motivated). I haven't missed a single day since May until today. I solved ~200 and ~300 LC problems for Amazon and Facebook, respectively. I surely couldn't remember many of them, but solved some problems several times, which helped me to think the same problem from multiple perspectives.
- Take time: If you are beginner, try to give at least 6 months before the first interview; you may want to stabilize your understanding (even if memorizing) the solutions. From the day of my first leetcode submission, I interviewed at Google in two weeks, at Amazon in two months and at Facebook in four months. My performance order was: Facebook > Amazon >> Google.
- Take mock tests with people: I took several mock tests on LC. However, after the Amazon interview, I realized that I was not good enough in coding and talking simultaneously. So, before the Facebook interview, I practiced with my wife; she is not programmer, but she would randomly pick one problem over our Skype calls, and I pretended her as a real interviewer. This helped me!
- Facebook vs. Amazon: No significant differences! Some minors are:
- FB's questions were much more similar to what is available in LC, but their bar seemed higher to me, i.e., they want you to nail down the coding parts.
- Leadership principles are important for Amazon - they may take more than 50% of the total interview. I didn't take them seriously and that cost me a level.
- To be honest, at both companies, it was hard for me to address all behavioral questions only with grad school research experience. Keep this in mind when interviewing for a senior position with limited experience.