10 Toughest Google Interview Questions and Answers

Page 8 of 10

3. A Coin was Flipped 1,000 times, Returning 560 Heads. Do You Believe the Coin is Fair?

Quantitative Analyst

Questions like these test the candidates’ knowledge of probability. To determine whether the coin is biased, we can use hypothesis testing. The null hypothesis in this case is that the coin is unbiased, meaning it has an equal probability of landing heads or tails. The alternative hypothesis is that the coin is biased, meaning it has a different probability of landing heads or tails.

To test the hypothesis, we can use a significance level of 0.05, which is a commonly used threshold for statistical significance. We can use a one-tailed test since we are only interested in whether the coin is biased towards heads.

Using a binomial test, we can calculate the probability of getting 560 or more heads out of 1,000 flips if the coin is unbiased. With an unbiased coin, the probability of getting heads on any given flip is 0.5. Using the binomial distribution formula, we get:

P(X >= 560) = 1 – P(X < 560) = 1 – binom.dist(559, 1000, 0.5, true) = 0.0363

This means that if the coin is unbiased, the probability of getting 560 or more heads out of 1,000 flips is only 0.0363, or 3.63%. This is less than our significance level of 0.05, which suggests that the result is statistically significant. Therefore, we reject the null hypothesis that the coin is unbiased and conclude that there is evidence to support the alternative hypothesis that the coin is biased towards heads.

Page 8 of 10