Evals & Observability·Question 31 of 83Intermediate

You want to detect a 3-point improvement in pass rate. How many eval examples do you need, and how do you get that number down?

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

Work backwards from the minimum detectable effect rather than picking a round number like 100 and hoping.

Full worked answer

Work backwards from the minimum detectable effect rather than picking a round number like 100 and hoping.

For two independent proportions at ~80% power and 95% confidence, the required n per arm is approximately 2.5 / delta^2 when the base rate is around 80%. At delta = 0.03 that is roughly 2,800 examples per arm. At 2 points, ~6,300. At 7 points, ~500. This is the uncomfortable arithmetic behind most eval theatre: teams declare victory on 4-point deltas over 100 examples, where the noise floor is around 8 points.

The lever is pairing. You are not running two random groups of users, you are running both variants over the identical examples, so use that. In a paired design only the discordant pairs carry signal: examples where A passed and B failed, or the reverse. Everything both got right or both got wrong contributes nothing. McNemar's test on the discordant counts, or a bootstrap over the per-example paired delta vector, typically cuts the required sample size several-fold, because you have removed example difficulty as a source of variance. The saving depends on how many examples flip: the fewer discordant pairs relative to the net delta, the bigger the win. Detecting a few points of net difference can drop into the hundreds rather than thousands.

import numpy as np

def paired_bootstrap(a, b, n=10_000):
    """a, b: per-example 0/1 outcomes on the SAME examples."""
    d = np.asarray(a, float) - np.asarray(b, float)
    idx = np.random.randint(0, len(d), (n, len(d)))
    boot = d[idx].mean(axis=1)
    return d.mean(), np.percentile(boot, [2.5, 97.5])

Ship when the interval sits entirely on one side of zero.

Going further: follow-up territory

Two caveats. Sampling noise means you should average several runs per example, or the pairing is polluted. And if you peek repeatedly, correct for it, or your 5% false positive rate is not 5%.

What a good answer covers

  • Work backwards from the minimum detectable effect rather than picking a round number like 100 and hoping
  • For two independent proportions at ~80% power and 95% confidence, the required n per arm is…
  • At delta = 0.03 that is roughly 2,800 examples per arm
  • This is the uncomfortable arithmetic behind most eval theatre
  • You are not running two random groups of users, you are running both variants over the identical…

Interviewer follow-ups to expect

  1. Your MDE calculation says you need 2,800 examples and you have 200. What do you actually do?

  2. When is a paired design not available to you?

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