ML & Deep Learning Foundations·Question 32 of 55Intermediate

You're running an A/B test on a new model. Walk me through designing it, and tell me what you'd refuse to do once it's live.

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Fix the metric, the minimum detectable effect and the sample size before launch, then do not peek without correcting for it.

Full worked answer with diagram

Fix the metric, the minimum detectable effect and the sample size before launch, then do not peek without correcting for it.

Sizing. Sample size per arm scales roughly as n ∝ σ²/Δ², so halving the effect you want to detect quadruples the traffic. That means the first question is not "how long do we run" but "what lift is worth shipping." Defaults of α = 0.05 and 80% power mean a one-in-five chance of missing a real effect, which is fine for a cheap change and negligent for a big bet.

Peeking. Fixed-horizon tests assume one look at a predetermined n. Checking daily and stopping the moment p < 0.05 inflates the false positive rate well above nominal α. Acceptable fixes: a pre-registered fixed horizon, group sequential boundaries (O'Brien-Fleming style), or always-valid sequential p-values if the team insists on a live dashboard. What I refuse is stopping early on an uncorrected test, which is how most "wins" that fail to replicate get born.

Variance reduction. CUPED regresses out a pre-experiment covariate, typically the same user's pre-period metric. When the metric is autocorrelated it cuts variance substantially and shortens the test. Cheaper than buying traffic.

Going further: follow-up territory

Traps I would raise unprompted:

  • Sample ratio mismatch. First thing I check. If the split is not what you configured, assignment is broken and every downstream number is suspect.
  • Randomization unit vs analysis unit. Randomize by user, analyse by session, and the iid assumption breaks; your p-values are too small. Use the delta method or a cluster bootstrap for ratio metrics.
  • Interference. In marketplaces or social graphs the control is contaminated by treatment. Switchback or cluster randomization.
  • Novelty and primacy. Week one is not steady state.

For an LLM feature specifically, per-request cost is a co-primary metric, not a footnote. A 1% quality win that doubles token spend is not a win, and the offline eval is only a proxy for the online metric anyway.

Worth sketching. Putting the peeking decision on the diagram forces the conversation you actually need to have with the team before launch, not after.

flowchart TD
    A["Fix metric, minimum detectable<br/>effect, alpha and power"] --> B["Compute n per arm"]
    B --> C["Launch, check<br/>sample ratio match"]
    C -->|"ratio off"| D["Assignment is broken:<br/>stop, nothing downstream is real"]
    C -->|"ratio fine"| E["Run to the<br/>pre-registered horizon"]
    E --> F{"Team wants a<br/>live dashboard?"}
    F -->|"yes"| G["Group sequential bounds or<br/>always-valid sequential p-values"]
    F -->|"no"| H["Single read-out"]
    G --> H

What a good answer covers

  • Fix the metric, the minimum detectable effect and the sample size before launch, then do not peek…
  • Sample size per arm scales roughly as n ∝ σ²/Δ², so halving the effect you want to detect quadruples the…
  • That means the first question is not "how long do we run" but "what lift is worth shipping." Defaults of…
  • Fixed-horizon tests assume one look at a predetermined n
  • Checking daily and stopping the moment p < 0.05 inflates the false positive rate well above nominal α

Key terms: Sizing · Peeking · Variance reduction

Interviewer follow-ups to expect

  1. Your metric is revenue per user, which is heavy-tailed and mostly zero. What does that do to your sample size and what would you do about it?

  2. How would you detect a novelty effect rather than assume one?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep