In the movie The Social Network, there is a certain scene that supposedly showcases the hiring process for interns at Facebook. If you haven’t seen this movie before, you can check out the clip I am referring to below:
This scene is a typical example of the Hollywood embellishment of technology. In a way, it’s a more modern dramatization of the classic, hilariously inaccurate hacking scenes that were quite popular during the movies of the ’80s and ’90s.
Unfortunately, the interview process isn’t nearly as extreme or intense as the movie would have you believe. While the process itself can definitely be stressful and intense to some extent, you most likely won’t have any Trent Reznor music playing as you code during the interview.
We are going to be outlining how to prepare for the Facebook technical interview process that you are more likely to be facing in the real world. We will be highlighting some of the key differentiating factors for Facebook and how these compare to other more standard technical interviews.
We will also take a look at some resources that Facebook provides to potential applicants. In particular, we will elaborate on the best ways to extract value from that content to apply to your own interview preparation.
In this post, I will show you:
- What is the Facebook Interview? This covers aspects such as the recruitment phase, the phone screen, the coding assignment, and of course the on-site interview itself. We will also see what happens after the interview as well as the ways in which the Facebook Interview is different from that of other companies.
- How to prepare for the Facebook Interview. Here we will see the most common Facebook interview categories and subcategories, some common questions asked during the Facebook Interview and some preparation resources.
- Facebook preparation resources. Facebook recruiters will provide a number of different resources to candidates. We will take a look at those that might be helpful to be aware of.
Let’s dive in!
Don't do another coding interview…
…Until you've mastered these 50 questions!
What Is the Facebook Interview?
In this section, we will be walking through the major components of what you can expect to encounter when interviewing at Facebook.
So what does the Facebook Interview consist of? What should you expect from start to finish?
The Facebook interview has a lot of overlap with other technical interviews you may encounter at companies like Google, Amazon, etc. However, there are a few key differentiators that are worth pointing out.
The recruiting process begins either when someone from the recruiting team reaches out to you directly or when you apply for a position at Facebook and are contacted by someone from the recruiting team. Generally, unsolicited recruitments occur to candidates who are graduating as part of a specific program or, for example, have some type of compelling web presence.
More often than not, you will be applying directly to Facebook to establish this correspondence. If the application looks like a fit, someone from the Facebook recruitment team will reach out to you with further instructions on how to navigate the interview process.
Facebook has a specific video on their recruitment process, and it’s worth a watch to see how they go about their process.
Once you are in touch with a recruiter, they will want to coordinate your first phone interview, which is what we elaborate on in the next section.
There will be at least one, and possibly two, phone screens between you and the interviewer. You will both share an online collaborative coding environment. Typically, something like CoderPad will be used.
The interviewer will call you up via some VoIP service, and you will write code within the shared editor. This process is fairly typical across the board for the other larger tech companies, including Google, Amazon, Apple, etc.
Each phone screen will consist of solving a problem centered on data structures and algorithms and will last approximately thirty to forty-five minutes per interview.
Based on your performance, you will be asked to either participate in a second phone screen or asked to complete a take-home coding assignment.
This part of the process can vary, but it is not untypical to be asked to complete a take-home coding challenge or assignment.
These assignments are usually more focused on the type of work that you would actually end up doing on the job. While these problems can vary in terms of scope and topic, the questions encountered from Facebook will typically involve making use of an API to perform some task that is usually web-related.
Knowledge of how to effectively utilize web technologies and interact with databases, including writing simple SQL statements, is something that will most likely arise in some form.
As these assignments are take-home, you do have the luxury of using whatever resources you have available to you to solve them. While you can look up how to form a valid SQL query, it is something you want to be comfortable with prior to taking the assessment.
As these types of things are to be submitted within a short time horizon, you do not want to be bogged down in the minute details of the project that you should have a solid grasp on.
When interviewing on-site, you will encounter a variety of different interviews. According to Gayle McDowell’s wonderful textbook Cracking the Coding Interview (CTCI), there are three components, referred to as Jedi, Ninja, and Pirate.
The Jedi interview is the behavioral component of your interview. As in Star Wars, Jedi Knights are well-tempered and resilient to conflict and stress. This component of the interview is in some sense assessing these qualities.
The purpose of this interview is to see if you would be an overall good culture fit with the company as well as whether or not you would be someone pleasant to work with. Having a solid purpose and coherent story arch for why you are a good fit for this position will be beneficial in doing well for this interview.
Gayle of CTCI has compiled a helpful flowchart that outlines the steps you should take in preparing for this so-called “soft-skill” type of interview.
The Ninja interview is the technical component. This interview is the meat and potatoes of the whole interview and is centered on data structures and algorithms topics.
The contents here will be the standard fare of being familiar with data structures such as arrays, binary trees, stacks, queues, etc. as well as knowing some of the more exotic structures such as heaps, sets, tries, etc.
Don't do another coding interview…
…Until you've mastered these 50 questions!
Nothing out of the ordinary here for algorithms either. Be comfortable with breadth-first search, depth-first search, recursion, sorting, and complexity analysis, as well as some of the more in-depth algorithms like dynamic programming, etc.
Both recursion and dynamic programming are very prominent topics that you will no doubt want to have mastered prior to your interviews.
If you feel like dynamic programming is a topic you would like to brush up on, Byte by Byte offers a free e-book on some of the most common problems in dynamic programming. It is worth the effort and time to work through the book and deeply understand the problems.
The topics of recursion is also one that makes frequent appearances in these interviews and is a prerequisite to understanding dynamic programming. If you want to brush up on your recursion and ensure that you have a solid grasp of how to apply recursion to the problems that you may encounter, Byte by Byte also offers an entire course dedicated to the subject.
The Pirate interview is basically the “system design” interview. Here, the interviewer wants to assess your ability to deal with vague project requirements as well as to scale your solution.
As Facebook is a company that deals with millions of users and millions upon millions of requests, it is important that you design with scale in mind.
Byte by Byte has a blog post “3 Ways to Ace your System Design Interview” that has actionable items that you can implement when confronted with the “Pirate” interview.
The on-site interview experience will consist of at least one Jedi interview, at least two Ninja interviews, and perhaps one Pirate interview, depending on your experience level.
If you have had previous experience designing and developing software, expect the Pirate interview. Otherwise, it’s less likely that you will encounter this interview.
After slogging through the above interviews, each of the interviewers will submit their own respective feedback to the rest of the interviewers and the hiring manager.
This is not done until after you have completed all of your on-site interviews. So if you perform poorly on one on-site, this will not carry over with you into the next interview, and you will be entering with a clean slate. While the score you receive from the prior interview will influence your overall probability for being hired, it will not bias the next interview.
How Is the Facebook Interview Different From Other Companies’ Interviews?
Unlike with other companies like Google, Apple, or Amazon, you do not interview for a specific team but instead interview for the company overall. After you are brought on board, Facebook has a bootcamp that you will take part in to familiarize yourself with the codebase you'll be working with.
Once you get through the bootcamp, you will be better positioned to determine where on the team you will specifically be most impactful and fit best.
How to Prepare for the Facebook Interview
In order to improve your chances of acing the Facebook Interview and avoid having to spend another six months waiting to reapply, you should definitely stack the odds in your favor and prepare.
But how do you prepare effectively? One tactic is to determine what the most frequent questions from Facebook are and make sure that you understand those categories of questions.
Most Common Facebook Interview Categories
We gathered some data regarding the types of questions that are typically asked in Facebook interviews.
We combed through the website Glassdoor to find specific examples of what people had experienced in their Facebook interview.
Glassdoor has a page dedicated to Facebook, and individuals who have interviewed at Facebook give a review on their experience. This often includes specifics as to what problems, or at least, what types of problems they were asked during their interview.
After parsing through over one hundred interview experiences from Glassdoor for Facebook, we obtained the following distribution of the types of problems that were generally encountered in a Facebook interview.
The three types of problems are “Algorithms,” “Data Structure,” and “System Design.”
A word of note is in order regarding how each of these questions was analyzed. First of all, there is substantial overlap between what can be considered a “data-structure” problem and an “algorithms” problem.
For instance, a problem that involves performing a level-order traversal on a tree requires an understanding of the tree data structure. Of course, it also requires an understanding of the technique used to perform the traversal. Often, a recursive technique for this problem is employed.
While one could categorize this as an algorithmic question categorized under “recursion,” I felt it was more appropriate to classify this as a “tree” problem under the “data structures” category.
This justification seems warranted for a number of reasons, the most important being the fact that the way in which this traversal is performed can take on a number of different algorithmic approaches but in any case requires a solid understanding of the tree data structure.
Looking at the above graph, the three categories are:
- Data Structures
- System Design
Data-structure problems take around ⅔ of the total number of questions asked, while algorithms and system design are respectively the second and third most asked.
Most Common Facebook Interview Subcategories
We can break each of these three categories down further as well. Each of these categories contains a respective subcategory.
For instance, if the problem was a data structure problem, perhaps it was one that predominantly featured some “tree-like” data structure.
Alternatively, if there was some algorithm that took precedence in the problem given, that is also provided in the subcategory graph.
Observing this graph, we see that the top three categories of questions are:
- Dynamic Programming/Recursion (tied with Arrays)
Let us dive in a bit further into each of these categories.
The Graph/Tree was a very popular subcategory of problems asked, according to the Glassdoor data. Most of the questions centered around a thorough understanding of tree structures and more specifically involved the binary tree (BT) or binary search tree (BST) data structures.
If you need a refresher on both BTs and BSTs, I have playlists dedicated to both on my LucidProgramming YouTube channel:
LucidProgramming Binary Tree Playlist
LucidProgramming Binary Search Tree Playlist
I go over each of these types of data structures in detail, and I also provide a number of example questions that you may receive during your Facebook interview.
Don't do another coding interview…
…Until you've mastered these 50 questions!
The general sense that I gathered when parsing through the questions on Glassdoor is that understanding the BT and BST data structures and knowing how to use them to solve a variety of problems (some of which are in the aforementioned playlists) is a very valuable thing to know going into the Facebook Interview.
String-based questions include technical interview problems that involve the use of parsing or manipulating strings. For instance, one common warmup question that was encountered in Facebook interviews was whether or not a given string is a palindrome, a string that can be read the same forward and backward.
If you would like to see the way in which I cover this problem on the LucidProgramming YouTube channel, I have a video to this problem that can be found here:
LucidProgramming Palindrome String Problem
I also cover a number of other string-focused questions, and those can be found in the following playlist on my channel:
LucidProgramming String Playlist
I would recommend going through this playlist and attempting to solve each of the problems. Start the videos, hear the problem statement, and then pause the video to see if you can solve it. Once you either get stuck or think you have a solution, unpause the video, and watch the remainder to see if there is anything that you missed in your solution or analysis of the problem.
I have parsed Glassdoor questions for Google, Apple, Amazon, and other large tech companies. One of the observations I’ve made in doing so is the ubiquity of recursion and dynamic programming problems in the Facebook dataset.
Many of the problems asked involved some application of dynamic programming, and therefore by extension, some application of recursion.
These two topics, especially dynamic programming, are topics that programmers tend to struggle with in an interview setting. Being able to understand these concepts conceptually is much different from being able to apply your knowledge of these to the problems you are given in an interview.
Being able to effectively tackle dynamic programming and recursion problems is therefore a very important skill to have in your toolbox.
Luckily, Byte by Byte offers courses dedicated to both of these topics:
Byte by Byte Course on Recursion
Byte by Byte Course on Dynamic Programming
The coverage in these courses is extensive, and the way in which the topics are covered is much more in-depth and helpful than just grinding dynamic programming and recursion problems on something like LeetCode.
Tackling the Facebook Interview is going to require a very strong command of these skills, so make sure to take a look at these courses.
Some Common Facebook Interview Questions
When I was processing this data, one of the other observations I made involved the ubiquity of the types of questions that were asked.
There were two questions that popped up very frequently. While you might not get these problems exactly, being able to navigate them will probably give you a general idea and strategy for other problems that you may in fact encounter during the interview.
The first question asked the interviewee to calculate the square root function, but what makes this question challenging is that you cannot use any built-in library function for doing that. You must be able to do it using only basic mathematical operators.
This is a very common problem, and it involves a solid grasp of the binary search technique. It goes without saying that you should be able to code up an implementation of binary search in your sleep, but you must also be able to apply this technique to problems.
If you are unfamiliar with this problem or want to see the problem statement elaborated on, you can check out this video here on my YouTube channel. In the video, I go over the problem and show how to solve it.
My recommendation would be to start the video and pause it prior to my giving any solution. Try to solve it yourself. If you struggle, that’s OK, as this is a necessary step in the learning process. Once you wrestle with the problem for a bit, unpause the video, and watch to see whether your solution matches mine or not.
The second question asked the interviewee to find the kth smallest element in a binary tree. For instance, the “1st” smallest element in the tree would be the smallest element in the whole tree, the “2nd” smallest would be the first element bigger than the “1st” smallest, and so on.
This problem requires an understanding of the binary tree data structure, how to navigate the structure, and how to write a specific function to solve a problem utilizing both of these elements.
As mentioned in a previous section, consulting the resources to ensure you have a good understanding of these tree structures is a prerequisite to effectively tackling the problem.
Once you do, it is highly recommended that you attempt to solve this problem using the constraints you would encounter during a real Facebook interview setting.
Practice with time constraints of thirty to forty-five minutes, write code without the aid of an IDE, etc. For more tips on this, head over to the Google Interview post that has a number of more general tips for how to prepare for large tech companies like Facebook, Google, Microsoft, etc.
Facebook Preparation Resources
Facebook recruiters will provide a number of different resources to candidates. Much of this is fairly generic advice that applies more broadly to any technical interview you will be taking part in, but some of the more specific and Facebook-oriented aspects might be helpful to be aware of.
For practicing interview questions, Facebook previously had an online offering referred to as “FB Code Lab.” This has more recently been acquired and turned into the website “InterviewBit,” similar to LeetCode, HackerRank, Project Euler, etc. It contains practice problems for technical interviewing.
One of the features of InterviewBit that makes it stand out is that they offer mock interview services as well as the ability to upload your resume to have companies find and reach out to you. Based on your performance in solving these practice problems, companies like Amazon, Facebook, Google, etc. reach out for further recruitment.
As this website is specifically promoted by Facebook, it may be prudent to spend time practicing these problems, especially if you are in the early stages of preparation prior to any contact from Facebook recruiters.
The types of questions on this platform also dovetail quite nicely with the earlier analysis we performed on the Glassdoor data. This should help you focus on the “right” types of problems for the Facebook Interview.
Finally, here are a number of useful resources, including those referenced to in this post.
–Cracking the Coding Interview by Gayle McDowell
–50 Practice Questions for your Coding Interview by Byte by Byte
–Facebook Engineering Facebook Page
–CoderPad Shared Coding Environment