KatInterview

Calculate minimum sample size for a checkout button A/B test

Statistics & ExperimentsModel answer
EasyModel answerStatistics & Experimentsstatisticsa/b testingsample size

Last updated

Given a baseline conversion rate and a target minimum detectable effect, compute the required per-variant sample size from first principles.

Scenario

You are a data scientist at an e-commerce company. The product team wants to test a redesigned checkout button (variant B) against the current one (variant A). Before running the experiment, your engineering lead asks you to justify how many users each variant needs.

Known facts:

  • Current (baseline) checkout conversion rate: 5%
  • Minimum detectable effect (MDE): you want to detect an absolute lift of 1 percentage point (i.e., variant B converts at 6% or worse is considered "no meaningful improvement")
  • Significance level: α = 0.05 (two-tailed)
  • Desired statistical power: 80% (β = 0.20)

What is expected

  1. State the formula for minimum per-variant sample size and explain where each term comes from.
  2. Plug in the numbers and compute (or closely estimate) the required sample size per variant.
  3. Interpret the result and flag at least two practical considerations the team should keep in mind when planning the test.

You may use the standard normal approximation. Show your reasoning step by step.

Hints

Hint 1

The formula relies on z-scores for α and β. For a two-tailed test at α=0.05, z_{α/2} ≈ 1.96; for 80% power, z_β ≈ 0.84. Write these down first before substituting anything.

Hint 2

The variance of a proportion p is p(1−p). You need to account for the variance under *both* the null (p_A) and the alternative (p_B) hypotheses—don't just use one of them.

Hint 3

After you get a raw number, sanity-check it: does a larger MDE require more or fewer users? Does a lower baseline variance (p closer to 0 or 1) require more or fewer users? Use these checks to verify your answer makes intuitive sense.