Facebook Interview Process (With Latest Coding Questions)

Facebook Interview Process and Coding Questions


To excel at the Facebook interview process, you first need to know what it is. Let’s talk about it and solve several Facebook interview questions along the way.

The Facebook hiring process is, at the same time, easy and very slippery. The easy part comes from the hiring process having more or less the same steps as any other respectable company. All these steps are listed on the company’s website, so there can be no unknowns here.

But did you ever have a teacher that allowed you to use all the available literature on tests? I did, and you can imagine what happened – from laughing at my teacher’s naivety to crying because of my own. Of course, not one question could have been answered simply by looking up some fact or a definition in a book!

These types of tests are there to assess your knowledge and thinking, not the ability to spout facts. Facebook does the same, and the slippery slope of its hiring process comes from there.

That slope is up to you to climb. But we’ll provide you with the tools to make climbing safer, quicker, and more successful. Still, it’s you that’ll have to use them.

What Are the Areas of Work for Data Scientists at Facebook?

What Are the Areas of Work for Data Scientists at Facebook

When you become a data scientist at Facebook, you become a part of the Data and Analytics Team.

As Facebook has several of them in its portfolio, your work can be closely linked to one of the seven technologies:

  1. Facebook
  2. Instagram
  3. Messenger
  4. Meta Portal
  5. Meta Quest
  6. WhatsApp
  7. Workplace

Some don’t need a special introduction, but we’ll introduce them nevertheless.

Facebook is still one of the most popular social media. You know, the one where you spend hours arguing with other people, linking your favorite songs from Youtube when you get drunk, and sharing images of how great your life becomes every weekend.

Instagram is a photo and video-sharing social media. It allows you to curate your image to the extent where even you start believing you’re cool and important. And you start using the word ‘cool’.

Messenger is an instant messaging app connected to your Facebook account. You can use it to fight in private, with all those people you can’t see eye to eye. It even allows you to stay in touch with your parents, family, and friends wherever they are.

Meta Portal is Meta’s brand of videophones and smart displays designed for video calls and staying in touch with whoever you don’t like to meet in person.

Meta Quest is a virtual reality headset. If you’re fed up with your life, you can always have a better and nicer one using the Meta Quest.

WhatsApp is the most popular instant messaging application, acquired by Facebook in 2014.

Workplace is an online collaborative tool for teamwork, instant messaging, and video conferencing. Similar to Slack, Zoom, or Microsoft Teams.

Facebook 4-Step Recruitment Process

Here’s an overview of the Facebook interview process. It consists of four steps:

  1. Applying for a job
  2. Recruiter interview
  3. Phone or video interview
  4. Onsite interviews
Facebook Recruitment Process

1. Applying For a Job

The hiring process starts with you applying for a job. The best way is to search for jobs and apply through the Facebook jobs page. If you prefer, you can do it through Facebook’s Linkedin site or job searching sites such as Glassdoor or Indeed.

No matter what, you’ll be redirected to the job ad on the Facebook website to apply. There, you’ll be required to provide some contact information, upload your CV, and give information about your education, experience, and skills.

Of course, it’s always possible that the recruiter will contact you about the job you might be interested in. This is great, and it boosts your chances (and ego). Nevertheless, you’ll still have to apply for a job.

2. Recruiter Interview:

The second stage of Facebook recruitment process is “Recruiter Interview”. This stage will take around 30 minutes and will be conducted via phone.

In this short interview, the recruiter will tell you more about the job, what is expected of you, and what you can expect from the job and working at Facebook.

The idea is to ensure that you and the employer are on the same page regarding the expectations. That’s why you’ll also have to introduce yourself by discussing your education, experience, skills, and motivation for choosing this job and Facebook.

Occasionally, there will be one or two very light and general technical questions to get an idea of your technical skills.

3. Phone or Video Interview

In this step of Facebook interview process, there is a 45-minute interview with the hiring manager or a team member.

The interviewer and yourself will shortly introduce yourselves to each other. You’ll talk about your resume, especially your technical skills.

There will be several technical questions for you to answer. If it’s a video call, you’ll most likely have to solve one or two coding exercises.

4. Onsite Interviews

This is the final stage of Facebook interview process, where you’ll have to survive three to six interviews at Facebook premises. Sometimes it can happen that those are, again, video and not onsite interviews.

Each interview will last around one hour. You’ll be interviewing with the superiors, teammates, hiring manager, and other colleagues.

Be ready to answer a lot of coding questions, as well as other technical non-coding questions. This will be the main focus. But there will also be behavioral questions to see how you fit within a team and company. In other words, whether you’re a good culture fit.

There will be a more casual part of the interview, where you’ll have lunch with some or all of the interviewers. The idea is to get to know each other in a more relaxed atmosphere and make sure you make a good impression on each other.

How Long Does the Facebook Interview Process Take?

After you’re done with these four steps, there’s nothing else you can do. You did your best, and now you are waiting for the decision. A hiring committee makes it. It consists of the Facebook seniors taking the hiring recommendations from the interviewers. Once they’re done making decisions, the recruiter will contact you and let you know how you did in the interviews, and hopefully, you’ll also receive a job offer.

The whole process – from applying to getting a job offer – takes one to two months.

Skills That Facebook Looks For in Their Data Scientists

Skills That Facebook Looks For in Their Data Scientists

The skills and education that Facebook looks for depend on the specific job, its seniority, and the technology you’ll work within.


Let’s take a look at several currently open job ads for data scientists. This job focuses on sales analysis within the Reality Labs, Facebook’s business and research unit for virtual and augmented reality.

Facebook data scientist job post example
Minimum qualifications for a data scientist at Facebook

Another interesting job ad is looking for data scientists focusing on machine learning.

Facebook data scientist job post example
Minimum qualifications for a data scientist at Facebook


You could also work as a research data scientist focusing on machine learning.

Facebook research data scientist job post example
Minimum qualifications for a research data scientist at Facebook

These three examples show somewhat different jobs, as well as different minimum and preferred qualifications. You should evaluate your qualifications against each job you want to apply to.

However, there are some typical qualifications and skills that are required by most any data science job at Facebook:

Qualifications for a data scientist job at Facebook

How to Best Prepare for Your Facebook Interview

The job at Facebook, as with any of the FAANG companies, is not that easy to get. They are an attractive employer, and a lot of (very competent) candidates will compete for one job.

If working for Facebook is your burning desire, then it’s best to apply something we call a two-layer approach. One layer is a long-term preparation. The other layer is acquired in the short term.

The First Layer: Long-Term Preparation

This is a strategy you have to devise, mainly if you’re just starting as a data scientist. It’s something you have to invest a lot of time in and mainly includes actions that have to be undertaken long before you even apply for the job.

This long-term approach includes:

  1. Education
  2. Practice
  3. Building a portfolio
  4. Getting experience

Education can involve enrolling in a university to get a formal education in the quantitative field you’re interested in. Depending on your previous education, you might be pursuing a Bachelor's or a Master’s Degree, even a Ph.D. You can also enroll in online university courses on Coursera and other online courses on Udemy or similar websites. Other resources include interactive courses for learning programming languages, Youtube channels, and articles.

Practice. Practice is the best way to learn, especially regarding coding skills. Otherwise, what you learned will go away very quickly., You can practice on your own or solve numerous coding challenges that exist online.

To be more focused in your practice, it’s even better to practice actual coding and non-coding interview questions, especially if they are Facebook interview questions. Answering real interview questions is not only a way to learn coding and non-coding skills. With every solved question, you get more used to the question types, their wording, common traps & tricks, and the edge cases. You name it. At your Facebook interview, you might get exactly the same question you practiced. Even if that doesn’t happen, the chance is you’ll get a problem similar to something you already saw and solved when preparing.

Building a portfolio means doing interesting data science projects. Along with them being interesting, working on them will make you learn and practice the skills required in each data project lifecycle step. You’ll scrape data, use APIs, visualize data, and build and deploy models.

Nothing beats the experience, so sometimes it’s a good idea to start working in a smaller company. Smaller companies usually require you to be hands-on and be involved in more than what’s strictly your job. It usually means working in a less structured environment than Facebook. This means you must be creative in finding solutions to most data-related things. In other words, often, you’ll have to turn chaos into order.

While this is not easy and maybe not for everyone, it really pushes your boundaries. It makes you more creative, not so dependent on the perfect circumstances, and more knowledgeable about every side of the business. These skills come in handy once you start working at Facebook.

The Second Layer: Short-Term Preparation

Once you think you’re ready for Facebook, the short-term preparation layer comes.

  1. Research the job and the company
  2. Practice
  3. Tell your story

Researching the job means you thoroughly read the job and make sure you satisfy most of the requirements and that the job interests you. You should also use the job description as a guide on which skills to focus when getting ready and what the behavioral questions could be about.

When it comes to company research, you should be familiar with its products, competitors, and industry in general. It’s good to know Facebook’s history, organization (at least the relevant part of it), culture, and some crucial financial information.

No, it’s not a mistake. Practicing is crucial, even in the short term. Since you have less time, practicing should focus on brushing up on some essential coding concepts required by the job. Still, Ideally, you would solve a mammoth number of interview questions, especially those asked by Facebook. This should also include other technical questions that don’t involve coding. For example, some statistics or modeling questions.

Telling your story refers to being ready for the behavioral interview questions. Bein ready, in this case, doesn’t mean preparing your answers in advance. However, you should have ready in your mind several examples that can showcase your skills, how you reacted in certain situations, what did you bring to your previous employers, and what did you learn.

Think about projects and tasks, what skills you used, how you managed time and relationships with bosses and colleagues, and how you managed adverse situations.

One piece of advice – don’t be perfect! While you’ll want to show yourself in the best possible light, also mention some examples where you didn’t perform perfectly. The point is to show you’re a good candidate but also that you’re human. You won’t be fooling anyone with your ‘I-always-act-like-I-should’ selection of stories.

Latest Facebook Data Science Coding Interview Questions

Latest Facebook Data Science Coding Interview Questions

When preparing for the interview for Facebook, it’s important to show that you’re a whole package. While you will be asked behavioral and technical non-coding questions, the data scientist job interview mainly focuses on coding.

There are more details in our analysis of the Facebook question types in the Facebook Data Scientist Interview Guide.

SQL and Python are must-know programming languages in data science. Unsurprisingly, these are the three most likely types of coding questions you’ll get:

  1. SQL
  2. Python
  3. Data project
  4. Algorithmic problem-solving

SQL Coding Questions

We’ll show the first question example and then let you solve the second question.

Top Two Media Types

This Facebook question from July 2022 tests several important SQL concepts:

  • Subqueries/CTEs
  • Data aggregation and grouping
  • Window functions/ranking data
  • Filtering data


Table: online_sales_promotions

Link to the question: https://platform.stratascratch.com/coding/2124-top-two-media-types

The question solution uses a subquery to rank the media type and find the money spent by media type. (Every subquery can be written as a CTE. Try to solve this question with CTE!)

The ranking is done using the DENSE_RANK() window functions, while the SUM() aggregate function sums the costs. The output is then grouped by the media type.

Finally, the output is filtered using the WHERE clause to show only the first and second ranks.

WITH cte AS
  (SELECT media_type,
          SUM(cost) AS money_spent,
          DENSE_RANK() OVER(
                      ORDER BY SUM(cost) DESC) AS rnk
   FROM online_sales_promotions
   GROUP BY media_type)
SELECT media_type,
       money_spent
FROM cte
WHERE rnk <= 2;


The output looks like this.

All required columns and the first 5 rows of the solution are shown

media_typemoney_spent
Broadcast32000
Print32000
Internet25000

Product Families

This is a hard-level Facebook question from July 2022. By solving it, you’ll have to show knowledge of these SQL concepts:

  • Data aggregation and grouping
  • Working with NULLs
  • Filtering data
  • JOINs


Tables: facebook_products, facebook_sales_promotions, facebook_sales

Link to the question: https://platform.stratascratch.com/coding/2123-product-families

Here are several hints for solving this question. Combine the COALESCE() and SUM() functions to deal with NULLs and find the number of units sold and the percentage of units old that had a valid promotion.

Also, LEFT JOIN all three tables on the common column.

Try to write the solution in the widget.

You should get three rows and columns with these values.

All required columns and the first 5 rows of the solution are shown

product_familyunits_soldperc_with_valid_promotion
CONSUMABLE103100
ACCESSORY00
GADGET8676.744


Before going to Python, you could also check some other concepts tested in the Facebook SQL interview questions.

Python Coding Questions

We’ll again show you two examples of the Facebook Python interview questions. We’ll solve the first question, and you should do the second.

Apart from writing a correct solution, we also advise you to have a structured approach to answering the Facebook Python interview questions.

Customer Consumable Sales Percentages

It’s a fresh question from February 2023. It is categorized as an easy question that tests several basic Python concepts:

  • Joining tables
  • Filtering data
  • Grouping data
  • Unique values

Tables: online_orders, online_products

Link to the question: https://platform.stratascratch.com/coding/2149-customer-consumable-sales-percentages

The solution uses the merge() method to join available tables using the inner join type. The data is then filtered by loc() to show only the ‘Consumable’ product family.

After that, the result is grouped by brand name and the number of unique customers.

Finally, find the total number of unique customers and calculate the required percentage.

import pandas as pd

merged = pd.merge(online_orders, online_products, on="product_id", how="inner")
consumable_df = merged.loc[merged["product_family"] == "CONSUMABLE", :]
result = (
    consumable_df.groupby("brand_name")["customer_id"]
    .nunique()
    .to_frame("pc_cust")
    .reset_index())

unique_customers = merged.customer_id.nunique()
result["pc_cust"] = (100.0 * result["pc_cust"] / unique_customers).round()
result


This is the table the code will return.

All required columns and the first 5 rows of the solution are shown

brand_namepc_cust
Fort West80
Golden80
Lucky Joe20


User Streaks

To solve this hard-level problem, you need to be fluent with the following:

  • Dealing with duplicates
  • Sorting values
  • Data filtering
  • Working with time series
  • Accessing previous rows
  • Grouping data
  • Cumulative sum
  • Ranking


DataFrame: user_streaks
Expected Output Type: pandas.Series

Link to the question: https://platform.stratascratch.com/coding/2131-user-streaks

This is what you have to do to solve the question. First, remove duplicates and sort values by user and date visited. Then filter out all the visits before August 10, 2022. After that, shift the index by one to show the previous visit date.

Then calculate the difference between the current and previous visit, and mark those visits where there’s a streak, i.e., visits are on consecutive dates. Find the length of each streak, give it an ID, and show data for every user.

Finally, rank the streak lengths. Show the three longest streaks with the corresponding user ID.

Translate these instructions into a Python code below.

If you get the right solution, the output should look like this.

All required columns and the first 5 rows of the solution are shown

user_idstreak_length
u0035
u00410
u00510

Data Project

Some interviewees reported that they got a data project (or a take-home assignment) to solve. The data projects test your understanding of each cycle of a data science project. As it goes, it tests your fluency in Python and your ability to do a whole project on your own.

One such example of a Facebook data project is this one.

Link to the question: https://platform.stratascratch.com/data-projects/rotten-tomatoes-movies-rating-prediction

You’re given a dataset from Rotten Tomatoes. The task is to build a classification algorithm to predict whether a movie on Rotten Tomatoes will be labeled as ‘Rotten’, ‘Fresh’, or ‘Certified-Fresh’. You should define, train, and evaluate a predictive model.

Algorithmic Problem-Solving

Depending on the job, you might also get some questions asking you to write algorithms.

For example, something like the Valid Number question on LeetCode.

Here’s what your approach should look like.

Algorithmic problem for Facebook interview

Summary

This article laid the groundwork for your Facebook interview preparation. We discussed what skills Facebook looks for in its data scientists and how they select them. We dissected the four-step interview process.You know what could await you in the interview process. With all this information, you should be able to structure your preparation for the interview, especially with all the available resources. One of the most helpful tools is practicing coding on the actual interview questions, especially if they’re from Facebook.


We showed six such questions, so you know what to expect. However, they aren’t enough for thorough preparation. Make sure that you check all our other coding, non-coding, and data project interview questions. Practicing that way will get you the closest you can get to an interview before an interview.

Facebook Interview Process and Coding Questions


Become a data expert. Subscribe to our newsletter.