**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

- Write a function that implements a binary addition of two strings. (You can only operate through the use of strings)
- Write a function that merges two sorted arrays, where each element is an interval.
- 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.
- 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.
- Given two strings representing very large numbers, write a method for adding the two numbers and returning their sum.
- Given a binary tree where each node represents an integer, find the max value of the path sum.
- Given a string with alpha-numeric characters and parentheses, return a string with balanced parentheses by removing the fewest characters possible.
- Given an input, return “True” or “False” if the array is sorted according to the ordering given.
- Design a spreadsheet program.
- Write a program to print all the columns of a binary tree from left to right and top-down.
- Write a function that finds the maximum sum of a subset of size K in an array.
- Given an array and an integer, find the smallest subarray whose sum is more or equal to the given integer.
- 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.
- Write a function that finds the distance between the farthest two elements in a binary tree.
- Given a sorted list of integers, square the elements and give the output in sorted order.
- 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?
- Write a function that finds how many subsets of a given array sum to zero.
- 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.
- Write a function that prints the levels of a binary tree in reverse order using stacks and recursion.
- Given an array, write a function that finds whether there are 3 elements in it such that a+b = c.
- Given an adjacency matrix of a directed graph, write a function that finds the number of cycles in the graph.
- Given an array of integers, write a method that returns the index of the max value of the array.
- 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.
- How would you multiply two infinitely large integers?
- Given a list of input tasks to run and the cooldown interval, output the minimum number of time slots required to run them.
- Write a function that validates an IP address in string format and returns in uint32 format.
- Given an n-ary tree and its deep copy and a node in the original tree, return the corresponding node in the copy.
- Write a function that finds the median of an unsorted array in average linear time.
- Given a list of numbers, find the maximum value you can get through basic arithmetic with any two numbers from the list.
- Given a group of movies and their start time, write a function that returns a movie schedule without conflicts between the movies.
- Given a matrix and a target, write a function that returns a path whose sum is equal to the target.
- 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.
- Given a string that contains parenthesis, write a function that removes the least amount of parenthesis to balance them.
- Design a system similar to GitHub.
- Write a function that finds out whether a given string forms a valid lottery number.
- Write a function that implements a Fibonacci iterator.
- Implement a circular buffer that can read and write functions.
- Design and implement an algorithm that assigns an unlimited M number of messages evenly among N number of servers.
- Given an odd number, write a function that prints a diamond pattern of stars recursively.
- 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.
- Given an array, write a function that finds the subarray that has the largest sum.
- Given a list of N points, write a function that finds the K closest points to the origin.
- 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.
- Write a function that groups a list of words so that the same group of words has a common substring.
- Write a function that generates a random number that differs from the number generated last time in the range of N and K.
- 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.
- Given a binary tree, write a function that finds the inorder successor of a node.
- 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.
- 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.
- 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;
}
```

#### Travel With Peace Of Mind

Staying safe and healthy while you travel has never been more important than it is today.
Join the world’s most user-friendly insurance company, **SafetyWing**, for less than $1.50/day. Cancel penalty-free any time.

## Facebook Behavioral Questions

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

- Understanding The Interview Process
- Four Axes of the Interview
- Coding
- Data Structures & Algorithms
- Systems Design
- Communication

- Interviewing Masterclass
- Data Structures & Algorithms
- 100+ Coding Sessions
- The Mock Interview
- Systems Design
- Transitioning Careers
- 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:

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**.