KatInterview

Size a Two-Stage Funnel A/B Test on Checkout Flow

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

Last updated

Calculate the required sample size for an A/B test when the primary metric is a rare downstream conversion event in a multi-step funnel.

Scenario

You are a data scientist at an e-commerce company. The product team wants to test a redesigned checkout flow (variant B) against the current flow (variant A).

The funnel has two stages:

  1. Add-to-cart → Checkout page (most users reach this)
  2. Checkout page → Purchase completed (the rare, high-value event)

The primary success metric is purchase conversion rate (purchases / unique visitors entering the checkout flow).

Known baseline figures (from the last 90 days)

MetricValue
Daily unique visitors entering checkout~50,000
Baseline purchase conversion rate3.2%
Average revenue per converted user$85

Test parameters requested by the team

  • Detect a minimum absolute lift of 0.4 percentage points (i.e., 3.2% → 3.6%)
  • Two-sided test
  • Significance level α = 0.05
  • Statistical power 1 − β = 0.80

What is expected of you

  1. Calculate the required sample size per variant using the standard formula for comparing two proportions.
  2. Determine how many days the experiment must run (50/50 traffic split).
  3. Identify at least two practical risks or corrections that should be considered before finalising the design (e.g., multiple comparisons, novelty effect, variance inflation).
  4. State a brief business sanity check: is the potential revenue uplift large enough to justify the experiment duration?

Hints

Hint 1

Start from the standard two-proportion z-test sample size formula: n = (z_α/2 + z_β)² × [p₁(1−p₁) + p₂(1−p₂)] / (p₁−p₂)². Plug in the z-scores for α=0.05 two-sided and 80% power.

Hint 2

After computing n per variant, divide total daily visitors by 2 (50/50 split) to get daily visitors per variant, then compute ceiling(n / visitors_per_variant) for experiment duration.

Hint 3

Think about what can go wrong: low event rate means high variance, novelty effects inflate early results, and if the team also tracks secondary metrics there is a multiple comparisons problem.