# Facebook AI Interview Questions — Acing the AI Interview

Facebook needs no introduction. After founding in 2004, after almost a decade of amassing enormous amounts of data in 2013, engineers within Facebook started experimenting with CNNs. Right after, Facebook hired their first engineer recognizing the importance of AI and Deep Learning out of Google Brain, Marc’Aurelio Ranzato. Later they hired the inventor of CNNs, Yann LeCun.

Yann LeCun is the Director of AI Research at Facebook AI Research (FAIR). Facebook research is trying to replicate Google’s model to build a research organization aimed to have publications as well as a residency program to help research folks get into Facebook AI. Most publications revolve around computer vision and data science which can be leveraged as Facebook has a lot of image data to deploy CNNs for image identification.

At Facebook some teams use data to inform their product decisions while for some data is a core component. Depending on the usage, there is a Data Science team which is its own stand alone organization while some teams have research and data scientists of their own. Strong programming skills with a systems-level thinking is important to get into Facebook AI research.

Interview Process

Facebook interview process is the standard interview process that most companies use. The process is explained in detail by a Facebook engineer here.

Important Reading

- Facebook’s AI framework for vision applications: Open Neural Network Exchange Format. (ONNX)
- Download Library of their projects/packages: Downloads
- Facebook Research Blog

Interview Questions (About Facebook AI/Data Science)

- There is a building with 100 floors. You are given 2 identical eggs. How do you use 2 eggs to find the threshold floor, where the egg will definitely break from any floor above floor N, including floor N itself.
- You randomly draw a coin from 100 coins — 1 unfair coin (head-head), 99 fair coins (head-tail) and roll it 10 times. If the result is 10 heads, what is the probability that the coin is unfair?
- Write a sorting algorithm for a numerical dataset in Python.
- Facebook would like to develop a way to estimate the month and day of people’s birthdays, regardless of whether people give us that information directly. What methods would you propose, and data would you use, to help with that task?
- Use a python built-in package to manipulate ‘csv’ data.
- How would you compare the relative performance of two different back-end engines for automated generation of Facebook “Friend” suggestions?
- Given a KPI, choose the right metric, perform ETL. (using SQL/Code)
- You’re about to get on a plane to Seattle. You want to know if you should bring an umbrella. You call 3 random friends of yours who live there and ask each independently if it’s raining. Each of your friends has a 2/3 chance of telling you the truth and a 1/3 chance of messing with you by lying. All 3 friends tell you that “Yes” it is raining. What is the probability that it’s actually raining in Seattle?
- Consider a game with 2 players, A and B. Player A has 8 stones, player B has 6. Game proceeds as follows. First, A rolls a fair 6-sided die, and the number on the die determines how many stones A takes over from B. Next, B rolls the same die, and the exact same thing happens in reverse. This concludes the round. Whoever has more stones at the end of the round wins and the game is over. If players end up with equal # of stones at the end of the round, it is a tie and another round ensues. What is the probability that B wins in 1, 2, …, n rounds?
- How do you get the count of each letter in a sentence?
- How do you prove that males are on average taller than females by knowing just gender or height?
- What is a monkey patch?
- Given a list A of objects and another list B which is identical to A except that one element is removed, find the removed element.
- Given a list of integers (positive & negative), write an algorithm to find whether there’s at least a pair of integers that sum up to zero. How would you improve your algorithm’s performance?
- Make a histogram of 2 variables.
- Build a histogram of post reply count in SQL (number of posts with x replies, x+1 replies, etc).
- Build a table with a summary of feature usage per user every day (keep track of the last action by user and roll up every day).
- You’re at a casino with two dice, if you roll a 5 you win, and get paid $10. What is your expected payout? If you play until you win (however long that takes) then stop, what is your expected payout?
- What metric would you show small businesses if you were trying to have them sign up for Facebook Ads?
- Given a table of friend requests sent and friend requests received, find the user with the most friends.
- Likes/user and minutes spent on a platform are increasing but total number of users are decreasing. What could be the root cause of it?
- How many high schools that people have listed on their profiles are real? How do we find out, and deploy at scale, a way of finding invalid schools?
- How do you map nicknames (Pete, Andy, Nick, Rob, etc) to real names?
- Facebook sees that likes are up 10% year over year, why could this be?
- If a PM says that they want to double the number of ads in Newsfeed, how would you figure out if this is a good idea or not?

Reflecting on Questions

At Facebook, I see an inclination towards questions on probability based scenarios. Many questions also require a deep understanding of the Facebook product as well the ability to write code. Facebook has some of the world’s best vision researchers as well as Google scholars in their AI team. Good preparation for coding coupled with foundational knowledge about data science can surely land you a job at the world’s largest social directory.

For a more consumable list: 25 Facebook AI Interview Questions

If you find this article useful, please clap and share your thoughts in the comments below.