Probability a Flagged Email Is Actually Spam Under Low Base Rates

Last updated: November 29, 2026

Quick Overview

A spam filter catches 95% of spam and wrongly flags 2% of legitimate email. If 10% of a user's mail is spam, what is the probability a flagged email is spam? What happens for a business inbox where only 1% is spam?

Google
Statistics & Math
Data Scientist
Google
November 29, 2026
Data Scientist
Phone Screen
Statistics & Math
Easy

0

0

0 solved


A spam filter catches 95% of spam and wrongly flags 2% of legitimate email. If 10% of a user's mail is spam, what is the probability a flagged email is spam? What happens for a business inbox where only 1% is spam?

Bayes' rule with base rates is a staple of Google data science phone screens, framed here around Gmail. The interviewer checks the calculation and, more importantly, whether you can explain why precision collapses at low prevalence.

What the Interviewer Expects
  • Set up Bayes' rule with prior, sensitivity, and false positive rate
  • Compute the posterior correctly for both base rates
  • Explain the base-rate effect in plain language
  • Connect to precision and the need for per-segment thresholds
Key Topics to Cover
Bayes' theorem
Base rates
Precision
Conditional probability
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
  • What false positive rate would be needed for 90% precision at 1% prevalence?
  • How would you estimate the base rate per inbox?
  • How does this connect to the precision-recall curve?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Browse Statistics Questions
Sample Answer
Clarify

Let SS be spam and FF flagged. Given P(F∣S)=0.95P(F|S) = 0.95 (recall), P(F∣¬S)=0.02P(F|\neg S) = 0.02 (false positive rate), and prior P(S)P(S) of 0.10 or 0.01. We want P(S∣F)P(S|F), which is the filter's precision for tha...

Approach

Apply Bayes: P(S∣F)=P(F∣S)P(S)P(F∣S)P(S)+P(F∣¬S)P(¬S)P(S|F) = \frac{P(F|S)P(S)}{P(F|S)P(S) + P(F|\neg S)P(\neg S)}....


Submit Your Answer
Markdown supported