# rfxlab/120-Data-Science-Interview-Questions forked from kojino/120-Data-Science-Interview-Questions

Fetching contributors…
Cannot retrieve contributors at this time
45 lines (41 sloc) 4.69 KB

## Probability (19 questions)

#### 1. Bobo the amoeba has a 25%, 25%, and 50% chance of producing 0, 1, or 2 o spring, respectively. Each of Bobo’s descendants also have the same probabilities. What is the probability that Bobo’s lineage dies out?

• p=1/4+1/4p+1/2p^2 => p=1/2

#### 2. In any 15-minute interval, there is a 20% probability that you will see at least one shooting star. What is the proba- bility that you see at least one shooting star in the period of an hour?

• 1-(0.8)^4. Or, we can use Poisson processes

#### 4. How can you get a fair coin toss if someone hands you a coin that is weighted to come up heads more often than tails?

• Flip twice and if HT then H, TH then T.

#### 5. You have an 50-50 mixture of two normal distributions with the same standard deviation. How far apart do the means need to be in order for this distribution to be bimodal?

• more than two standard deviations

#### 6. Given draws from a normal distribution with known parameters, how can you simulate draws from a uniform distribution?

• plug in the value to the CDF of the same random variable

• 1/3

#### 8. You have a group of couples that decide to have children until they have their first girl, after which they stop having children. What is the expected gender ratio of the children that are born? What is the expected number of children each couple will have?

• gender ratio is 1:1. Expected number of children is 2. let X be the number of children until getting a female (happens with prob 1/2). this follows a geometric distribution with probability 1/2

#### 9. How many ways can you split 12 people into 3 teams of 4?

• the outcome follows a multinomial distribution with n=12 and k=3. but the classes are indistinguishable

#### 10. Your hash function assigns each object to a number between 1:10, each with equal probability. With 10 objects, what is the probability of a hash collision? What is the expected number of hash collisions? What is the expected number of hashes that are unused.

• the probability of a hash collision: 1-(10!/10^10)
• the expected number of hash collisions: 1-10*(9/10)^10
• the expected number of hashes that are unused: 10*(9/10)^10

#### 11. You call 2 UberX’s and 3 Lyfts. If the time that each takes to reach you is IID, what is the probability that all the Lyfts arrive first? What is the probability that all the UberX’s arrive first?

• Lyfts arrive first: 2!*3!/5!
• Ubers arrive first: same

#### 12. I write a program should print out all the numbers from 1 to 300, but prints out Fizz instead if the number is divisible by 3, Buzz instead if the number is divisible by 5, and FizzBuzz if the number is divisible by 3 and 5. What is the total number of numbers that is either Fizzed, Buzzed, or FizzBuzzed?

• 100+60-20=140

#### 13. On a dating site, users can select 5 out of 24 adjectives to describe themselves. A match is declared between two users if they match on at least 4 adjectives. If Alice and Bob randomly pick adjectives, what is the probability that they form a match?

• 24C5*(1+5(24-5))/24C5*24C5 = 4/1771

• 1

#### 15. Let’s say you have a very tall father. On average, what would you expect the height of his son to be? Taller, equal, or shorter? What if you had a very short father?

• Shorter. Regression to the mean

• less than \$3

• 4/13