Sequential Probability Ratio Test for a Messenger Canary Release

Last updated: November 29, 2026

Quick Overview

A Messenger build ships to a canary population, and you want to stop as soon as the evidence shows its crash rate is either the healthy 0.1% per session or a bad 0.2%. Design a Wald sequential probability ratio test with a 1% false alarm rate and 95% power, and compare its average sample size with a fixed-sample test.

Meta
Statistics & Math
Software Engineer
Meta
November 29, 2026
Software Engineer
Onsite
Statistics & Math
Hard

0

0

0 solved


A Messenger build ships to a canary population, and you want to stop as soon as the evidence shows its crash rate is either the healthy 0.1% per session or a bad 0.2%. Design a Wald sequential probability ratio test with a 1% false alarm rate and 95% power, and compare its average sample size with a fixed-sample test.

Meta release engineering gates mobile builds on canary health, where stopping early saves both users and time. This onsite question checks the SPRT construction, its error guarantees, the expected sample size, and the practical caveats of sequential monitoring.

What the Interviewer Expects
  • Set simple hypotheses p0 and p1 and the per-session log-likelihood ratio
  • Derive Wald's boundaries from alpha and beta
  • Estimate the expected sample size under each hypothesis
  • Compare with the fixed-sample size for the same errors
  • Discuss composite hypotheses, delays and correlated sessions
Key Topics to Cover
sequential testing
SPRT
likelihood ratio
average sample number
release gating
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 happens to the SPRT if the true rate is 0.15%, between the two hypotheses?
  • How would you add a maximum sample size so the test cannot run forever?
  • How do you handle crashes reported hours after the session?
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
  • Each canary session is Bernoulli: crash with probability pp.
  • H0:p=p0=0.001H_0: p = p_0 = 0.001 (healthy). H1:p=p1=0.002H_1: p = p_1 = 0.002 (bad build).
  • Targets: α=P(declare bad∣H0)=0.01\alpha = P(\text{declare bad} \mid H_0) = 0.01, $\b...
Approach

Track the cumulative log-likelihood ratio Λn=∑i=1n[xiln⁡p1p0+(1−xi)ln⁡1−p11−p0].\Lambda_n = \sum_{i=1}^n \left[x_i \ln\frac{p_1}{p_0} + (1 - x_i)\ln\frac{1-p_1}{1-p_0}\right]. Each crash adds ln⁡2=0.693\ln 2 = 0.693; each clean session adds $...


Submit Your Answer
Markdown supported