KatInterview

Planning Runtime and Stopping Rules for a Delivery Add-On Test

Statistics & ExperimentsModel answer
HardModel answerStatistics & Experimentspower-analysissample-sizedesign-effect

Last updated

Size an A/B test on a 22% conversion metric with household clustering, plan weekly sequential looks, and estimate how variance reduction shortens the run.

You are planning an A/B test on the same-day delivery add-on rate, the share of checkouts where the customer selects same-day delivery.

Givens

  • Baseline rate: 22%.
  • Minimum detectable effect: a 5% relative lift.
  • Two-sided α = 0.05, power = 80%.
  • Traffic: assume 120k checkouts per day, of which 20% are eligible for the feature. Volume differs by weekday and spikes sharply on Sundays.
  • Randomization is by household, and checkouts within a household have an intra-household correlation of 0.10.

Tasks

  1. Sample size and duration. Compute the required sample size per arm. Adjust it for household clustering (design effect). Convert it to calendar time, taking the weekly cycle into account. State any assumptions you need, such as the share of eligible traffic given to the test.
  2. Safe monitoring. Design a plan that lets stakeholders check results before the end without inflating the false-positive rate. Explain how it changes the expected duration if the feature truly works.
  3. Volatile Sundays. Suppose the metric is especially noisy on Sundays in one large metro market. Propose stratified randomization and/or CUPED. Estimate the variance reduction you would expect and how it affects the run length.

Hints

Hint 1

Use the two-proportion formula with the variance of each arm: n = (z_α/2 + z_β)² · [p1(1−p1) + p2(1−p2)] / δ². Then multiply by the design effect 1 + (m−1)ρ.

Hint 2

Convert to time using weekly totals, not daily averages, and always round up to whole weeks so every weekday appears equally in both arms. Consider that the test will probably get only a slice of eligible traffic.

Hint 3

For peeking, use weekly looks with an alpha-spending function (O'Brien-Fleming style). For variance reduction, remember that CUPED shrinks variance by (1 − r²), where r is the correlation between the pre-period covariate and the outcome. Required sample size scales with variance.