Interview concept

Variance Estimation for Ratio Metrics

Asked of: Data Scientist

Last updated

Flowchart showing per-user numerator/denominator → aggregate by randomization unit → ratio-of-sums → branches to Delta method, Fieller intervals, Bootstrap → CI & hypothesis tests, with guardrails/pitfalls noted.
  1. What it is Variance estimation for metrics that are ratios of two aggregates, like clicks/impressions (CTR), revenue/users (ARPU), or watch time/sessions. It quantifies uncertainty for these ratios so you can form confidence intervals and hypothesis tests, typically using the delta method, Fieller intervals, or bootstrap.

  2. Why interviewers ask about it Product teams rely on ratio metrics daily, and naïve variance formulas can flip a launch decision. Employers like Meta expect you to know when delta is safe, when Fieller or bootstrap is needed, and how to do this at the randomization unit with correlated numerator/denominator data.

  3. Core ideas to know

  • Estimate at the randomization unit using ratio-of-sums, not mean of per-user ratios.
  • Delta method: Var(Y/X) needs Var(Y), Var(X), and Cov(Y, X); covariance matters.
  • For A/B, difference of ratios uses a multivariate delta across groups; arms are independent.
  • Fieller’s theorem gives exact CIs for a ratio; intervals can be unbounded if denominators near zero.
  • Bootstrap works broadly but can be slow; heavy tails may require winsorization or robust bootstrap.
  • Log-scale percent change: delta on log(Y/X) yields near-symmetric intervals and easy interpretation.
  • Guardrails: diagnose sample-ratio mismatch (SRM) and cluster correlation before trusting intervals.
  1. A common pitfall Candidates average per-user rates and compute a standard error on that mean, ignoring that users with larger denominators should carry more weight. Others drop the covariance term and treat numerator and denominator as independent, underestimating uncertainty. Two-proportion z-tests are misapplied when denominators vary across users or sessions. Finally, failing to notice near-zero denominators can produce nonsensical (even unbounded) confidence intervals.

  2. Further reading

Related concepts

Variance Estimation for Ratio Metrics — Tech Interview Concept | PracHub