Interview concept

Bayesian Reasoning and Base Rates

Asked of: Data Scientist

Last updated

Natural-frequency tree for Bayes rule: 1000 people split to Sick (1) and Healthy (999), test positives/negatives with numbers, showing P(sick | positive) ≈ 9% highlighted in emerald green.
  1. What it is Bayesian reasoning updates a belief after seeing evidence: posterior ∝ prior (the base rate) × likelihood (how consistent the evidence is with each hypothesis). Base rates are the background prevalences you must factor in, e.g., disease prevalence or fraud frequency, before interpreting a test or model score.

  2. Why interviewers ask about it Data Scientists routinely interpret A/B tests, classification scores, and alerting systems where rare events dominate (spam, fraud, safety violations). Teams at companies like Meta, Netflix, and Uber expect you to reason about priors, uncertainty, and decision thresholds so product calls are calibrated, not just “statistically significant.”

  3. Core ideas to know

  • Posterior ∝ likelihood × prior; base rates are the priors. High accuracy can still mislead when prevalence is tiny.
  • Use natural frequencies (“1 in 1000” style) to compute posteriors reliably and avoid base‑rate neglect.
  • Positive predictive value depends on both sensitivity/specificity and prevalence; report it alongside recall/precision.
  • In A/B tests, ask “P(B is better by ≥ X)” and show credible intervals, not just p-values.
  • Check robustness to priors; perform sensitivity analyses and justify any informative prior.
  • For rare classes, set thresholds via expected loss/cost and business priors, not default 0.5 cutoffs.
  • Hierarchical Bayes borrows strength across segments, stabilizing metrics for low-traffic cohorts.
  1. A common pitfall Candidates treat an impressive model metric or a “significant” experiment as decisive without considering how rare the underlying event or true lift is. With low base rates, even tiny false-positive rates can swamp true positives, leading to overreacting to noise (e.g., fraud bans, safety takedowns, or premature experiment stops). Another frequent miss is ignoring prior evidence (historical tests, seasonality) when choosing priors, producing unstable conclusions that flip with small data shifts. Interviewers probe for this by giving mammography- or fraud-style puzzles and watching if you translate to frequencies and integrate prevalence.

  2. Further reading

Related concepts

Bayesian Reasoning and Base Rates — Tech Interview Concept | PracHub