← Amazon Interview Insights

Amazon·Data Scientist·Technical Phone Screen·Senior

SeniorPrefer not to say
May 2026Remote

Summary

Amazon data scientist interview that went deep into stats and experiment design. Four connected sub-problems built on each other, which I didn't expect, and the clustering question at the end nearly broke me.

Questions Asked (4)

Q1

Given a baseline conversion rate estimated from 100,000 users, compute a 95% Wald confidence interval and then a Wilson or Agresti-Coull interval. Why might the latter two be preferable?

A/B Testing & ExperimentationProduct Analytics & Metrics
Author's notes

I knew the Wald formula cold but fumbled the explanation of why it breaks down near the boundaries.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the baseline conversion rate and sample size (100,000 users). Then, compute the Wald interval using the standard formula and the Wilson or Agresti-Coull interval using their respective formulas. Finally, explain why the latter two are preferable, focusing on coverage probability and behavior with extreme proportions.

Pro tip: Mention that in practice, Amazon often uses Bayesian methods for A/B testing, but understanding frequentist intervals like Wilson is crucial for interpreting results and communicating uncertainty.

1. Clarify inputs and assumptions

Confirm the baseline conversion rate (p-hat) and sample size (n=100,000). Assume the conversion rate is estimated from the sample.

2. Compute Wald interval

Use the formula: p-hat ± z * sqrt(p-hat*(1-p-hat)/n), where z=1.96 for 95% confidence.

3. Compute Wilson or Agresti-Coull interval

For Wilson, use the formula: (p-hat + z^2/(2n) ± z * sqrt(p-hat*(1-p-hat)/n + z^2/(4n^2))) / (1 + z^2/n). For Agresti-Coull, add z^2/2 successes and failures, then compute Wald on adjusted values.

4. Compare intervals and discuss properties

Highlight that Wald can produce intervals outside [0,1] and has poor coverage for extreme p or small n. Wilson and Agresti-Coull have better coverage and are bounded within [0,1].

5. Relate to A/B testing context

Explain why these intervals matter for decision-making in experiments, especially when conversion rates are low or sample sizes are not large.

Key Points to Mention

  • Wald interval formula and its limitations (e.g., symmetry, poor coverage for extreme proportions).
  • Wilson score interval formula and its advantages (better coverage, bounded within [0,1]).
  • Agresti-Coull interval as an adjustment to Wald (adding pseudo-counts) and its improved coverage.
  • Coverage probability and the impact of sample size and true proportion.
  • The importance of choosing appropriate intervals for A/B testing to avoid false positives/negatives.
  • Practical implications: when to use each interval and how to interpret them in business terms.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Using a normal approximation for two proportions, derive the per-variant sample size needed to detect a 5% relative lift at 80% power and a two-sided alpha of 0.05. State your assumptions explicitly.

A/B Testing & ExperimentationTechnical Trade-offs
Author's notes

Went fine until I forgot to account for the fact that p1 is derived as 1.05 times p0, not an absolute difference.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly stating all assumptions: baseline conversion rate, significance level, power, and the relative lift to detect. Then derive the sample size formula for comparing two proportions using the normal approximation, and plug in the numbers to compute the required sample size per variant. Finally, interpret the result and discuss practical considerations.

Pro tip: Always mention that the sample size depends on the baseline conversion rate; if not given, you can express the formula in terms of it or assume a conservative 50% baseline. Also, clarify that the formula assumes equal allocation and independence.

1. State assumptions

Explicitly list the baseline conversion rate (p), significance level (α=0.05 two-sided), power (1-β=0.80), and the relative lift (δ=5%). Also assume equal allocation and independence.

2. Define hypotheses and test statistic

Set up null hypothesis H0: p1 = p2 and alternative H1: p1 ≠ p2. Use the normal approximation for the difference in proportions.

3. Derive sample size formula

Using the formula for comparing two proportions: n = ( (z_{α/2} + z_β)^2 * (p1(1-p1) + p2(1-p2)) ) / (p1 - p2)^2, where p2 = p1 * (1 + δ).

4. Plug in values and compute

Substitute z_{α/2}=1.96, z_β=0.84, p1 (if known), and p2 = p1*1.05. If p1 is not given, express n as a function of p1 or assume a conservative p1=0.5.

5. Interpret and discuss

Report the required sample size per variant, round up to the nearest integer, and mention that this is an approximation. Discuss sensitivity to assumptions and practical implications.

Key Points to Mention

  • Baseline conversion rate is critical; if unknown, use 50% for maximum sample size or provide a range.
  • Two-sided alpha of 0.05 corresponds to z_{α/2} = 1.96; 80% power corresponds to z_β = 0.84.
  • Relative lift of 5% means p2 = p1 * 1.05, so absolute difference depends on p1.
  • Formula assumes equal sample sizes per variant and normal approximation validity (np and n(1-p) > 5 or 10).
  • Sample size is inversely proportional to the square of the absolute difference; small lifts require large samples.
  • Consider using pooled variance under null for hypothesis testing, but for sample size calculation, use unpooled variance.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

If you're simultaneously testing three metrics in an experiment, how do you apply a Bonferroni or Holm correction? What's the adjusted significance threshold, and how does that compare to controlling the false discovery rate with Benjamini-Hochberg?

A/B Testing & ExperimentationTechnical Trade-offs
Author's notes

This one I actually liked.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the multiple comparisons problem and why correction is needed when testing three metrics. Then walk through the Bonferroni and Holm procedures step-by-step, calculating the adjusted thresholds for three tests, and contrast them with Benjamini-Hochberg's FDR control, highlighting the trade-offs between Type I error control and power.

Pro tip: Mention that in practice, especially at Amazon, you'd often pre-register a primary metric and treat others as secondary or guardrail metrics, applying corrections only to the secondary family. This shows you understand experimental design beyond just the math.

1. Frame the multiple testing problem

Explain that testing three metrics inflates the family-wise error rate (FWER) if no correction is applied. For three independent tests at α=0.05, FWER ≈ 1 - (0.95)^3 ≈ 14.3%, which is unacceptably high.

2. Apply Bonferroni correction

Divide the significance level by the number of tests: α_adj = α / m = 0.05 / 3 ≈ 0.0167. Each metric's p-value must be below this threshold to be considered significant. This controls FWER but is conservative, reducing power.

3. Apply Holm-Bonferroni step-down procedure

Order the three p-values from smallest to largest. Compare the smallest to α/3, the next to α/2, and the largest to α. Stop at the first non-significant result. This is uniformly more powerful than Bonferroni while still controlling FWER.

4. Apply Benjamini-Hochberg for FDR control

Order p-values ascending. Find the largest k such that p_(k) ≤ (k/m) * α. Reject all hypotheses up to that k. For m=3 and α=0.05, thresholds are 0.0167, 0.0333, and 0.05. BH controls the expected proportion of false discoveries, not FWER, offering more power.

5. Compare and recommend

Bonferroni/Holm control FWER (probability of any false positive), while BH controls FDR (expected proportion of false positives among rejections). For three metrics, BH is less conservative and may be preferable if some false positives are acceptable, but FWER control is stricter for confirmatory analyses.

Key Points to Mention

  • Family-wise error rate (FWER) vs. false discovery rate (FDR) definitions and when each is appropriate.
  • Bonferroni adjustment: α/m, and its conservativeness, especially with correlated metrics.
  • Holm's step-down procedure: ordered p-values compared to α/(m-i+1), uniformly more powerful than Bonferroni.
  • Benjamini-Hochberg procedure: ordered p-values compared to (i/m)*α, controls FDR under independence or positive dependence.
  • Trade-off: FWER control is stricter and reduces power; FDR control increases power at the cost of allowing some false positives.
  • Practical consideration: pre-register primary vs. secondary metrics; apply corrections only to the family of secondary metrics to preserve power on the primary.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

Your experiment data has user-level clustering because users visit multiple times. Why does this violate the independence assumption, and how do you correct for it? What happens to your power estimates?

A/B Testing & ExperimentationTechnical Trade-offs
Author's notes

Honestly the hardest part of the whole thing.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Explain that user-level clustering violates independence because multiple observations from the same user are correlated, leading to underestimated variance and inflated false positive rates. Then describe correction methods like cluster-robust standard errors or mixed-effects models, and note that power estimates decrease because the effective sample size is smaller than the number of observations.

Pro tip: Mention that ignoring clustering can lead to a false sense of precision; always check for clustering in your data and adjust your analysis accordingly. Also, consider using the intraclass correlation coefficient (ICC) to quantify the degree of clustering and adjust power calculations.

1. Define the problem

Clarify that user-level clustering means each user contributes multiple data points, so observations are not independent. This violates the independence assumption of standard statistical tests.

2. Explain the consequences

State that ignoring clustering leads to underestimated standard errors, inflated Type I error rates, and incorrect confidence intervals. This can result in false positives.

3. Describe correction methods

Discuss approaches such as cluster-robust standard errors (e.g., CRSE), mixed-effects models, or aggregating data to the user level. Mention that the choice depends on the analysis goals and data structure.

4. Discuss impact on power

Explain that clustering reduces effective sample size, so power decreases. The design effect (1 + (m-1)*ICC) quantifies the variance inflation, where m is cluster size and ICC is intraclass correlation.

5. Provide practical recommendations

Suggest planning for clustering in the design phase by increasing sample size or using cluster-level randomization. Also, recommend sensitivity analyses to check robustness.

Key Points to Mention

  • Independence assumption violation due to correlated observations within users
  • Underestimated variance and inflated Type I error if ignored
  • Cluster-robust standard errors or mixed-effects models as corrections
  • Effective sample size reduction and power loss
  • Design effect formula: 1 + (m-1)*ICC
  • Intraclass correlation coefficient (ICC) to measure clustering
  • Aggregation to user level as a simple fix
  • Planning sample size with clustering in mind

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.