Plan, Run and Read Out a Product Experiment From Scratch
Statistics & ExperimentsModel answerLast updated
Describe how you would take a product change from hypothesis to launch decision using a randomized controlled experiment, covering metrics, power, validity checks, analysis and pitfalls.
A product team wants to ship a change to an existing feature and asks you to evaluate it with a randomized controlled experiment. Describe the full lifecycle, from the initial idea to the final ship or no-ship call.
Use a concrete example of your choice (for instance, a new recommendations module on an e-commerce item page) and cover the following:
- Hypothesis and metrics. How you state the hypothesis, and how you choose a primary metric, diagnostic metrics and guardrail metrics.
- Design. The randomization unit, who is eligible, how you define "exposed", how long you run, and how you handle novelty effects and seasonality.
- Sizing. How you decide on the minimum detectable effect, the sample size and the power. Show a rough calculation.
- Validity checks. How you confirm that randomization and logging worked before reading any results (for example, sample ratio mismatch).
- Analysis. Confidence intervals and p-values, test choice, multiple comparisons, and the problem of repeatedly checking results while the test runs.
- Decision. How you weigh statistical against practical significance and arrive at a launch decision.
- Pitfalls. Interference or network effects, noncompliance, and missing data.
Aim for a structured answer, as if you were talking an interviewer through your process in a few minutes.
Hints
Hint 1
Start with a falsifiable hypothesis that names a mechanism and an expected direction, then assign each metric a role: one decision metric, several explanatory ones, and several that must not get worse.
Hint 2
Match the randomization unit to the analysis unit, and only count users who actually reach the point where the change would appear (with the same logging applied to control). Run whole weeks so day-of-week patterns are balanced.
Hint 3
Check validity before looking at effects: compare arm sizes against the intended split with a chi-square test, verify pre-period balance, and confirm logging is equally complete in both arms.
Hint 4
For the decision, compare the confidence interval to a pre-agreed practical threshold rather than just checking p < 0.05, and fix your stopping rule up front or use a sequential method.
Model answer
Easy Try it yourself first — then compare your approach, complexity and edge cases.
Running example
Suppose we add a "Frequently bought together" module to an item detail page. The same structure applies to almost any product change.
1. Hypothesis and metrics
Hypothesis: Showing complementary items increases the chance a visitor adds a second item, which raises revenue per visitor (RPV) without reducing purchases of the main item.
A good hypothesis states a mechanism and a direction, and is decided before launch.
| Role | Purpose | Examples |
|---|---|---|
| Primary (decision) metric | The one number that decides the launch; sensitive and tied to long-term value | RPV or orders per visitor |
| Diagnostic | Explains why the primary moved and confirms the mechanism | Module click-through, items per cart, add-to-cart of recommended items |
| Guardrail | Must not get worse | Main-item conversion, p95 latency, error rate, returns, support contacts |
Also keep trust guardrails (arm-size ratio, logging completeness) that say whether the experiment is valid at all.
2. Design
- Randomization unit: the user (logged-in ID or a stable cookie), not the session or page view. Per-session assignment lets one person see both variants and contaminates the comparison. Keep the analysis unit equal to the randomization unit; if you report a ratio metric (such as per-page-view), use the delta method or a bootstrap for the variance.
- Population: users who can see the change (supported platforms, relevant page). Exclude bots and internal traffic.
- Exposure / triggering: count a user only once they reach a page where the module would render. In control, log a counterfactual exposure at the same point. This removes unaffected users, cutting dilution and variance.
- Duration: at least one to two full weekly cycles even if the sample size is reached sooner. Avoid atypical periods (big sales) unless they are the target.
- Novelty/primacy: plot the effect by day and by days since first exposure. A decaying lift suggests novelty. Mitigate by running longer, looking at new users separately, and keeping a long-term holdout after launch.
3. Sample size, MDE and power
Pick the MDE first: the smallest effect that justifies the engineering and maintenance cost. For a two-sided test with equal arms:
n per arm = 2 (z_{1-α/2} + z_{1-β})² σ² / δ²
Example: baseline conversion 5%, relative MDE 2% so δ = 0.001, α = 0.05, power 80% so (1.96 + 0.84)² ≈ 7.84, σ² = 0.05 × 0.95 = 0.0475.
n ≈ 2 × 7.84 × 0.0475 / 0.001² ≈ 745,000 users per arm.
Divide by daily eligible traffic and round up to whole weeks. If that is too long:
- Accept a larger MDE.
- Reduce variance: CUPED (adjust with the user's pre-period metric, often 30-50% variance reduction), triggering, and winsorizing heavy-tailed revenue.
- For revenue, estimate σ from historical data; do not use a binomial variance.
4. Validity checks (before looking at effects)
- Sample ratio mismatch (SRM): chi-square test of observed arm counts against the designed split; alarm at p < 0.001. A 50.6/49.4 split on 1.5M users is a clear SRM. Typical causes: bot filtering that interacts with treatment, crashes or redirects in one arm, exposure logging firing in only one arm, caching. With an SRM, do not trust any metric until the cause is found.
- Pre-period balance and A/A tests: arms should look the same before treatment. In repeated A/A tests, about 5% should be significant at α = 0.05; a much higher rate means variance is understated.
- Logging: similar event counts per user where expected, healthy join rate between exposure and outcome logs, no differential missingness, no duplicates, sane timestamps.
- Assignment consistency: a user stays in one arm across sessions and devices.
5. Analysis
- Report the effect with a confidence interval, e.g. "+1.8% RPV, 95% CI [+0.4%, +3.2%]", not only a p-value.
- Test choice: two-proportion z-test for rates; Welch's t-test for means (fine at large n by the CLT); delta method or bootstrap for ratios; CUPED-adjusted estimator if CUPED was planned.
- Multiple testing: pre-register one primary metric at α = 0.05. For many diagnostics or segments, control the false discovery rate (Benjamini-Hochberg); for multiple treatment arms, use Bonferroni or Holm. Treat segment findings as hypotheses for follow-up tests.
- Peeking: stopping at the first p < 0.05 in a fixed-horizon test inflates false positives well beyond 5%. Either commit to a fixed end date or use a sequential method (group sequential with O'Brien-Fleming boundaries, or always-valid p-values such as mSPRT). Stopping early for harm on guardrails is fine.
6. Decision
- Trust check: no SRM, clean logging. Otherwise debug and rerun.
- Primary metric: statistically and practically significant? Compare the CI with the pre-agreed threshold (often the MDE). CI entirely above it: strong case to ship. CI straddling it: ambiguous, so add power or make a judgment call. CI containing zero: no detectable effect, which is not proof of no effect; state the range of effects you can rule out.
- Guardrails: no meaningful regression (check CIs here too, not just point estimates).
- Cost and trade-offs: latency, complexity, and long-term effects. A tiny but real lift may not justify the cost.
- Rollout: ramp gradually and keep a holdout to confirm the effect persists.
7. Common pitfalls
- Interference / network effects: in marketplaces and social products, treated users affect control users (shared inventory, social sharing), biasing the estimate. Use cluster, geo or time-based randomization, or switchback designs.
- Noncompliance: assigned users who never see the change. Analyze by assignment (intent-to-treat) for an unbiased effect of the policy; use instrumental-variable or complier analysis to estimate the effect on those exposed.
- Missing data: attrition or logging loss that differs by arm creates bias. Check missingness by arm and do not silently drop users.
- Other mistakes: changing the metric after seeing results, ignoring SRM, randomizing on one unit but analyzing on another, declaring "no effect" from an underpowered test, and over-reading subgroup results.
Summary line for the interviewer
"I would define the hypothesis and metrics up front, randomize at the user level with triggered exposure, size the test from the MDE, verify SRM and logging before touching results, analyze with confidence intervals under a fixed or sequential stopping rule, and decide by comparing the interval to a practical threshold while watching guardrails."