A/B Testing interview question

Data ScienceA/B TestingBias in DataExperiment Designhard

A test ran at 10% treatment on Friday and was ramped to 50% for the weekend. Treatment converts better within each period but worse when the data are pooled (table). What explains this, and what should you report?

PeriodSplit (C / T)Control usersControl conv.Treatment usersTreatment conv.
Friday (ramp)90% / 10%9,00010.0%1,00011.0%
Sat–Sun50% / 50%5,0004.0%5,0004.4%
Pooled–14,0007.9%6,0005.5%
  1. AReport the pooled result, because it uses all 20,000 users while each period is a smaller and noisier subset, so the treatment should be reported as lowering conversion for everyone.
  2. BThis is a sample ratio mismatch, because control has 14,000 users and treatment only 6,000; the randomization failed, so the test must be discarded and rerun at 50/50.
  3. CConversion collapsed on the weekend in both arms, so the effect is seasonal; report the Friday lift only, because it was measured before the weekend drop affected the arms.
  4. DSimpson's paradox: treatment is over-represented in the low-converting weekend, so pooling confounds arm with period; compare within periods or use only the stable 50/50 period.
Show the answer and explanation

Correct answer: D, Simpson's paradox: treatment is over-represented in the low-converting weekend, so pooling confounds arm with period; compare within periods or use only the stable 50/50 period.

Explanation A/B Testing

Simpson's paradox occurs when a comparison reverses after aggregation because a third variable is related both to group membership and to the outcome. Here the third variable is the period:

  • Friday converts at about 10%, the weekend at about 4%.
  • Because of the ramp, 64% of control users (9,000 of 14,000) come from high-converting Friday, while 83% of treatment users (5,000 of 6,000) come from the low-converting weekend.
  • Pooled control = 1,100 / 14,000 ≈ 7.9%, pooled treatment = 330 / 6,000 = 5.5%, even though treatment wins by about 10% relative in each period.

Correct analyses:

  1. Stratify by period (or by allocation phase) and combine the per-period effects with weights, e.g. a Mantel–Haenszel style estimate or a regression with period fixed effects.
  2. Or simply analyse the stable 50/50 period only, which is a common practical recommendation after a ramp.

Why the others fail: pooled data is not better when the mix differs between arms; more data with confounding is still biased. This is not an SRM, because each period matches its own planned split exactly; an SRM check must use the planned ratio per phase. The weekend drop lowers both arms by the same proportion (−60%), so it is not a reason to keep only Friday, which is a single day and only 1,000 treatment users.

Interview tip: ramp-ups, changing allocations and mid-test traffic shifts are a very common source of Simpson's paradox in real A/B tests; say you analyse each allocation phase separately.

Practice it as a quiz

Answer this and the other free questions with instant grading, streaks and weak-topic tracking, or unlock all 4,000 questions.

More Data Science questions

  1. In PostgreSQL, converted is an INTEGER column holding 0 or 1. This daily conversion-rate query shows 0 for almost every day, and 1 only on days where every…
  2. A retailer's marketing mix model (MMM) transforms weekly TV spend with geometric adstock aₜ = xₜ + λ·aₜ₋₁, with λ = 0.6 and a₀ = 0, and then passes the…
  3. A telecom's plan names are s = pd.Series(["Max+ 10GB", "Max 20GB", None, "Mini 5GB"]). What do print(s.str.contains("Max+", na=False).sum()) and…
  4. A retailer exports product reviews to CSV with the columns review_id, product_id, rating, review_text, created_at and loads them into a staging table that…
  5. A loyalty system stores points as pts = np.array([1201, 350, 85], dtype=np.int64). For a 1.5× points campaign, a notebook runs boosted = pts 1.5 and then pts…