Preparing for Interviews with IT Giants: How I Overcome the Curse of Algorithmic Interviewing


Disclaimer:


I have not programmed since I was three years old, I don’t know Knuth by heart, I’m not a prize-winner at computer science competitions or championships in sports programming, I haven’t studied at MIT. I have a computer science background and 6 years of experience in commercial development. And until recently, I could not go beyond the first technical screening to IT giants from FAANG (Facebook, Amazon, Apple, Netflix, Google and the like), although I made several attempts. 

But now everything has changed, I received several offers and I want to share my experience on how to come to this. It will be about the position of Software Engineer in the European offices of the listed companies.

Why do I need this FAANG? My subjective advantages:

  1. good conditions; salary is higher than the market;
  2. simple relocation;
  3. debugged processes;
  4. talented colleagues from around the world.

And the advantages of preparation, even if you do not receive the offer:

  1. travels;
  2. Improving the speed of writing code;
  3. the ability to mentally check the program for errors (gaze method);
  4. the ability to come up with tricky scripts for tests;
  5. the ability to find bottlenecks;
  6. training of system design skills, including those on a larger scale than those that I have ever encountered.

We attract the attention of a recruiter


In my case, LinkedIn was enough. For several years, without any special purpose, I maintained a certain level of activity in my profile: I regularly added friends and subscribed to company pages. Soon enough, the first recruiters began to knock, and the more contacts I had, the more often they offered vacancies. It got to the point that at the last iteration for a couple of months they wrote me right away from Google, Microsoft, Amazon and Facebook, it looked like a cartel conspiracy.

Cons of this approach: you never know when you're lucky. The recruiter can catch up on vacation with the news of the burning hiring event, which should be in a week. But in this case there are pluses: most likely, due to urgency, they will meet you and miss one of the stages of the interview - for example, in the case of Amazon, online with a technical specialist.

If you have a release and in the near future it’s completely not up to the tasks in the morning, then you can agree on a few months to prepare. Companies understand that their interviews are complicated and it’s easier for them to wait a few months now than to lose you as a candidate for six months or a year (after about this period, companies are allowed to apply again).

There is another often mentioned approach.- find a person within the company who will recommend you. This will allow you to better plan your training strategy. But I won’t stop at it, because I haven’t tried it myself and I can only share rumors that the recommendation on Google adds points during the interview and increases the chances of a positive decision by the hiring committee (the final stage is a meeting where the results are discussed in absentia and the candidate is approved or rejected).

Interview Schemes


Here will be a brief overview of the interview process in different companies with examples, and in the following sections I will consider the preparation for each part in more detail. The steps are similar, but their order and number may vary. For example, Google is one of the leaders in the number of sessions - as many as five in-person, and then another or more interviews with the team.


Interviewing scheme at Google (hereinafter the schemes may vary slightly depending on the office and position)

Some stages - telephone or with a team - can be re-assigned if either side has doubts. Their number does not affect anything, this is just an additional chance that you need to use after evaluating how much more time is required for preparation (if the interview is technical). The general approach of Google and, for example, Microsoft is the separation of the process for candidates with minimal experience (<1 year) and experienced candidates. For the first, an online assessment can be additionally conducted.


Microsoft Interview Scheme

Behavioral questions can be part of each in-person session, as, for example, Microsoft and Amazon do, and can be a separate session. As a candidate, I prefer the second approach: firstly, a separate behavioral interview does not steal time from solving problems if the interviewer suddenly turned out to be talkative, and secondly, it’s great when you put him after all technical sessions - you can easily switch to conversations about life.


Amazon Interviewing Scheme

At Microsoft and Amazon, behavioral interviewing is integrated into technical sessions, probably also because often these stages are conducted by employees from a future team. In those companies where the approach is different, communication with future colleagues is taken out in a separate stage. For example, Google defines a team after successfully completing the in-person phase. The most original process in Facebook - the choice of a team occurs after hiring. A new employee spends 6 weeks in bootcamp - these are test projects in different teams, and then makes a decision.


Facebook interviewing scheme

Non-technical screening


The first step is to talk with a recruiter. Usually this is a short call to describe the vacancy or the teams the recruiter offers to interview, and to find out your interest and motivation. There may not be a specific vacancy, it all depends on the process of hiring a given company (see “Interview Schemes” ). It seems that the stage is quite simple, but you should not relax here. They may ask some short technical question, for example, to estimate the number of characters in the power of two (Google). Or they may find the experience not relevant enough, or that you, as a candidate, are not very interested (this is what Facebook practices). 

Preparing for an Algorithmic Interview


Technical screening is the stage that for me most often became the last before I came up with this whole training scheme.
Of course, they sent me material for review and recommended that I practice at Hackerrank / Leetcode. But they never said that it was necessary to solve at least 100-200 problems, and this is exactly the number that finally allowed me to reach the successful finals.
It can be seen with the naked eye that this is from two months of regular problem solving in the presence of work and another life. You can try to devote a vacation to this and cope faster, but then there will be preparation for the full-time stage and you still have to make friends with your usual schedule.

I prepared using Leetcode, and my choice was like this for several reasons: 

  • large bank of tasks;
  • most of them have good test coverage;
  • convenient paid breakdown by frequency and companies (there are also free selections);
  • active community - you can read about training approaches and recent interviews.

Leetcode has, of course, some disadvantages:

  • it’s almost impossible to add your task or test case - and therefore the information begins to become obsolete;
  • inaccurate estimate of runtime and memory - may vary from start to start;
  • insufficiently clear conditions in comparison with sports programming tasks;
  • not always idiomatic function interfaces.

The last two points can be pluses in the sense that you sometimes have to face such problems at interviews and you need to be prepared for them. It seems that Leetcode just can’t cope with the flow of information that has fallen upon it, but at the moment it is still the best tool of its kind. His strength is also in the community that votes for questions, decisions and finds errors.

For me, the tasks fit perfectly in the morning before work. After breakfast, I set a timer and solved a couple of Medium level tasks. The timer is important because it helps to create a combat environment. I set aside time according to difficulty levels: 20 minutes for simple, 40 minutes for medium, 60 minutes for difficult. I chose mainly mid-level tasks, since complex ones are asked quite rarely. If after a time the task was not done, I studied the solution, added it to the list and returned to it after a while. I tried to first study the approach in words and try to encode it. The solution could be viewed on the site itself - from the authors of the task or commentators, the video from Tushar Roy also helped, he explains very clearly with examples. Analysis of almost any task can be found on GeeksForGeeks, but there are quite a few errors.

The most universal approach is to sort all tasks by frequency and begin to solve them in descending order.
If you did not know computer science before, you should first take a fundamental course, but not get carried away. Neither knowledge of computer science, nor the read book Cracking the Coding Interview will give such an effect, although they are quite useful for starting. At the beginning I had a university course, a Sedgwick course ( one and two) and the mentioned McDowell book - all this did not help me get through even a telephone interview. First, decision patterns must be at your fingertips so that the candidate can quickly see and apply them. To do this, you need to not just read the analysis of the task, but first try to come up with (or remember), and if it doesn’t work out, after the analysis, write it yourself again. It is advisable to do this with time limits and a very good test coverage, as on Leetcode, which is not provided by courses or books. Secondly, computer science courses, as a rule, do not talk about practical approaches to solutions like two pointers or “hare and turtles”

You can solve these same problems not in a row, but according to themes or patterns. But the main thing here is not to get involved and not to solve the whole topic in one day. Otherwise, it may seem that everything is clear, and in a couple of days from such an express approach there will only be a booming emptiness. I let the topics "settle down" and checked what I learned on the remaining tasks after some time.

Tips and tricks


When I was preparing for an interview with a certain company, I changed my tactics a bit on Leetcode. With a paid subscription, you can view special collections of tasks for popular companies there and they help you get ready quickly. Many companies give the same tasks and only Google, which encourages its interviewers to come up with new ones, gets out of them. Therefore, solved 70-80% of the tasks from such a selection almost guarantee success.


A selection with Leetcode for an individual company - the most frequent tasks are marked with comments indicating the stage of the interview.

I would also like to mention free collections for online testing ( for example, for Amazon), which are carefully gathered by the community in discussions. There are not many tasks there, but they almost completely coincide with those that can be caught in online testing. I highly recommend resolving them if such a stage is ahead, because there can be many pitfalls on it that will eat up your time. There will not be a person with whom you can agree on a more convenient function interface or explain in words what else you would like to fix, but did not have time. Only a timer, not always the usual method signature (for example, C-arrays for C ++) and uncompromising tests. To successfully pass, by the way, a couple of tests can be flunked.

Technical screening usually uses some simple tool for online code editing. A very banal piece of advice that helps save some nerve cells is to practice in advance with the tool in which you will write the code. Especially if it's something non-trivial like Google Docs, where you need to get used to formatting everything by hand.

From time to time, you can read the tips "to inform the interviewer if you saw a problem that you need to solve." I am rather skeptical of them for many reasons. Firstly, if you disassembled a task, and did not memorize it, it will not be obvious that you have already seen it. In addition, you can always come up with a follow-up that the candidate did not make out. Secondly, companies openly advise to train on Leetcode before the interview. It will be interesting if the interviewer runs out of tasks unfamiliar to you. Thirdly, it’s very difficult to come up with some solutions from scratch even with the interviewer's hints. I hope that they are rarely asked, but you should not rely on luck. And fourthly, if the company really worries because of the tasks you know, it motivates interviewers to come up with new ones.

If I wanted to understand how much I was ready to solve new, unknown to me problems, I participated in sports programming competitions at Leetcode / Codeforces. This is more complicated than the actual interview, because there is no one to discuss the solution with and get a hint if there are difficulties. But there is no temptation to run your code on ready-made tests without a mental run with examples - you risk getting a fine. 

Everything seems to be? No, there is a small detail, literally one question that can ruin the whole interview. You need to know the temporal and memory difficulties of standard algorithms by heart, and the rest - to be able to quickly output and train to do this for each problem to be solved. Master theorem is useful for determining the complexity of recursive problems .

English, please


The obvious tool you need for an interview is English. The approach to its study is not the topic of our conversation; I just want to dwell a little on how to practice it in practice in combat conditions. The fact is that analyzing a task alone does not exactly reproduce the interview. Because, among other things, you have to explain your train of thought in English and do it in parallel with writing code, and in some cases even without it. Therefore, it will be ideal to find a partner. It may be a friend who is also preparing for an interview, it may be a special mitap ( Moscow example ), or it may be a random person on one of the sites ( one , two) I did not use the resources of the latter type, but you can read how this works, for example, in this article .

Full-time stage


Now this stage has become online due to the coronavirus. It would seem that there should not be any difference, and companies can also save money. But I was surprised to find that in the online format the interviews seemed to be slower and these 5-10 minutes often turned out to be critical for me. I hope that soon either the companies will adapt and will give more time, or we will return to the full-time format again.

Whiteboard


Remember how I got acquainted with the tools for online code editing for the first stage? In full-time interviews, a blackboard is often used instead. I bought her home to prepare for the full-time stage. The effect was stronger than I expected. Before that, I was afraid of the board as a blank slate and even at work preferred to avoid it. But now, when I got used to it, I found out how convenient it is for interviews:

  • you can painlessly fix the decision (compared to paper);
  • easy to sketch a picture;
  • convenient to paint an example;
  • faster and more comfortable than typing on a keyboard that you’re not used to (if in the case of an alternative they suggest to code the solution on the provided laptop).

System design


Perhaps this is a type of interview for which there is no “royal road”. It should be noted that before that I had zero experience in the design of distributed systems. There is much less information on preparing for a system design interview than on an algorithmic one. This is compounded by the fact that people who publish analyzes of such problems often themselves do not have relevant experience. Nevertheless, inspired by the patterns for the algorithmic interview, I started looking for something similar and found a paid coursethat seemed simple and effective ... until the first interview, where I realized that it was very superficial. Neither the reverse proxy nor the content delivery network, about which my interviewers wanted to hear, were discussed there. Enough of him only for the "C grade". This, on the one hand, helped - made it possible to get an offer, provided that all the other parts were completed well. On the other hand, it cut the level of the proposed position, since this stage is important for assessing the “seniority” of the candidate. Well, since all the sessions of the full-time stage are summed up, it is better not to lose points here - they may simply not be enough for a positive result.

During further training, I finally found a great free resource. It is also quite short - it can be read in a few hours, but there are links to each part for deepening the material. This is an excellent strategy, regardless of the amount of time that is available: you can start with a brief overview, and then study in more detail.

I learned about this selection from the github from a letter with training materials sent to me by a recruiter. This is a valuable source that should not be forgotten. Some of the resources sent may be better than collections of articles like this.

Behavioral Interview


Another type of interview, which can be a separate session, or in addition to others, is a behavioral interview. I decided to prepare for it, because sometimes it is difficult to come up with a suitable situation or answer to a question, and the interviewer can interpret the hitch as an attempt to hide something. My training took very little time and should be enough for a long time. Amazon took principles as a sampleas the most numerous and painted on each principle 2-3 situations from my experience. Why so much? The fact is that the same question can be asked by different interviewers within the framework of one in-person stage and it will not be very cool if everything comes down to one project. Or, conversely, they will ask several questions, for which the same case serves as an example. For simplicity of answers, I also identified key elements for each situation:

  • difficulties;
  • what did not work out (and what conclusions I made);
  • what did you like;
  • how I showed myself;
  • conflicts.

It is often difficult to quickly outline a situation for an interviewer without missing important details. Breakdown of the narrative according to the STAR technique will help to clearly and sequentially : situation - task - action - result. In this part, it is important not to abuse the word "we", it should be a minimal amount. Talk about what you did, not underestimating your contribution.

Here they may ask why you want to work in our company. I answered this question in advance, thanks to which, my interviewers were satisfied with the arguments.

When the full-time stage is not the last


As I mentioned , some companies arrange an interview with the team as a separate stage. But it may not be final. At a position in Google’s European offices, it is followed by a hiring committee - a meeting of experts who determine whether a candidate matches the selected position. The main role is played, of course, by feedback from interviewers. But the on-site stage is rarely quite possible to pass perfectly, and here additional details come into play. The recommendations of existing employees are also a plus, and a recruiter may ask for links to Github and Topcoder / Codeforces / Leetcode profiles. The Hiring committee is far from a formal stage, the percentage of refusals here can be comparable to the full-time stage, in rare cases they can schedule an additional interview.

PS


Once I had an interview, for which I prepared for a long and hard time. I clicked tasks like nuts, quickly wrote the code and felt enthusiastic. The technical part seemed very easy, and I ended the call with complete certainty of my passage: “If I don’t get through now, I don’t know what else they need.” There was no person happier than me, until I scrolled my decision again and found a mistake. For the next 48 hours, I waited for a revelation that did not come, and I really passed. So I realized that interviewers are also mistaken, and confidence helps.

References


  1. The most common problem solving patterns: free review and paid course
  2. Dynamic Programming Problem Solving Patterns
  3. Video Tasks from Tushar Roy
  4. Formula for calculating the complexity of recursive algorithms
  5. Peer-to-peer job interviews: one and two 
  6. Resources for preparing for a system design job interview: free and paid course 
  7. Sedgwick's Algorithmic Course on Coursera: https://www.coursera.org/learn/algorithms-part1 and https://www.coursera.org/learn/algorithms-part2
  8. Amazon Leadership principles
  9. STAR Technique
  10. More on the topic: job search at FAANG and successful preparation at Google

All Articles