Thursday, March 10, 2022

Good advices: interview preparation

Here is the article.

Your ultimate guide to interview preparation

11 November 2018 

In this blog post I share my interview preparation process that helped me land offers from Google, Facebook, Uber and Amazon.

I describe how I prepared for different parts of the interview process, as well as share my philosophy on the interviews in general. Lastly, there are a lot of somewhat ad hoc links to some useful material throughout the article.

Text turned out to be pretty long, but reading it may be the easiest part of your preparation. So, get used :) Hope you will find it useful!

Table of Contents

  1. Premise
  2. Timeline
  3. Motivation
  4. Interview process
  5. Meta
  6. Books
  7. Coding interviews
  8. Distributed computing problems
  9. System design interviews
  10. Behavioral interviews
  11. Mock interviews
  12. Applying to companies
  13. Offers, negotiations and beyond
  14. Misc

Premise

Your interview experience may differ greatly depending on your background. Therefore, in order for you to find this guide more useful, I think it's necessary to share my background as it was at the time of applying.

First, I am a software engineer with more focus on the backend. Non-engineers have a completely different interview process. Frontend/ML/data/systems/mobile engineers have interviews which are fundamentally similar (after all, they also need to be able to code and know algorithms), but may have some parts that are specific to their role or otherwise different.

At the moment of writing, I live in the San Francisco Bay Area, part of which is often also called Silicon Valley. I applied only to the big and well-known tech companies, and all of them have offices here. Tech market is generally booming now, engineers are in high demand and well-paid, and it's pretty easy to find a job.

I am from Kazakhstan, and I am here in the United States on the work visa. Getting a work visa is hard, and this topic is well beyond this article (for a brief overview, read this piece), but the information here should generally work for most tech companies worldwide.

I have a bachelors degree in computer science from Nazarbayev University in Kazakhstan.

Before this round of applying to the companies, I had about 1.5 years of industry experience total. I was working for a smaller company ipsy, where I had a chance to work on a lot of cool tech stuff and got exposure to big systems at scale.

I have a lot of experience participating in programming contests, and my team got to the finals of ACM ICPC twice. So, I am pretty used to solving algorithmic problems, and before my interview preparation I generally already knew all the algorithms and data structures required to pass interview rounds.

I have a lot of friends in different big tech companies and startups. Their advice, help and experience definitely have been crucial to me. Thank you, guys! :)

Timeline

Before my onsite rounds, I intensively prepared for the interviews for about three months. On average, I worked on this about three hours a day, every day, so it's about 300 hours in total (I also worked fulltime during this time). In case you need to catch up on more or less material, you may need a different amount of time, but I think at least 200-400 hours during 2-4 months is a must first time you go through the hard interview process for a fulltime position.

Be also prepared that getting referrals, talking to recruiters, passing phone screens and onsite rounds, and getting and choosing offers will take some time, about 1-2 months. So you may want to plan accordingly and start contacting the companies earlier.

Motivation

Of course, investing at least three hours a day for several months into something is not easy, so here are some strategies that helped me:

  • Keep a log where you track how you prepare for interviews every day. I logged 98 days of my own preparation. Log not only helps you build a habit, it will also help later in reviewing the material you studied. For keeping a log I recommend Quiver - an Evernote alternative for programmers.
  • Read Deep work.
  • Quit social media.
  • Having a friend who is also preparing or passed interviews recently to discuss your progress with him/her definitely helps.
  • Make it your top priority. During my preparation, I didn't travel, rarely hung out with friends and ignored most of "important" errands.
  • Also, set yourself a deadline, something like "I will prepare for three months, and then apply". Not meeting a deadline is better than having no deadlines at all.
  • Read a chapter or two in Coders at Work for an inspiration.

Interview process

Good news: the interview process in most big tech companies is pretty similar, and you already may know all about it. But just to refresh your memory again, check out these materials on the format and structure of the interviews:

Meta

Some other guides and articles that I found useful:

Books

If you have time, I strongly recommend reading these books to get a deeper understanding of certain software engineering topics. I've read about 60% of their total content, full books in some cases and just several interesting chapters in others, and I feel it helped me a lot.

  • Effective Java – best book on Java, and I would recommend reading it even if you mostly use some other language.
  • Designing Data-Intensive Applications – a very good overview of the big distributed systems, and one of the best technical books I've ever read.
  • Clean Code – classic book on writing a good code.
  • Building Microservices – good book on microservices (without any unnecessary hype around them) that also provides a good overview of topics of security, testing, deployment and others.
  • Design Patterns by Gang of Four – classic book on design patterns. If you don't read all of it, make sure to at least know the following patterns: Singleton, Builder, Observer, Decorator, Facade.
  • Cracking the Coding Interview – I've read just several interesting chapters from there, but it's still a solid book about interview preparation in particular.
  • Modern Operating Systems – some chapters in this book provide a nice overview of hardware, memory management and other systems related concepts.
  • Learning PHP, MySQL & JavaScript – this book, which you can just skim in one evening, surprisingly provides a good overview of many important web concepts.
  • Coders at Work – book of motivating interviews with great programmers.

Coding interviews

Software engineer's interviews usually consist of coding, system design and behavioral rounds. Coding rounds, though, take at least 80% of the process, and by far are the most important. At these rounds you will typically get 1-2 algorithmic problems that you will need to solve in the language of your choice in about 45-60 minutes.

  • For practicing solving problems there is nothing better than Leetcode. It's so good that I feel anybody who solves 300-400 problems there will get a fair chance of clearing almost any interview round.
    • Leetcode has a lot of problems that are asked at the real interviews in big companies. By my estimations, about 25-30% of the problems I was asked to solve during the real interviews I solved on Leetcode before, and about 70% of the problems I was asked have something very similar there.
    • There is also a premium subscription for Leetcode that opens you more problems and features. I found it only somewhat helpful (mostly "problem frequency" feature and company problems lists), so it's up to you if you want to buy it or not. As another bonus, paying for the Leetcode subscription can be an additional motivation to solve it more ;)
    • Problem difficulties are not always very accurate, so don't skip easy problems. Hard problems, on the other hand, may be too tedious and intimidating, so get to them only once you are comfortable, and mix them with easier problems as well. Before my onsite rounds, I solved 333 Leetcode problems (115 easy, 160 medium, 58 hard), including ~100 that I solved several years before.
    • For choosing what to solve next, I recommend filtering problems by company tags (choose companies you want to apply to) and frequency. I also solved all problems from these collections and found them to be very helpful: top facebook questionstop google questions and top interview questions.
    • I participated in nine Leetcode contests and managed to reach 24th global rank before my onsites. Contests may be helpful to train your speed, but it's important to watch out for your solutions' code quality – you should write very clean code in your real interviews.
    • After solving the problem, be sure to check its discussion and some of the top solutions there. This will help you to learn about any better ways to solve the problem, and also you may find some good code examples for the language of your choice. Generally, at the interviews companies expect you to know at least one language very well, and write real code (not pseudocode) even on a whiteboard.
    • Avoid using IDEs and solve the problems right in the editor on the Leetcode website or on a whiteboard. This will better simulate a real interview environment.
  • Cracking the Coding Interview book has a nice collection of problems, though nowadays it's not as useful as Leetcode, where you can compile and test your solution. I mostly just checked the chapters I found interesting to me (for example, I recommend chapters about linked lists and trees).
  • During phone interviews you will code in some kind of a web editor while talking with the interviewer on a phone/skype, and on onsite interviews you mostly will code on the whiteboard. Writing a code on a whiteboard is pretty different from coding on the computer, therefore it's important to actually buy a whiteboard and solve more and more problems on it closer you get to the onsites. I got this one, and recommend getting at least this size or bigger.
  • This will probably be covered by 300-400 problems at Leetcode, but here is a list of algorithms and techniques you absolutely need to know: time and space complexity, sorting (quicksort, mergesort), binary search, hashmaps, trees, graphs, BFS/DFS, union find, tries, bit manipulation, stacks/queues, dynamic programming, priority queue, two pointers, recursion/backtracking, greedy solutions. Knowing this may also help: string hashing (Rabin-Karp algorithm), probability/combinatorics, segment tree, binary indexed tree (Fenwick Tree).
  • Note for those who are coming from competitive programming world: interview questions are a bit different than programming competitions problems. For example, in interview problems you may find restrictions that are pretty rare in CP world, like don't use division, don't use extra memory at all, or try solving the problem without using some particular algorithm. Also, code style expected in interviews is much cleaner and more structured than typical competitive programming code. Therefore even if you are pretty good with algorithms and solving competitive programming problems, I'd suggest still solving some Leetcode problems to get used to the format and prepare better.

    On the other hand, interview problems are much easier :)

Distributed computing problems

Some companies, especially Google, like to ask follow up problems that involve distributed computing – basically the same algorithmic problems, but you need to try to solve them using multiple cores/machines. I still don't know any good thorough source on this (ping me if you know?), but here is some material that I used for preparation:

  • Cormen has a nice chapter on parallel computing.
  • Some links that discuss certain distributed algorithm problems: 12.
  • Learn about MapReduce paradigm and Spark framework.

System design interviews

In system design interviews, you are usually given a very vague design problem (like design Twitter), and you need to share your approach in about 45 minutes. The purpose of this interview is to test your experience working with real software systems, and how much you know about these systems in general. Usually, interns and new grads don't get this type of interviews, but otherwise you may expect it at every big tech company.

Here is a list of material you absolutely need to check:

Here are some videos that I found helpful:

I think one of the best ways to prepare for system design interviews is to expose yourself to as much information about designs of the real systems as possible, so here are lots of links to the blog posts, articles, videos and papers I found useful:

Behavioral interviews

In behavioral interviews, you will typically get asked questions like "What is the most challenging project you worked on?" or "What was your biggest failure during the time at the company X?", but this differs from company to company. At some companies, you may also get these questions asked during the usual coding interview rounds.

It's pretty hard to effectively prepare for this type of interview, but here are some guidelines and materials that will help:

Mock interviews

Real interviews are a pretty unique experience: you have to solve tough algorithmic problems in a limited time with somebody looking how you do it and with you explaining every step aloud. It may be confusing even if you are already a good coder, and this skill requires practice.

The best way to practice this without the risk of failing to get to the company of your dream is doing mock interviews. In these interviews you solve real interview problems in the setting as close to the real thing as possible. Here are the ways how you can do it:

  • Practice with friends. I did two mock interviews with friends and found both sessions very helpful. The downside of this approach is that you know your "interviewer" in advance, and, as a result, you are not as nervous as you may be on the real interview.
  • Pramp offers free mock interviews with peers, where you interview somebody over the internet for half an hour, and then they interview you. I did four mock interviews on the website, and found some of them to be pretty useful. On the downside, session quality heavily depends on your peer and the problem website chooses for you, and often the experience can be not that good. I also didn't really want to spend the time to interview people. During my time at ipsy I interviewed dozens of people, but if you never did this, I strongly suggest you trying Pramp – taking the side of the interviewer is a valuable experience.
  • For best mock interview experience, I strongly suggest gainlo.co. On this website, you arrange paid mock interviews with real engineers from Google, Facebook and other companies. Mock interviews are pretty expensive, but well worth it (partially because when you pay a lot of money for a mock interview, you treat it very seriously).
    I did four sessions: three with Googlers and one with Facebooker. Three interviews were coding ones, and one was system design. Mocks were awesome in three cases out of four, and these sessions really helped me to prepare better for the real interviews. One session, unfortunately, was quite mediocre.

Applying to companies

Applying to the companies is an art of its own. Remember that the whole interview process will take some time, so I suggest starting to reach out to the companies earlier. Here are some more additional points on this process:

  • Since preparing for the interviews is a big investment of your time and energy, it totally makes sense to apply to many companies at the same time. This way you have more chances that you will succeed, and with multiple offers at hand you can also negotiate a better compensation.
  • Best way to apply to the companies is through referrals from somebody who already works there. So reach out to your friends and friends of friends!
  • I solved all of Dropbox challenges at Codesignal (former Codefights), and within two weeks got contacted by 4-5 companies, including Twitter and Evernote. You may also try this.
  • Keep your LinkedIn updated. It is a good way to get contacted by the recruiters.
  • Don't stress out about resume too much. Read a chapter about resume in Cracking the Coding Interview, and check out this link on Careercup. Here is a Google Docs resume template that me and several of my friends successfully used to apply to the big tech companies – you can make a copy to create your own similar one! :)

You should also research the companies you apply to. Apart from Google and Wikipedia, here are some helpful links:

  • Glassdoor is a platform with employee reviews and other details for different companies.
  • Blind is an app and website where employees anonymously discuss their companies and a wide variety of other topics.

I also found that applying to the companies depends on your level of experience:

  • Students and new grads usually can apply only to internships and new grad positions respectively.
  • People with 3-5+ years of experience usually can easily get interviews almost anywhere.
  • Most of the positions require 3+ years of experience to apply for them, so with 1-2 years of experience (like in my case), the choice is somewhat limited and it may be harder to get interviews, especially with smaller companies.

Offers, negotiations and beyond

Here are some resources that will help you better navigate and negotiate different company offers. Remember that they want to hire you as much or even more as you want to get hired! :)

Misc

  • For phone screens make sure you have a reliable internet and phone connection, good headphones with a microphone, and a quiet place where you can be alone for the whole time. I also found that the best time for me to do phone screens is the first thing in the morning (after some breakfast of course). Interviews are a pretty nervous experience so you want to make yourself as comfortable and relaxed as you can.
  • Onsite interviews are physically and psychologically demanding, so you should take at least one rest day before and between them. I'd suggest taking something like one-two weeks off specifically to do onsites, and not doing more than three of them per week.

No comments:

Post a Comment