# Facebook Data Scientist Probability Interview Questions

##### Categories

*A comprehensive approach for solving a Facebook (Meta) Data Scientist probability interview question!*

Considering many data science roles require knowledge of probability and statistics, it’s fairly common to encounter a probability-based question during your data science interview. Keep reading to see how you might appropriately answer any probability questions an interviewer asks of you!

Facebook (Meta) started out at Harvard and quickly grew in popularity to become worth over a trillion dollars today. Facebook (Meta) forms part of the Big Five companies in data science with Google, Apple, Microsoft, and Amazon. While primarily known for its social network, it also produces applications such as Messenger, WhatsApp, Instagram, Giphy, and Oculus plus some others.

## Data Science Position at Facebook (Meta)

Given the large diversity of business operations at Facebook (Meta), data scientist responsibilities depend on your business unit and the team to which you’re applying. You can be confident you’ll work on great amounts of data while having the ability to take advantage of the newest visualization, machine learning, and similarly related tools, and, in many cases, you’ll have to apply your probability calculation skills.

Check out our post “*Facebook Data Scientist Position Guide*” to find out what it means to be a data scientist at Facebook.

## Concepts Tested in Facebook (Meta) Probability Interview Questions

In this Facebook (Meta) data science probability interview question, the primary concepts tested will include:

- Understanding cases and scenarios
- Comparing outcomes
- Combinatorics
- Generalizing a solution for
*n*rounds

With practice questions like this one as well as other probability interview questions, your probability skills can be interview-ready in no time!

## Facebook (Meta) Data Scientist Probability Interview Question

**Stones Game**

This probability based question appeared during an interview at Facebook (Meta). Its title is “Stones Game”, and the goal is to determine the probability of a player winning based on die rolls which dictate stone swapping.

Link to the question: https://platform.stratascratch.com/technical/2076-stones-game

Basically, we have to find the odds B wins in 1,2 or *n *rounds based on fair 6-sided die rolls. Furthermore, B is already at a stated disadvantage of 2 stones.

#### Theoretical Framework

We can start this problem with a mathematical analysis of the game.

Because the initial conditions are uneven for the players, our generalization will only work for all rounds after the 1st. However, we can develop a general method to find win and tie probabilities which we can plug in numbers corresponding to the conditions of any round. For this, we’ll first outline some definitions:

xan is the amount of stone where A takes over B at the n-th round

xbn is the amount of stone where B takes over A at the n-th round

An is the amount of stone player A begins with in the n-th round

Bn is the amount of stone player B begins with in the n-th round

For player B to win a round, they must meet the following conditions:

And for a tie, they must meet the following conditions:

Any round after the first requires equal stones for both players, so our equations simplify even further since:

when n > 1:

As such, our general solution, will include the following events and their probabilities:

H = B wins the first round which is all cases which fulfill

over all the possible cases from two dice rolls (An, Bn)

I = Game ties in the first round which is all cases which fulfill:

over all the possible cases from two dice rolls (An, Bn)

J = Game ties in the *n*-th round, where *n* > 1, which is all cases which fulfill

over all the possible cases from two dice rolls (An, Bn)

K = Player B wins in the *n*-th round, where *n *> 1, which is all cases which fulfill

over all the possible cases from two dice rolls (An, Bn)

The final thing to consider for a general solution, is each incremental round is less likely by the probability of a tie when n > 1. As such, our general solution when n = 1 would be:

And i > 1 would be

With our equations established, we can now plug in actual cases to calculate probabilities.

#### Practical Framework: B Wins or Ties the 1st Round

First, we’ll determine the conditions under which B can win or tie the 1st round. Since A is ahead of B by 2 stones, player B will win the first round if

This simplifies to 1<xb1-xa1 of which any cases where B’s dice roll is at least 2 higher than A’s will fulfill this scenario:

This is 10 scenarios out of 6 squared = 36 possible from two dice rolls. Therefore, the probability B wins the first round = 10/36.

There are several cases where the game ties

Any case where B’s dice roll is only 1 higher than A’s will fulfill this scenario:

so the probability of a tied first round is 5/36.

#### Practical Framework: B wins or ties the 2nd round

If the 1st round is a tie, the game proceeds to the second round. The 2nd round’s win equation is:

where B’s dice roll simply needs to be higher than A’s dice roll.

Conveniently, all the scenarios from the 1st round fulfill this win equation, so the probability B wins in the second round is 15/36.

There are 6 scenarios where the second round ties equating to when B’s dice roll is exactly the same as A’s dice roll, so the probability of a 2nd round tie (and the probability of ties for *n* rounds after) is 6/36 = 1/6.

#### Practical Framework: B wins the *n*th round

For determining B winning in *n* rounds, we need to multiply several probabilities together. Recall from the earlier analysis how each new tie after the 1st round is less probable due to the tie requirement, so our final probability equation when n > 1 is

Keep in mind our initial events specify this will only apply when n is greater than 1. Otherwise, we’ll stick to our original probability of B winning the 1st round.

### Conclusion

Here we analyzed and covered a quick and general solution to the stones game problem heard from a Facebook (Meta) interviewer. ‘Games’ type questions will come up fairly frequently during probability sections of an interview, so it’s important to practice more probability interview questions. Also, check out our post “*Facebook Data Science Interview Questions*” to find coding questions that Facebook interviewers ask at data science interviews.