I thought I would share here my experience on the 3 companies, since they were all very similar and have a lot of commonalities. I managed to pass the interview with all of them, and got an offer from all of them. Rather than sharing the actual questions (which I cannot because of NDAs), I will share here how I prepare for those and what to expect.
With this post I would like to give back my small contribution to the Leetcode community, since it really did help me a lot in preparing for interviews.
Background:
Software Developer with 3 years of industry experience, prior to that a 3.5 years of PhD in Computer Science.
This was the second time I was applying to Google, after the first shot given in 2016 (3 years before) and failed.
I started preparing September 2019, and started with the first phone screen interview (Amazon) mid-October. When I started preparing I had very little preparation in solving algorithmic questions (I could solve most of the easy ones in Leetcode, a few of the medium, and none of the hard ones) and close-to-zero knowledge for System Design questions. I had some prep done 3 years before for the first Google interview, but after 3 years I had almost forgotten pretty much everything.
Phone Screen:
All of the three companies started with a Phone Screen interview. To be honest Amazon asks to carry out an online coding challenge prior to the phone screen, but given my experience the recruiter decided to skip that phase.
All the 3 interviews were pretty easy.
Facebook asked an easy question on arrays, and then a second easy-medium question on trees.
Amazon was an easy question on array/map, and then a second medium question which implied sorting (and then some follow up questions on sorting).
Google was maybe slightly more challenging. The question was related to this one https://leetcode.com/problems/battleships-in-a-board/, but it was more focus on how to represent the actual battleship problem, and to write some utility methods. The code itself was not difficult, just some edge cases to be careful on not going outside the matrix, and to clarify from the very beginning the usage of memory required for representing the problem.
Here typical advices would apply: think outloud, do not give anything for granted and ask lots of clarifying questions, state from the very beginning what kind of complexity (both time and space) and check with the interviewer if that complexity is ok or you should aim for something better.
All of them replied within 2-3 days confirming I moved to the onsite. The best by far was Facebook, which gave very detailed feedbacks on how I performed and on what I could have done better (very useful).
On Site:
Also here, very similar format for all of them. 5 interviews, 3 coding questions, 1 behavioral, 1 System Design. Amazon was slightly different, since all 4 technical questions were divided into first 30 minutes of behavioral part, then 30 minutes of technical questions. Amazon gives a lot of importance to behavioral aspects and leadership principles (https://www.amazon.jobs/en/principles), so make sure to prepare very well this part with many examples from your past experience.
Amazon Coding: 1 easy, 1 medium similar to this one https://leetcode.com/problems/roman-to-integer/, another medium on something along the line of implementing a cache. Did not finish to write the whole code in some cases, since 30 minutes per question is not much (and it is expected, as long as you focus on the important part of the code).
Facebook Coding: 3 medium. One on arrays, one similar to counting the number of valid string with balanced parenthesis, one along the line of given a word W without spaces and a dictionary of words, find if you can split W with spaces using only words from the dictionary.
Google Coding: by far the most difficult one. First one was medium, but it did require to write a lot of code (key here was MODULARIZE YOUR CODE, split it into multiple functions/methods). Second and third were hard. The second was hard because the interviewer also asked to prove mathematically that a solution always exists (proof by induction), the third was similar to https://leetcode.com/problems/russian-doll-envelopes/. For the last one I could come up with memoization approach, but not with the clever longest increasing subsequence. I mentioned something about it, but definitely did not outline the solution. Probably the interviewer understood that I was going towards the right direction, and maybe with a little more time I could have made it with the optimal solution. Key was to talk a lot and let the interviewer know about your thought process.
System Design: I found this one to be the most complex for two main reasons: I did not have a lot of experience on scaled distributed systems, you do not really know how to prepare on this one (whereas you can prepare well for the coding one). This was the one where I performed the worst both at Google and Facebook, and Facebook asked me to repeat this interview a second time (just the System Design one, not the whole thing). The main takeaway here is: start with a very generic design, and then deep dive and be (very) concrete on 1-2 aspects. If the aspect is the Database, say which technology, which schema, how many replicas, and so on. If you deep dive on one server, say how many servers you need, say what kind of requests/responses, say what happens if one server goes down while serving a request, and so on.
Behavioral: Do not underestimate this one, as for example Google introduced it recently since they understood the importance of such interview. Prepare some answers to questions like Tell me one time where you disagree with your colleagues or Tell me one time that you went outside your normal boundaries to complete some tasks. My suggestion here is be real, try to come up with real scenarios from your experience, which may very well be stuff from university. Do not try to fool the interviewer with cool answers, these guys have been doing interviews for many years and they most likely know how to spot a fake answer. Amazon requires a special preparation, as you need to go through all their principles and associate 1 or 2 stories to each of the principle.
Final Suggestion
Leetcode is the best resource to prepare for the coding interviews. I purchased the premium subscription, which helped me to filter questions by company. Most of the questions I saw were either stated on leetcode, or some variations of some questions on leetcode. For other questions, I felt my preparation was strong enough to be ready to solve them. I prepared while working full time on my previous job. My schedule routine was to solve 2-3 medium problems per working day, and 3-4 medium and 1 hard per weekend day. Obviously with some rest/hangover day exceptions :) Be careful of not burning out: I got to the end of the interview process that I was very tired, and I wisely took some days off even before the interview itself. It is very important to keep a good balance between motivation and exhaustion! With the above schedule, and some developer experience, 2 months of preparation are more than enough to pass the interview.
For system design questions I prepared by purchasing the course grokking the system design interview, reading high scalability blog and watch lots of videos on Youtube. Do as many mock interviews as possible, even alone and even if it seems stupid at the beginning.
For behavioral questions, prepare some answers to standard questions and spoke about those outloud. Be real here, they interviewer wants to know if you are someone they would hang out with.
Last remark, but probably the most important, failing is ok. These interviews are really tough and challenging, and anything (literally anything) can go wrong at anytime. Do not let yourself down if you fail once or twice, I know some people at Google who made it at the fifth time! Remember that if you make it to the phone call with one of these companies you are already in the 60 percentile of top coder in the world, if you make it to the onsite you are probably in the 85-90 percentile! Cheer up since it is already a big achievement.! Perfection needs practise, so keep practising and you will make it :D


