0% found this document useful (0 votes)
107 views10 pages

Ace Your Data Science Interview

Uploaded by

Shariul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views10 pages

Ace Your Data Science Interview

Uploaded by

Shariul
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Probability Questions

Easy
1.1. Google: Two teams play a series of games (best of 7) in which each
team has a 50% chance of winning any given round. What is the probability
that the series goes to 7 games?

1.2. JP Morgan: Say you roll a die three times. What is the probability
of getting two sixes in a row?

1.3. Uber: You roll three dice, one after another. What is the probability
that you obtain three numbers in a strictly increasing order?

1.4. Zenefits: Assume you have a deck of 100 cards with values ranging
from 1 to 100, and that you draw two cards at random without replacement.
What is the probability that the number of one card is precisely double that
of the other?

1.5. JP Morgan: Imagine you are in a 3D space. From (0, 0, 0) to (3, 3, 3),
how many paths are there if you can move only up, right, and forward?

1.6. Amazon: One in a thousand people have a particular disease, and


the test for the disease is 98% correct in testing for the disease. On the
other hand, the test has a 1% error rate if the person being tested does not
have the disease. If someone tests positive, what are the odds they have
the disease?

1.7. Facebook: Assume two coins, one fair (having one side heads and
one side tails) and and the other unfair (having both sides tails). You pick
one at random, flip it five times, and observe that it comes up as tails all
five times. What is the probability that you are flipping the unfair coin?

1.8. Goldman Sachs: Players A and B are playing a game where they
take turns flipping a biased coin, with p probability of landing on heads
(and winning). Player A starts the game, and then the players pass the
coin back and forth until one person flips heads and wins. What is the
probability that A wins?

1
1.9. Microsoft: Three friends in Seattle each told you it is rainy, and each
person has a 1/3 probability of lying. What is the probability that Seattle
is rainy, assuming that the likelihood of rain on any given day is 0.25?

1.10. Bloomberg: You draw a circle and choose two chords at random.
What is the probability the those chords will intersect?

1.11. Morgan Stanley: You and your friend are playing a game. The two
of you will continue to toss a coin until the sequence HH or TH shows up.
If HH shows up first, you win. If TH shows up first, your friend wins. What
is the probability of you winning?

1.12. JP Morgan: Say you are playing a game where you roll a 6-sided
die up to two times and can choose to stop following the first roll if you
wish. You will receive a dollar amount equal to the final amount rolled.
How much are you willing to pay to play this game?

1.13. Facebook: Facebook has a content team that labels pieces of


content on the platform as either spam or not spam. 90% of them are
diligent raters and will mark 20% of the content as spam and 80% as non-
spam. The remaining 10% are not diligent raters and will mark 0% of the
content as spam and 100% as non-spam. Assume the pieces of content are
labeled independently of one another, for every rater. Given that a rater
has labeled four pieces of content as good, what is the probability that this
rater is a diligent rater?

1.14. D.E. Shaw: A couple has two children. You discover that one of
their children is a boy. What is the probability that the second child is also
a boy?

1.15. JP Morgan: A desk has eight drawers. There is a probability of


1/2 that someone placed a letter in one of the desk’s eight drawers and
a probability of 1/2 that this person did not place a letter in any of the
desk’s eight drawers. You open the first 7 drawers and find that they are
all empty. What is the probability that the 8th drawer has a letter in it?

2
1.16. Optiver: Two players are playing in a tennis match, and are at
deuce (that is, they will play back and forth until one person has scored
two more points than the others). The first player has a 60% chance of
winning every point, and the second player has a 40% chance of winning
every point. What is the probability that the first player wins the match?

1.17. Facebook: Say you have a deck of 50 cards made up of cards in 5


different colors, with 10 cards of each color, numbered 1 through 10. What
is the probability that two cards you pick at random do not have the same
color and are also not the same number?

1.18. SIG: Suppose you have ten fair dice. If you randomly throw these
dice simultaneously, what is the probability that the sum of all the top faces
is divisible by 6?

Medium

1.19. Morgan Stanley: A and B play the following game: a number


k from 1-6 is chosen, and A and B will toss a die until the first person
throws a die showing side k, after which that person is awarded $100 and
the game is over. How much is A willing to pay to play first in this game?

1.20. Airbnb: You are given an unfair coin having an unknown bias
towards heads or tails. How can you generate fair odds using this coin?

1.21. SIG: Suppose you are given a white cube that is broken into 3 x 3
x 3 = 27 pieces. However, before the cube was broken, all 6 of its faces
were painted green. You randomly pick a small cube and see that 5 faces
are white. What is the probability that the bottom face is also white?

1.22. Goldman Sachs: Assume you take a stick of length 1 and you break
it uniformly at random into three parts. What is the probability that the
three pieces can be used to form a triangle?

1.23. Lyft: What is the probability that, in a random sequence of H’s and
T ’s, HHT shows up before HT T ?

3
1.24. Uber: A fair coin is tossed twice, and you are asked to decide
whether it is more likely that two heads showed up given that either (a)
at least one toss was heads, or (b) the second toss was a head. Does your
answer change if you are told that the coin is unfair?

1.25. Facebook: Three ants are sitting at the corners of an equilateral


triangle. Each ant randomly picks a direction and begins moving along an
edge of the triangle. What is the probability that none of the ants meet?
What would your answer be if there are, instead, k ants sitting on all corners
of an equilateral polygon?

1.26. Robinhood: A biased coin, with probability p of landing on heads,


is tossed n times. write a recurrence relation for the probability that the
total number of heads after n tosses is even.

1.27. Citadel: Alice and Bob are playing a game together. They play a
series of rounds until one of them wins two more rounds than the other.
Alice wins a round with probability p. What is the probability that Bob
wins the overall series?

1.28. Google: Say you have three draws of a uniformly distributed random
variables between (0, 2). What is the probability that the median of the
three is greater than 1.5?

Hard

1.29. D.E. Shaw: Say you have 150 friends, and 3 of them have phone
numbers that have the four digits with some permutation of the digits 0,
1, 4, and 9. Is this just a chance occurrence Why or why not?

1.30. Spotify: A fair die is rolled n times. What is the probability that
the largest number rolled is r, for each r in 1, ..., 6?

1.31. Goldman Sachs: Say you have a jar initially containing a single
amoeba in it. Once every minute, the amoeba has a 1 in 4 chance of doing
one of four things: 1) dying out, 2) doing nothing, 3) splitting into two
amoebas, or 4) splitting into three amoebas. What is the probability that
there will eventually contain no living amoeba?

4
1.32. Lyft: A fair coin is tossed n times. Given that there were k heads
in n tosses, what is the probability that the first toss was heads?

1.33. Quora: You have N i.i.d. draws of numbers following a normal


distribution with parameters µ and σ. What is the probability that k of
those draws are larger than some value Y ?

1.34. Akuna Capital: You pick three random points on a unit circle and
form a triangle from them What is the probability that the triangle includes
the center of the unit circle?

1.35. Citadel: You have r red balls and w white balls in a bag. You
continue to draw balls from bag until the bag only contains balls of only
one color. What is the probability that you run out of white balls first?

5
Statistics Questions
Easy

2.1. Uber: Explain the Central Limit Theorem. Why it is useful?

2,2. Facebook: How would you explain a confidence interval to a non-


technical audience?

2.3. Twitter: What are some common pitfalls encountered in A/B testing?

2.4. Lyft: Explain both covariance and correlation formulaically, and com-
pare and contrast them.

2.5. Facebook: Say you flip a coin 10 times and observe only one heads.
What would be your null hypothesis and p-value for testing whether the
coin is fair or not?

2.6. Uber: Describe hypothesis testing and p-value in layman’s terms?

2.7. Groupon: Describe what Type I and Type II errors are, and the
tradeoffs between them.

2.8. Microsoft: Explain the statistical background behind power.

2.9. Facebook: What is a Z-test and when would you use it versus a
t-test?

2.10. Amazon: Say you are testing hundreds of hypotheses, each with a
t-test. what considerations would you take into account when doing this?

6
Medium

2.11. Google: How would you derive a confidence interval for the proba-
bility of flipping heads from a series of coin tosses?

2.12. Two Sigma: What is the expected number of coin flips needed to
get two consecutive heads?

2.10. Citadel: What is the expected number of rolls needed to see all 6
sides of a fair die?

2.14. Akuna Capital: Say you’re rolling a fair six-sided dice, What is the
expected number of rolls until you roll two consecutive 5s?

2.15. D.E. Shaw: A coin was flipped 1000 times, and 550 times it showed
heads. Do you think the coin is biased? Why or why not?

2.16. Quora: You are drawing from a normally distributed random variable
X ∼ N (0, 1) once a day. What is the approximate expected number of
days until you get a value greater than 2?

2.17. Akuna Capital: Say you have two random variables X and Y , each
with a standard deviation. What is the variance of aX + bY for constants
a and b?

2.18. Google: Say we have X ∼ U (0, 1) and Y ∼ U (0, 1) and the two
are independent. What is the expected value of the minimum of X and Y ?

2.19. Morgan Stanley: Say you have an unfair coin which lands on heads
60% of the time. How many coin flips are needed to detect that the coin
is unfair?

2.20. Uber: Say you have n numbers 1...n, and you uniformly sample from
this distribution with replacement n times. What is the expected number
of distinct values you would draw?

7
2.21. Goldman Sachs: There are 100 noodles in a bowl. At each step,
you randomly select two noodle ends from the bowl and tie them together.
What is the expectation on the number of loops formed?

2.22. Morgan Stanley: What is the expected value of the max of two
dice rolls?

2.23. Lyft: Derive the mean and variance of the uniform distribution
U (a, b).

2.24. Citadel: How many cards would you expect to draw from a standard
deck before seeing the first ace?

2.25. Spotify: Say you draw n samples from a uniform distribution


U (a, b). What are the MLE estimates of a and b?

Hard

2.26. Google: Assume you are drawing from an infinite set of i.i.d random
variables that are uniformly distributed from (0, 1). You keep drawing as
long as the sequence you are getting is monotonically increasing. What is
the expected length of the sequence you draw?

2.27 Facebook: There are two games involving dice that you can play.
In the first game, You roll two dice at once and receive a dollar amount
equivalent to the product of the rolls. In the second game, you roll one die
and get the dollar amount equivalent to the square of that value. Which
has the higher expected value and why?

2.28. Google: What does it mean for an estimator to be unbiased? What


about consistent? Give examples of an unbiased but not consistent
estimator, and a biased but consistent estimator.

2.29. Netflix: What are M LE and M AP ? What is the difference between


the two?

8
2.30. Uber: Say you are given a random Bernoulli trial generator. How
would you generate values from a standard normal distribution?

2.30. Uber: Say you are given a random Bernoulli trial generator. How
would you generate values from a standard normal distribution?

2.31. Facebook: Derive the expectation for a geometric random variable.

2.32. Goldman Sachs: Say we have a random variable X ∼ D, where D


is an arbitrary distribution. What is the distribution F(X) where F is the
CDF of X?

2.33. Morgan Stanley: Describe what a moment generating function(MGF)


is. Derive the MGF for a normally distributed random variable X.

2.34. Tesla: Say you have N independent and identically distributed


draws of an exponential random variable. What is the best estimator for
the parameter λ?

2.35. Citadel: Assume that logX ∼ N (0, 1). What is the expectation of
X?

2.36. Google: Say you have two distinct subsets of a dataset for which
you know their means and standard deviations. How do you calculate the
blended mean and standard deviation of the total dataset? Can you extend
it to K subsets?

2.37. Two Sigma: Say we have two random variables X and Y . What
does it mean for X and Y to be independent? What about uncorrelated?
Give an example where X and Y are uncorrelated but not independent.

2.38. Citadel: Say we have X ∼ U nif orm(−1, 1) and Y = X 2 . What


is the covariance of X and Y ?

9
2.39. Lyft: How do you uniformly sample points at random from a circle
with radius K?

2.40. Two Sigma: Say you continually sample from some i.i.d. uniformly
distributed (0, 1) random variables until the sum of the variables exceeds
1. How many samples do you expect to make?

10

You might also like