Facebook software engineer interview: the only post you'll need to read

Coding interviews are really challenging. The questions are difficult, specific to Facebook, and cover a wide range of topics.

The good news is that the right preparation can make a big difference and help you land a Software Engineer job at Facebook. We have put together the ultimate guide to help you maximize your chances of success.

Here's an overview of what we will cover:

1. Interview process and timeline

1.1 What interviews to expect

What's the Facebook software engineering interview process and timeline? It takes four to eight weeks on average and follows these steps:

  1. Resume, cover letter and referrals
  2. Recruiter phone screen: one interview
  3. Technical phone screen: one or two interviews
  4. Onsite: four to six interviews

1.1.1 Recruiter phone screen

In most cases, you'll start your interview process with Facebook by talking to an HR recruiter on the phone. They are looking to confirm that you've got a chance of getting the job at all, so be prepared to explain your background and why you’re a good fit at Facebook. You should expect typical behavioral and resume questions like, "Tell me about yourself," "Why Facebook?" or, "Tell me about your current day to day as a developer."

If you get past this first HR screen, the recruiter will then help schedule your first technical screens with a Facebook engineer. One great thing about Facebook is that they are very transparent about their recruiting process. Your HR contact will therefore walk you through the remaining steps in the hiring process, and also share with you a helpful email listing resources you can use to prepare.

1.1.2 Technical phone screen

You'll go through one or two initial 45mins technical screens which usually happen over the phone. Your interviewers will start with a few behavioral questions but most of the time will be spent on typical coding questions (e.g. data structures, algorithms, etc.)

You'll use a simple online code editor without syntax highlighting or auto-completion for these phone interviews (e.g. CoderPad) and it's a good idea to get used to using one of them beforehand.

Finally, if you live close to a Facebook office and are really motivated to join the company you can ask to come onsite for the initial screens. Your recruiter will usually be happy to organise this for you as it's a better experience both for you and your interviewers.

1.1.3 Onsite interviews

Onsite interviews are the real test. You'll typically spend a full day at a Facebook office and do four to six interviews in total. Each interview will last about 45 minutes and cover one of the following topics:

  1. Coding interview, where you'll solve general coding questions which will typically be harder than in the initial technical screen.
  2. Design interview, where you'll be asked a system or product design question depending on your background.
  3. Behavioral interview, where you can expect questions about your background, accomplishments and motivation to work at Facebook.

You'll typically get three coding interviews, one design interview and one behavioral interview. But as we'll discuss in the next section the exact breakdown will vary depending on the role, team and level you're applying for.

In addition to these interviews, you'll also have lunch with a fellow engineer while you are onsite. The lunch interview is meant to be your time to ask questions about what it's like to work at Facebook. The company won't be evaluating you during this time, but we recommend that you behave like if they were.

1.2 Differences between levels and roles

The process we have described above will vary slightly depending on what level and role you're interviewing for. Here are some of the most common differences you should expect.

1.2.1 Junior vs Senior software engineers

The expectations for junior and senior engineers are different.

If you're an entry-level / junior engineer you'll be expected to do extremely well in your coding interviews. But you'll usually only have a single system design interview where the performance bar will be lower than for more senior candidates.

If you're a senior engineer then you'll both need to do extremely well in coding and system design interviews. You could also have two system design interviews instead of one in certain situations (e.g. you're applying for the infrastructure team).

1.2.2 Individual contributors vs Managers

Facebook has two career tracks. You can either grow into a manager where you end up leading teams of engineers (management track). Or you can stay very hands-on technically and specialize as you become more senior (individual contributor track).

If you're interviewing as an individual contributor then you should mainly expect technical interviews and will typically only have a single behavioral interview.

If you're interviewing as a manager, director or above then you should expect at least two behavioral interviews. Be prepared to answer questions about how you develop people, work with cross functional teams, execute on projects, grow an organization, etc.

1.3 What happens behind the scenes

Your recruiter is leading the process and taking you from one stage to the next. Here's what happens at behind the scenes at each of the stages described above:

  • After the Technical phone screen, the interviewers you've talked to have 24h to submit their ratings and notes to the internal system. Your recruiter then reviews the feedback, and decides to move you to the onsite interview or not depending on how well you've done.
  • After the Onsite, the four to six interviewers will make a recommendation on hiring you or not and the recruiter compiles your "packet" (interview feedback, resume, referrals, etc.) If they think you can get the job, they will present your case at the next candidate review meeting.
  • Candidate review meetings are used to assess all candidates who have recently finished their interview loops and are close to getting an offer. Your packet will be analysed and possible concerns will be discussed. Your interviewers are invited to join your Candidate review meeting but will usually only attend if there's a strong disagreement in the grades you received (e.g. 2 no hires, 2 hires). If after discussions the team still can't agree whether you should get an offer or not, you might be asked to do a follow up interview to settle the debate. At the end of the Candidate review meeting, a hire / no hire recommendation is made for consideration by the hiring committee.
  • The hiring committee includes senior leaders from across Facebook. This step is usually a formality and the committee follows the recommendation of the Candidate review meeting. The main focus is on fine-tuning the exact level and therefore compensation you will be offered.

It's also important to note that hiring managers and people who refer you have little influence on the overall process. They can help you get an interview at the beginning but that's about it.

2. Example questions

We believe in data-driven interview preparation and have used Glassdoor data to identify the types of questions which are most frequently asked at Facebook.

For coding interviews, we've broken down the questions you'll be asked by subcategories (e.g. Arrays / Strings, Graphs / Trees, etc.) so that you can prioritize what to study and practice first. For system design and behavioral questions, we've listed 10 questions that were frequently reported on Glassdoor.

2.1 Coding interview

Facebook software engineer interview questions

Facebook software engineers solve some of the most difficult problems the company faces with code. It's therefore essential that they have strong problem solving skills. This is the part of the interview where you want to show that you think in a structured way and write code that's accurate, bug-free and fast.

Here are the most common question types asked in Facebook coding interviews and their frequency. Please note the list below excludes system design and behavioral questions which we cover in the next sections.

  1. Arrays / Strings (38% of questions, most frequent)
  2. Graphs / Trees (29%)
  3. Dynamic Programming (18%)
  4. Search / Sort (9%)
  5. Linked lists (4%)
  6. Stacks / Queues (2%, least frequent)

We've also listed common examples used at Facebook for these different question types below. For each example we modified the phrasing of the question to match the closest Leetcode problem and linked to a free solution either on Leetcode or another resource. Finally, we recommend reading the following article written by an ex-Facebook interviewer to understand more about the step-by-step approach you should use to solve coding questions.

Example coding questions asked by Facebook

1. Arrays / Strings (38% of questions, most frequent)

  • Given an array nums of n integers where n > 1,  return an array output such that output[i] is equal to the product of all the elements of nums except nums[i]. (Solution)
  • Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. (Solution)
  • Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. (Solution)
  • Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). (Solution)
  • Given an array of strings, group anagrams together. (Solution)
  • Given a String like ((A9a)))()()()) remove parenthesis such that all parenthesis are balanced. (Solution)
  • Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. (Solution)

2. Graphs / Trees (29%)

  • Given the root node of a binary search tree, return the sum of values of all nodes with value between L and R (inclusive). (Solution)
  • Convert a Binary Search Tree to a sorted Circular Doubly-Linked List in place. (Solution)
  • Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. (Solution)
  • Given a binary tree, you need to compute the length of the diameter of the tree. (Solution)
  • Serialize and deserialize a binary tree. (Solution)
  • Given a non-empty binary tree, find the maximum path sum. (Solution)
  • Derive the order of letters in a new alien dictionary. (Solution)
  • Given an undirected graph, return true if and only if it is bipartite. (Solution)

3. Dynamic Programming (18%)

  • Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that sums up to a multiple of k, that is, sums up to n*k where n is also an integer. (Solution)
  • Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock), design an algorithm to find the maximum profit. (Solution)

  • Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. (Solution)
  • You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol. Find out how many ways to assign symbols to make sum of integers equal to target S. (Solution)

4. Search / Sort (9%)

  • We have a list of points on the plane.  Find the K closest points to the origin (0, 0). (Solution)
  • Given two arrays, write a function to compute their intersection. (Solution)
  • Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference rooms required. (Solution)

5. Linked lists (4%)

  • A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy of the list. (Solution)
  • Reorder a singly linked list. (Solution)

6. Stacks / Queues (2%)

  • Implement the following operations of a queue using stacks. (Solution)

2.2 System design interview

Facebook, Instagram and Whatsapp all have 1bn+ monthly active users. Facebook engineers therefore need to be able to design systems that are highly scalable. The coding questions we've covered above usually have a single optimal solution. But the system design questions you'll be asked are typically more open-ended and feel more like a discussion.

This is the part of the interview where you want to show that you can both be creative and structured at the same time. In most cases, your interviewer will adapt the question to your background. For instance, if you've worked on an API product they'll ask you to design an API. But that won't always be the case so you should be ready to design any type of product or system at a high level.

As mentioned previously, if you're a junior developer the expectations will be lower for you than if you're mid-level or senior. In addition, for certain roles (e.g. infrastructure, security, etc.) you will likely have several system design interviews instead of just one.

Here are the most common system design questions asked in the Facebook interview reports which can be found on Glassdoor. For more information, we recommend reading the following guide on how to answer system design questions, and practicing system design questions in this course.

Top 10 system design questions asked at Facebook

  • How would you design Instagram / Instagram's Stories
  • How would you design Facebook
  • How would you design Facebook Messenger
  • How would you design Facebook's live update of comments on posts
  • How would you design an online collaborative editor (e.g. Google Docs)
  • How would you design a typehead feature (e.g. Google search autocomplete)
  • How would you design Twitter's trending topics
  • How would you design a distributed Botnet
  • How would you design a system that can handle millions of card transactions per hour
  • How would you design security for Facebook's corporate network from scratch (Security team interview)

2.3 Behavioral interview

Facebook engineers usually work in cross-functional teams with other engineers, product managers, designers, data analysts, etc. They need to be able to communicate clearly, work with others efficiently, build trust and relationships, etc.

This is the part of the interview where you really want to show that you are good at working with others. As we mentioned previously, if you're applying for a manager position or above, then you'll have multiple behavioral interviews and also cover topics such as leading teams, developing talent, managing the day-to-day, etc.

We've listed ten frequent behavioral questions that Facebook tends to ask, according to data from Glassdoor below. For more information, check out our article on how to answer behavioral interview questions and the "Why Facebook?" question.

Top 10 behavioral questions asked at Facebook

  • Tell me about yourself
  • Why Facebook?
  • Tell me about a recent / favorite project and some of the difficulties you had
  • Tell me about the greatest accomplishment of your career
  • Tell me about a time you struggled to work with one of your colleagues
  • Tell me about a time you had to resolve a conflict in a team
  • Tell me about a time you were given feedback that was constructive
  • Tell me about a time you had to step up and take responsibility for others
  • Tell me about a time you struggled on one of your software projects
  • Tell me about your worst boss and why they were bad

3. How to prepare

Now that you know what questions to expect, let's focus on how to prepare. It's no secret that the performance bar at Facebook is high. Some people even go as far as quitting their job to prepare for interviews full time.

This is obviously extreme and not what we recommend doing, but it shows how much effort some candidates are ready to put in. We've listed the four steps we recommend taking to prepare as efficiently as possible below.

3.1 Learn about Facebook's culture

Most candidates fail to do this. But before investing tens of hours preparing for an interview at Facebook, you should take some time to make sure it's actually the right company for you.

Facebook is prestigious and it's therefore tempting to ignore that step completely. But in our experience the prestige in itself won't make you happy day to day. It's the type of work and the people you work that will.

If you know engineers who work at Facebook or used to work there it's a good idea to talk to them to understand what the culture is like. In addition, we would recommend reading about Facebook's 5 core values and hacker culture.

3.2 Practice by yourself

As mentioned above, you'll have three types of interviews at Facebook: coding, system design and behavioral. The first step of your preparation should be to brush up on these different types of questions and to practice answering them by yourself.

For coding interviews, we recommend reading the following article written by an ex-Facebook interviewer to understand more about the step-by-step approach you should use to solve coding questions in an interview. And to practice we recommend using Leetcode where you can get a lot done with the Free tier, and also access Facebook-specific questions using the Premium tier.

For system design interviews, we recommend using Grokking the System Design Interview. You can both study system design basics using the course and practice interview questions.

For behavioral interviews, we recommend learning our step-by-step method to answer this type of questions. In addition, you'll want to write down your answers to the common behavioral questions we have listed in the previous section.

Finally, a great way to practice coding, system design and behavioral questions, is to interview yourself out loud. This may sound strange, but it will significantly improve the way you communicate your answers during an interview and really makes a difference in our experience. Play the role of both the candidate and the interviewer, asking questions and answering them, just like two people would in an interview.

3.3 Practice with peers

Practicing by yourself will only take you so far. One of the main challenges of coding interviews is to have to communicate what you are doing as you are doing it. In other words, we strongly recommend practicing live coding interviews with a peer interviewing you.

A great place to start is to practice with friends if you can. If you don't have anyone in your network who can interview you then you can also find peers to practice with on platforms such as Pramp.

3.4 Practice with ex-interviewers

The main benefit of practicing with peers is that it's free. But at some point you'll start noticing that the feedback you are getting from peers isn't helping you that much anymore. Once you reach that stage we recommend practicing with ex-interviewers from top tech companies.

If you know a Software Engineer who has experience running interviews at Facebook or another Big tech company, then that's fantastic. But for most of us, it's tough to find the right connections to make this happen. And it might also be difficult to practice multiple hours with that person unless you know them really well. If that's your case, then you should be able to find a good coach on Codementor.io.

Any questions about Facebook Software Engineer interviews?

If you have any questions about Facebook coding interviews, do not hesitate to ask them in the comments below. All questions are good questions, so go ahead!