Statistical Inference & A/B Testing Fundamentals
Statistics & ExperimentsModel answerLast updated
Answer core statistical questions on the Central Limit Theorem, error types, p-values, and confounding variables in product experimentation.
You are discussing product analytics and experimentation principles in a technical interview. Answer the following four questions clearly and concisely:
Question 1: Central Limit Theorem
Define the Central Limit Theorem (CLT) in your own words. Why is the CLT crucial when evaluating right-skewed metrics like Average Order Value (AOV) in A/B tests?
Question 2: Error Types and Trade-offs
Define Type I error ($\alpha$) and Type II error ($\beta$). Explain their relationship to statistical power and significance levels. What are the practical business risks of committing each type of error when deciding whether to ship a new checkout flow?
Question 3: Misinterpretations of $p$-values
A product manager looks at an experiment result and says: "The $p$-value is 0.02, so there is a 98% chance that our new feature outperforms the baseline." Correct this statement. Furthermore, describe what happens to the $p$-value as the sample size becomes extremely large, even if the underlying physical difference is trivially small.
Question 4: Confounding and Causality
Internal tracking shows that users who create customized profile avatars retain at a 35% higher rate after 90 days than non-avatar users. Can you state that prompting users to build avatars causes higher retention? Identify two potential confounding variables and describe how you would establish a true causal connection.
Hints
Hint 1
Focus on the sampling distribution of the mean, not the distribution of the individual data points.
Hint 2
Remember that p-value is a conditional probability: P(Data | H0), not P(H0 | Data).
Hint 3
To prove causality, think about how to isolate the feature's impact from user self-selection.
Model answer
Easy Try it yourself first — then compare your approach, complexity and edge cases.
Part 1: Central Limit Theorem (CLT)
Definition:
The Central Limit Theorem states that for a set of $n$ independent and identically distributed (i.i.d.) random variables drawn from a distribution with a finite mean $\mu$ and finite variance $\sigma^2$, the distribution of the sample mean $\bar{X}$ approaches a Normal distribution $\mathcal{N}\left(\mu, \frac{\sigma^2}{n}\right)$ as $n \to \infty$, regardless of the underlying population distribution shape.
Relevance to Right-Skewed Metrics (e.g., AOV):
In e-commerce, AOV is typically heavily right-skewed—most orders are small, while a small tail of whale purchases drags the variance up.
- Inference on the Mean: The CLT applies to the sampling distribution of the mean, not the raw data distribution. Even if raw AOV is strongly skewed, the average AOV calculated across tens of thousands of users per variant will be normally distributed.
- Parametric Testing: This normal approximation justifies using standard two-sample $z$-tests or $t$-tests to evaluate the difference between treatment and control means ($\bar{X}_T - \bar{X}C$), letting us construct valid standard error estimates and confidence intervals ($\Delta \pm z{\alpha/2} \cdot \text{SE}$).
Edge Cases & Practical Considerations:
- Extreme Skew & Heavy Tails: Extremely high-value outliers (e.g., fraud or B2B bulk purchases) can inflate $\sigma^2$ and slow down CLT convergence. Analysts typically winsorize (cap) or trim metrics at extreme percentiles (e.g., 99.9th percentile) to reduce variance.
- Clustered Randomization: If randomization happens at the user level but metrics are analyzed per order, orders within the same user are correlated (violating i.i.d.). Robust variance estimation methods like the Delta method or cluster-robust standard errors must be applied.
Part 2: Hypothesis Testing Errors & Trade-offs
Error Matrix
| Decision | $H_0$ is True (No True Effect) | $H_1$ is True (Real Effect Exists) |
|---|---|---|
| Reject $H_0$ | Type I Error ($\alpha$) (False Positive) | Correct Decision (Power $= 1 - \beta$) |
| Fail to Reject $H_0$ | Correct Decision ($1 - \alpha$) | Type II Error ($\beta$) (False Negative) |
- Type I Error ($\alpha$): The probability of mistakenly rejecting the null hypothesis when it is actually true. Setting $\alpha = 0.05$ guarantees a 5% false positive rate under $H_0$.
- Type II Error ($\beta$): The probability of failing to reject the null hypothesis when a true effect exists.
- Statistical Power ($1 - \beta$): The probability of correctly detecting a true effect of a given magnitude.
Trade-offs
Holding sample size $n$ constant, decreasing $\alpha$ (making the test stricter) shifts the critical value threshold further out into the tail, which automatically increases $\beta$ and reduces statistical power. To decrease both error rates simultaneously, you must increase sample size $n$, reduce metric variance $\sigma^2$, or test a larger effect size.
Business Risks in Checkout Funnel Iterations
- Cost of Type I Error (False Positive): Shipping a non-beneficial change to the checkout flow causes immediate engineering debt and risk. At scale, an undetected negative side effect (e.g., broken payment method for a sub-segment) causes direct revenue loss. Additionally, false positives corrupt product learning history.
- Cost of Type II Error (False Negative): Rejecting a feature that actually increases conversion means forfeiting incremental revenue indefinitely. This loss is often invisible because rejected feature branches are rarely re-tested.
Part 3: Interpreting $p$-values & Sample Size
Correcting the Misinterpretation
The PM's statement is incorrect. A $p$-value is defined as:
$$p = P(\text{Data at least as extreme as observed} \mid H_0 \text{ is true})$$
It measures the probability of obtaining test results at least as extreme as the observed data, assuming the null hypothesis is true.
- It is not $P(H_0 \text{ is true} \mid \text{Data})$, nor is $1 - p$ the probability that the new feature is superior.
- Calculating $P(\text{Treatment is better} \mid \text{Data})$ requires a Bayesian framework with an explicit prior belief about feature success rates ($P(H_1)$). If most feature ideas fail (low prior), a $p = 0.02$ result can still carry a high False Discovery Rate.
Behavior Under Arbitrarily Large Sample Sizes
The test statistic for a difference in means is:
$$z = \frac{\hat{\Delta}}{\sqrt{\frac{\sigma_T^2}{n_T} + \frac{\sigma_C^2}{n_C}}}$$
As sample size $n \to \infty$, the standard error denominator approaches $0$. Consequently, for any non-zero true difference $\Delta \neq 0$ (even if it is an economically meaningless $0.0001%$ lift), $z \to \infty$ and $p \to 0$.
Solution: Always evaluate practical significance alongside statistical significance by reporting point estimates and 95% confidence intervals ($\hat{\Delta} \pm \text{CI}$). Establish a Minimum Detectable Effect (MDE) prior to running the test, and assess whether the confidence interval bounds fall within clinically or commercially relevant thresholds.
Part 4: Confounding and Causality
Flaw in Causal Reasoning
No, you cannot conclude that prompting avatar creation causes increased retention. This is an observational association subject to selection bias: users who proactively create avatars are intrinsically more engaged with the product from day one.
Two Plausible Confounders
- User Intent / Tech-Savviness: Highly active, tech-savvy users naturally explore deeper application features (like profile customization) and inherently exhibit higher retention regardless of the avatar feature.
- User Tenure & Onboarding Progress: Users who stay active past day 7 are more likely to encounter the avatar setup prompt. Here, retention or early usage velocity acts as a confounder driving both avatar completion and long-term retention.
Establishing Causality
To establish a true causal link:
- Randomized Controlled Trial (A/B Test):
- Mechanism: Randomize incoming users at registration into Treatment (receives a prominent modal or incentive to create an avatar) and Control (standard onboarding without the prompt).
- Analysis: Compare the overall retention rates between Treatment and Control groups. This measures the Intent-To-Treat (ITT) effect of the prompt intervention.
- Instrumental Variables / CACE (If measuring the effect of actual creation):
- If you specifically need the causal effect of having an avatar (rather than being prompted), use the randomized prompt assignment as an Instrumental Variable (IV) to estimate the Complier Average Causal Effect (CACE) via Two-Stage Least Squares (2SLS).
- Observational Counterfactuals (If an A/B test is impossible):
- Apply Difference-in-Differences (DiD) around the date a user built their avatar, or use Propensity Score Matching (PSM) paired with Synthetic Control methods matching on pre-treatment engagement, acquisition channel, and user demographics.