Facebook Interview Questions: 75 You Can Expect In Your Interview

January 18, 2021
Blog
" class="img-responsive wp-image-731235 wp-post-image" alt="" />
At Yore Oyster, we strive to help you make wise financial decisions. We're committed to giving you the most relevant, actionable advice anywhere.

Facebook is one of the most popular and sought-after big tech companies to work in if you’re a software engineer. In this post, we’ll mention 75 of the most common questions in technical interviews from Facebook, as well as how you can use Tech Interview Pro, a proven program offering hundreds of coding walk-throughs that also prepares you for the soft side of the interview, to ace these questions.

Facebook, like most other FAANG companies like Google and Amazon, is a pretty popular destination for most aspiring software engineers who seek to work at top of the line tech companies.

The sheer competition alone should make Facebook pretty hard to get into, but there’s an additional hurdle to get over: Facebook’s technical and behavioral questions, which are nothing to sneeze at.

Here are 75 of the most common questions you can expect to see in your Facebook interview: both from a technical and a behavioral perspective.

Facebook Technical Questions

  1. Write a function that implements a binary addition of two strings. (You can only operate through the use of strings)
  2. Write a function that merges two sorted arrays, where each element is an interval.
  3. Given a list of contacts, where each contact consists of a contact ID and an email address, write a function that outputs the full list while eliminating duplicates.
  4. Given an array of lowercase strings, write a function that finds the number of strings that can be made equivalent by performing some operations on one or both strings.
  5. Given two strings representing very large numbers, write a method for adding the two numbers and returning their sum.
  6. Given a binary tree where each node represents an integer, find the max value of the path sum.
  7. Given a string with alpha-numeric characters and parentheses, return a string with balanced parentheses by removing the fewest characters possible.
  8. Given an input, return “True” or “False” if the array is sorted according to the ordering given.
  9. Design a spreadsheet program.
  10. Write a program to print all the columns of a binary tree from left to right and top-down.
  11. Write a function that finds the maximum sum of a subset of size K in an array.
  12. Given an array and an integer, find the smallest subarray whose sum is more or equal to the given integer.
  13. Given a target node in a directed graph, write a function that finds the shortest cycle (including the target node) and returns the whole path.
  14. Write a function that finds the distance between the farthest two elements in a binary tree.
  15. Given a sorted list of integers, square the elements and give the output in sorted order.
  16. How would you store and retrieve values in the memory cache if the values are larger than the individual value size allowed by the memory cache?
  17. Write a function that finds how many subsets of a given array sum to zero.
  18. Given numbers 1 through 52, write a function that takes 5 unique numbers and determines if the number 42 can be made using any combination of addition, subtraction, multiplication, and division.
  19. Write a function that prints the levels of a binary tree in reverse order using stacks and recursion.
  20. Given an array, write a function that finds whether there are 3 elements in it such that a+b = c.
  21. Given an adjacency matrix of a directed graph, write a function that finds the number of cycles in the graph.
  22. Given an array of integers, write a method that returns the index of the max value of the array.
  23. Given an array of integers where each element points to the index of the next element, write a function that detects if there’s a cycle in the array.
  24. How would you multiply two infinitely large integers?
  25. Given a list of input tasks to run and the cooldown interval, output the minimum number of time slots required to run them.
  26. Write a function that validates an IP address in string format and returns in uint32 format.
  27. Given an n-ary tree and its deep copy and a node in the original tree, return the corresponding node in the copy.
  28. Write a function that finds the median of an unsorted array in average linear time.
  29. Given a list of numbers, find the maximum value you can get through basic arithmetic with any two numbers from the list.
  30. Given a group of movies and their start time, write a function that returns a movie schedule without conflicts between the movies.
  31. Given a matrix and a target, write a function that returns a path whose sum is equal to the target.
  32. Given an array of ints and a value X, write a function that finds whether there are 3 elements in the array such that their sum is X.
  33. Given a string that contains parenthesis, write a function that removes the least amount of parenthesis to balance them.
  34. Design a system similar to GitHub.
  35. Write a function that finds out whether a given string forms a valid lottery number.
  36. Write a function that implements a Fibonacci iterator.
  37. Implement a circular buffer that can read and write functions.
  38. Design and implement an algorithm that assigns an unlimited M number of messages evenly among N number of servers.
  39. Given an odd number, write a function that prints a diamond pattern of stars recursively.
  40. Given an array of unsorted integers, write a function that rearranges the array such that the number at the odd index is greater than the number at the even index.
  41. Given an array, write a function that finds the subarray that has the largest sum.
  42. Given a list of N points, write a function that finds the K closest points to the origin.
  43. Given a mapping from digits to a list of letters and a string of digits of arbitrary length, write a function that determines all possible ways to replace the digits with letters.
  44. Write a function that groups a list of words so that the same group of words has a common substring.
  45. Write a function that generates a random number that differs from the number generated last time in the range of N and K.
  46. Given an undirected graph where each node represents a char and a word, write a function that checks if a word can be formed by any path of the graph.
  47. Given a binary tree, write a function that finds the inorder successor of a node.
  48. Given a positive integer n, write a function that finds the number of integers that are less or equal to n, whose binary representation doesn’t contain consecutive 1s.
  49. Given an input string and a dictionary of words, write a function that finds out if the input string can be segmented into a space-separated sequence of dictionary words.
  50. Design a system that takes latitude and longitude values as inputs and outputs back the 5 closest locations.

Coding Answer Examples

All coding examples written in C++.

Coding Example #1: Given an array, write a function that finds the subarray that has the largest sum

// C++ program to print largest contiguous array sum 
#include<iostream> 
#include<climits> 
using namespace std; 
  
int maxSubArraySum(int a[], int size) 
{ 
    int max_so_far = INT_MIN, max_ending_here = 0; 
  
    for (int i = 0; i < size; i++) 
    { 
        max_ending_here = max_ending_here + a[i]; 
        if (max_so_far < max_ending_here) 
            max_so_far = max_ending_here; 
  
        if (max_ending_here < 0) 
            max_ending_here = 0; 
    } 
    return max_so_far; 
} 
  
/*Driver program to test maxSubArraySum*/
int main() 
{ 
    int a[] = {-2, -3, 4, -1, -2, 1, 5, -3}; 
    int n = sizeof(a)/sizeof(a[0]); 
    int max_sum = maxSubArraySum(a, n); 
    cout << "Maximum contiguous sum is " << max_sum; 
    return 0; 
} 

Coding Example 2: Write a function that implements a Fibonacci iterator

// C++ program to implement a Fibonacci iterator. 
#include <iostream>
#include <stdlib.h>

using namespace std;

unsigned long long int fibonacci_iterator (int n)
{
    int i = 0;
    int j = 1;
	
    for (int k = 1; k < n; k++)
    {	
        int t;
	t = i + j;
	i = j;
	j = t;
    }

    return j;
	
}

Coding Example #3: Given two strings representing very large numbers, write a method for adding the two numbers and returning their sum

// C++ program to find sum of two large numbers. 
#include<bits/stdc++.h> 
using namespace std; 
  
// Function for finding sum of larger numbers 
string findSum(string str1, string str2) 
{ 
    // Before proceeding further, make sure length 
    // of str2 is larger. 
    if (str1.length() > str2.length()) 
        swap(str1, str2); 
  
    // Take an empty string for storing result 
    string str = ""; 
  
    // Calculate length of both string 
    int n1 = str1.length(), n2 = str2.length(); 
  
    // Reverse both of strings 
    reverse(str1.begin(), str1.end()); 
    reverse(str2.begin(), str2.end()); 
  
    int carry = 0; 
    for (int i=0; i<n1; i++) 
    { 
        // Do school mathematics, compute sum of 
        // current digits and carry 
        int sum = ((str1[i]-'0')+(str2[i]-'0')+carry); 
        str.push_back(sum%10 + '0'); 
  
        // Calculate carry for next step 
        carry = sum/10; 
    } 
  
    // Add remaining digits of larger number 
    for (int i=n1; i<n2; i++) 
    { 
        int sum = ((str2[i]-'0')+carry); 
        str.push_back(sum%10 + '0'); 
        carry = sum/10; 
    } 
  
    // Add remaining carry 
    if (carry) 
        str.push_back(carry+'0'); 
  
    // reverse resultant string 
    reverse(str.begin(), str.end()); 
  
    return str; 
} 
  
// Driver code 
int main() 
{ 
    string str1 = "12"; 
    string str2 = "198111"; 
    cout << findSum(str1, str2); 
    return 0; 
} 

Coding Example #4: Write a function that finds the median of an unsorted array in average linear time

// C++ program to find mean and median of
// an array
#include <bits/stdc++.h>
using namespace std;
 
// Function for calculating mean
double findMean(int a[], int n)
{
    int sum = 0;
    for (int i = 0; i < n; i++)
        sum += a[i];
 
    return (double)sum / (double)n;
}
 
// Function for calculating median
double findMedian(int a[], int n)
{
    // First we sort the array
    sort(a, a + n);
 
    // check for even case
    if (n % 2 != 0)
        return (double)a[n / 2];
 
    return (double)(a[(n - 1) / 2] + a[n / 2]) / 2.0;
}
 
// Driver code
int main()
{
    int a[] = { 1, 3, 4, 2, 7, 5, 8, 6 };
    int n = sizeof(a) / sizeof(a[0]);
   
    // Function call
    cout << "Mean = " << findMean(a, n) << endl;
    cout << "Median = " << findMedian(a, n) << endl;
    return 0;
}

Coding Example #5: Given a binary tree, write a function that finds the inorder successor of a node

//C++ program to find inorder successor of a node 
#include<bits/stdc++.h> 
using namespace std; 
  
// A Binary Tree Node 
struct Node 
{ 
    int data; 
    struct Node *left, *right; 
}; 
  
// Temporary node for case 2 
Node* temp = new Node; 
  
// Utility function to create a new tree node 
Node* newNode(int data) 
{ 
    Node *temp = new Node; 
    temp->data = data; 
    temp->left = temp->right = NULL; 
    return temp; 
} 
  
// function to find left most node in a tree 
Node* leftMostNode(Node* node) 
{ 
    while (node != NULL && node->left != NULL) 
        node = node->left; 
    return node; 
} 
  
// function to find right most node in a tree 
Node* rightMostNode(Node* node) 
{ 
    while (node != NULL && node->right != NULL) 
        node = node->right; 
    return node; 
} 

Facebook Behavioral Questions

  1. What do you do to stay motivated?
  2. What has been your best collaboration experience?
  3. How do you build relationships?
  4. What would you do if an interviewer didn’t show up?
  5. What is one project you’re proud of?
  6. Why do you want to work for Facebook?
  7. What is the biggest compliment you have received in your current role?
  8. What would be your biggest challenge coming into this role?
  9. Has there been a time that you had a disagreement with your manager?
  10. What are Facebook’s challenges in the coming years?
  11. What would an old co-worker say about you?
  12. Describe the personality of a manager who you’d never want to work for.
  13. Are there any duties you absolutely hate doing?
  14. Are you able to remain productive while working from home?
  15. Facebook has restrictions for users under the age of 13. How would you go about identifying users younger than 13?
  16. Do you prefer to work as part of a team or independently?
  17. Describe the use of hashtags on Facebook, as well as how they can be abused.
  18. How would you recommend combating hate speech on social media?
  19. Which of your traits will make you a strong team leader? Why?
  20. Have you ever managed a large-scale project before?
  21. How would you improve Facebook notifications if you could make any changes you wanted?
  22. Imagine your best possible workday. What did you do during that day? Why was it amazing?
  23. If you were given a new product, how would you define the target market and position the product for success?
  24. What is the most challenging problem you ever had to solve at work?
  25. How do you like to give and receive feedback?

Behavioral Answer Examples

Behavioral Example #1: What do you do to stay motivated?

In any job, staying motivated is crucial if you want to avoid burnout, make sure you stick with the job and deliver the best results.

If what motivates you is volatile (like the constant hope of a promotion, or the ability to shape big company decisions), it may be cause for pause.

In addition, if their source of motivation is tied to your company’s culture and values (like care for the environment, or providing excellent service to customers) it can be a sign they’re a good fit.

Behavioral Example #2: What would you do if an interviewer didn’t show up?

It might seem like a silly question, but the answer to this question can provide a fascinating insight about how you react when things go wrong.

It can also provide insight into how you handle problems on the job, and you definitely want your interviewer’s impression of this aspect to be positive.

Behavioral Example #3: What would an old co-worker say about you?

This question is an interesting way to rephrase the question “tell me about yourself.” It allows you to speak about yourself more objectively, from the shoes of a hypothetical coworker, rather than feeling the pressure of having to either be humble or boast in a self-assessment.

Behavioral Example #4: Describe the personality of a manager who you’d never want to work for

Most employees work under different conditions, and many hiring managers want to find out the circumstances that allow a candidate to shine, as well as what holds them back.

This question focuses a bit more on the latter. The hiring manager wants to learn about management styles that don’t meet your needs. That way, they can determine if you’d excel as part of the team.

Behavioral Example #5: Are there any duties you absolutely hate doing?

This question can feel a little bit tricky. After all, saying that you don’t like certain tasks doesn’t seem like a good idea.

But that doesn’t mean that this question is impossible to tackle. The trick is to be honest, but then to pivot by focusing on the steps you take to remain engaged even when you don’t love a particular responsibility.

Why Tech Interview Pro?

As you can probably tell, some of these questions can be pretty easy to tackle.

But as I’ve mentioned in our Google article, you can’t rely on getting only questions rated Easy to get through your interviews.

You’re just as likely to get every question to be rated Hard, and if you truly want to have the best possible chance of success, it’d be better to study like if that were the case.

But how do you go about efficiently studying if you’re going to study that hard?

I recommend you use Tech Interview Pro, an interview prep program designed by a former Google and Facebook software engineer who has compressed the knowledge he gathered from conducting over 100 interviews during his time into a single course.

And here are a few reasons why I recommend it.

#1 A Thorough Approach

Tech Interview Pro takes a comprehensive approach to its teaching, taking both the technical and behavioral aspects into consideration in its 20+ hours of video lessons.

Here’s TIP’s course outline:

  1. Understanding The Interview Process
  2. Four Axes of the Interview
    1. Coding
    2. Data Structures & Algorithms
    3. Systems Design
    4. Communication
  3. Interviewing Masterclass
  4. Data Structures & Algorithms
  5. 100+ Coding Sessions
  6. The Mock Interview
  7. Systems Design
  8. Transitioning Careers
  9. Negotiating & Accepting Your Offer

As you can see, TIP has a balance of both the technical and the behavioral, which is definitely more coverage than most of the tech interview prep courses out there.

#2 Private Facebook Group

Another neat feature that Tech Interview Pro grants its students is access to a private Facebook group with 1,500+ former students of the course.

Here are some of their success stories:

Tech Interview Pro Review - Success Stories
Tech Interview Pro Review - Success Stories
Tech Interview Pro Review - Success Stories

When you consider how many TIP students have landed jobs at FAANG companies thanks to the course, as well as how active and supportive the Facebook group is day to day, it’s really an invaluable resource to have.

#3 Created By An Industry Insider

Tech Interview Pro is run by an industry veteran who has reverse-engineered the hiring process to give you the best chance of success.

TechLead (Patrick Shyu) has grown his own websites to millions of users, spent his recent years working at Facebook and Google, and has conducted over 100 technical interviews for Google.

So if there’s anyone who can teach you how to ace your technical interviews, it’s this guy.

#4 Bi-Weekly Q&A Sessions

Every two weeks, TIP students can engage in Q&A sessions with the course’s founder, TechLead.

This is a huge advantage: after all, nothing’s stopping you from asking any of the questions featured on the list above, whether it’s a technical question or a behavioral one, and you can expect a thorough answer in return.

Another thing to keep in mind is that every Q&A session is recorded and ready to be accessed at any time, so there’s nothing stopping you from checking previous Q&A sessions too.

#5 Resume Reviews

Your resume will be the first thing a recruiter will see coming from your end, and making it look pretty won’t be enough: you need to make sure it knocks them out when they see it so that you can have a headstart into the interviewing process.

Considering this, TechLead will also personally review your resume and help you tailor it for the position and the company you seek to apply for.

#6 Lifetime Access

Lastly, TIP grants lifetime access to the entire course and private Facebook group, which means that you’ll be able to see new video lessons as they’re added, grow alongside the Facebook group, watch all of future Q&A sessions, and everything else.

TIP’s got your back, whether you want to land a job now or in the future.

In Summary

Getting into Facebook as a software engineer is a very challenging endeavor, and the difficulty of their technical and behavioral questions only makes it harder to actually get there.

However, as long as you properly prepare for these questions ahead of time, you should have a pretty good chance of leaving the interviewing process with a job in hand. To give yourself the best possible chance of success, we recommend you prepare with a more comprehensive, battle-tested solution like Tech Interview Pro.

Get More Of Our Best

2021's Financial & Travel Essentials

Get our special report highlighting the 4 tools you need to build wealth and protect your assets in 2021.