← Microsoft Interview Insights

Microsoft·Data Scientist·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Apr 2026

Summary

Got a probability question at Microsoft that looked straightforward but required you to actually know Bayes' theorem cold. Not a coding round, felt more like a stats/analytical screen.

Questions Asked (1)

Q1

Two machines produce light bulbs: Machine A makes 60% of total output with a 5% defect rate, Machine B makes the rest with a 3% defect rate. A randomly chosen bulb turns out to be defective. What's the probability it came from Machine A?

Product Analytics & MetricsAlgorithms & Data Structures
Author's notes

I knew this was a conditional probability setup but blanked on the exact formula for a second.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Recognize this as a classic Bayes' theorem problem and set up the calculation using the law of total probability. Clearly define the events and compute the posterior probability P(A|D) = P(D|A)P(A) / [P(D|A)P(A) + P(D|B)P(B)]. Walk through the arithmetic step-by-step to show your reasoning.

Pro tip: After computing the exact probability, mention that the result makes intuitive sense: even though Machine A has a higher defect rate, its larger production share pulls the posterior probability above 50%. This demonstrates you can sanity-check your answer.

1. Define the events and given probabilities

Let A be the event that a bulb is from Machine A, B from Machine B, and D that it is defective. Write down P(A)=0.6, P(B)=0.4, P(D|A)=0.05, P(D|B)=0.03.

2. Compute the total probability of a defective bulb

Use the law of total probability: P(D) = P(D|A)P(A) + P(D|B)P(B) = 0.05*0.6 + 0.03*0.4 = 0.03 + 0.012 = 0.042.

3. Apply Bayes' theorem to find the posterior probability

Compute P(A|D) = P(D|A)P(A) / P(D) = 0.03 / 0.042 ≈ 0.7143 or 71.43%.

4. Interpret the result and check for reasonableness

Explain that there is about a 71.4% chance the defective bulb came from Machine A. Note that this is higher than the prior 60% because Machine A has a higher defect rate.

Key Points to Mention

  • Bayes' theorem and its application to conditional probability
  • Law of total probability to compute the marginal probability of a defective bulb
  • Correctly identifying the prior probabilities (60% and 40%) and likelihoods (5% and 3%)
  • The calculation steps: P(D) = 0.042, P(A|D) = 0.03/0.042 ≈ 0.714
  • Interpretation of the result in the context of the problem
  • Sanity check: posterior probability should be between the prior and 1, and higher than prior due to higher defect rate

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.