← Amazon Interview Insights

Amazon·Data Scientist·Technical Phone Screen·Senior

Senior
Jul 2026

Summary

Amazon data scientist interview that went deep into econometrics territory. Five questions, all technical, covering causal inference methods I thought I knew until I had to explain them out loud under pressure.

Questions Asked (5)

Q1

Derive the standard 2x2 difference-in-differences estimand from the parallel trends assumption, then show it maps to a two-way fixed effects regression with a treatment-post interaction term under homogeneous treatment effects.

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

I can do this derivation on paper but explaining it verbally while keeping notation clean is a different beast.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by formally stating the parallel trends assumption and defining the four group-time means. Derive the DiD estimand as the difference of differences, then show that under homogeneous treatment effects, the OLS estimator of the interaction term in a two-way fixed effects regression equals that DiD estimand. Use clear notation and connect each term to the assumption.

Pro tip: Emphasize that the two-way fixed effects regression with a treatment-post interaction is algebraically equivalent to the 2x2 DiD only when treatment effects are homogeneous; otherwise, it estimates a variance-weighted average that may not equal the simple DiD. This nuance shows depth and is highly relevant for A/B testing at Amazon.

1. Define notation and parallel trends

Set up potential outcomes: Y_i(0) and Y_i(1) for treated and control, with group indicator D and time indicator T. State parallel trends: E[Y_i(0)|D=1, T=1] - E[Y_i(0)|D=1, T=0] = E[Y_i(0)|D=0, T=1] - E[Y_i(0)|D=0, T=0].

2. Derive the DiD estimand

Express the observed means in terms of potential outcomes and use parallel trends to substitute the counterfactual. Show that the DiD estimand equals E[Y_i(1)-Y_i(0)|D=1, T=1], the average treatment effect on the treated (ATT).

3. Map to two-way fixed effects regression

Write the regression: Y_it = α + β D_i + γ T_t + δ (D_i * T_t) + ε_it. Show that under homogeneous treatment effects (δ constant across units), the OLS estimate of δ equals the DiD estimand from step 2.

4. Discuss assumptions and limitations

Mention that parallel trends is untestable but can be partially assessed with pre-trends. Note that with heterogeneous effects, the TWFE estimator is a weighted average of group-time ATTs and may be biased if weights are negative.

Key Points to Mention

  • Parallel trends assumption: absent treatment, treated and control groups would have followed the same trend.
  • DiD estimand = (E[Y|D=1,T=1] - E[Y|D=1,T=0]) - (E[Y|D=0,T=1] - E[Y|D=0,T=0]).
  • Under homogeneous treatment effects, the interaction coefficient in TWFE equals the DiD estimand.
  • The TWFE regression includes unit and time fixed effects (or group and time fixed effects in the 2x2 case).
  • With heterogeneous effects, TWFE may not equal the simple DiD and can produce biased estimates due to negative weights.
  • Connection to A/B testing: DiD is used when randomization is not possible or to adjust for pre-existing differences.

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

Q2

Why does two-way fixed effects break down with staggered treatment adoption and heterogeneous effects? Walk through the Sun-Abraham and Callaway-Sant'Anna approaches and explain how you'd construct an event study with proper cohort weighting.

A/B Testing & ExperimentationTechnical Trade-offsProduct Analytics & Metrics
Author's notes

This is where the interview got uncomfortable.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the bias in TWFE under staggered adoption and heterogeneous effects, then compare Sun-Abraham and Callaway-Sant'Anna estimators, and finally describe how to build an event study with proper cohort weighting. Use a concrete example to illustrate the problem and solutions.

Pro tip: Emphasize that the choice between Sun-Abraham and Callaway-Sant'Anna depends on the estimand and data structure, and mention that you would validate with a pre-trend test and sensitivity analysis.

1. Explain the TWFE bias

Describe how TWFE uses already-treated units as controls, leading to negative weighting and bias when effects are heterogeneous across cohorts or time.

2. Introduce Sun-Abraham

Explain that Sun-Abraham estimates cohort-specific average treatment effects on the treated (CATT) and then aggregates them with weights proportional to cohort size, avoiding negative weighting.

3. Introduce Callaway-Sant'Anna

Explain that Callaway-Sant'Anna uses not-yet-treated or never-treated units as controls, estimates group-time ATTs, and then aggregates them into an event study or overall ATT.

4. Construct event study

Describe how to plot event-study estimates by relative time, weighting each cohort-time estimate by the number of units in that cohort, and possibly smoothing or binning endpoints.

5. Validate and interpret

Mention checking pre-trends, conducting sensitivity analysis, and interpreting the event study in the context of the business question.

Key Points to Mention

  • Negative weighting in TWFE due to heterogeneous effects
  • Cohort-specific treatment effects and aggregation
  • Use of not-yet-treated or never-treated as controls
  • Group-time ATT estimation
  • Event study with cohort weighting
  • Pre-trend testing and sensitivity analysis

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

Q3

How would you decide what level to cluster standard errors at when you have both household-level interference and market-level shocks? When would you use wild cluster bootstrap instead, and what goes wrong if you have too few clusters?

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

Clustering questions always feel deceptively simple.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the data structure and the source of dependence: household-level interference and market-level shocks. Then explain that you would cluster at the level of the most aggregate source of dependence (market) to be conservative, but also consider multi-way clustering if both are present. Discuss the trade-offs, including the need for enough clusters, and when to use wild cluster bootstrap as a remedy for few clusters.

Pro tip: In practice, always check the number of clusters; if it's below 30-40, consider wild cluster bootstrap or aggregation. Also, remember that clustering at a finer level than the source of dependence can understate standard errors.

1. Identify sources of dependence

Determine whether the dependence arises from household-level interference (e.g., spillovers within households) or market-level shocks (e.g., common market shocks). This guides the clustering level.

2. Choose clustering level

Cluster at the level of the most aggregate source of dependence (market) to be conservative. If both are present, consider multi-way clustering or clustering at the higher level.

3. Assess number of clusters

Check the number of clusters. If it's small (e.g., <30-40), standard cluster-robust standard errors may be biased downward. Consider wild cluster bootstrap or aggregation.

4. Apply wild cluster bootstrap

Use wild cluster bootstrap when the number of clusters is small and you need reliable inference. It resamples residuals within clusters to better approximate the distribution.

5. Evaluate trade-offs and robustness

Compare results across different clustering choices and methods. Discuss the implications of too few clusters: inflated Type I error, unreliable confidence intervals.

Key Points to Mention

  • Clustering at the level of the most aggregate source of dependence (market) to account for both household and market shocks.
  • Multi-way clustering when both household and market-level dependence are present.
  • The rule of thumb: need at least 30-50 clusters for reliable cluster-robust standard errors.
  • Wild cluster bootstrap as a solution for few clusters, especially with few treated clusters.
  • Consequences of too few clusters: underestimated standard errors, over-rejection of null hypothesis.
  • Alternative approaches: aggregation to cluster level, randomization inference, or using fixed effects.

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

Q4

Design a plausibly exogenous instrument for reminder email exposure, write out the two-stage least squares setup including first stage and structural equation, and state the GMM moment conditions.

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

Actually enjoyed this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the endogeneity problem: reminder emails are not randomly assigned, so naive estimates are biased. Propose a plausible instrument such as random variation in email delivery timing or server-side randomization, then formally write the 2SLS equations and GMM moment conditions. Emphasize the need to justify instrument relevance and exogeneity, and discuss potential violations.

Pro tip: When proposing an instrument, explicitly discuss the exclusion restriction and how you would test it (e.g., overidentification tests if multiple instruments). Also, mention that in practice, Amazon often uses randomized encouragement designs, which can serve as instruments.

1. Define the causal question and endogeneity

Clarify that you want to estimate the effect of reminder email exposure on an outcome (e.g., purchase). Explain why exposure is endogenous (e.g., self-selection, targeting).

2. Propose a plausibly exogenous instrument

Suggest an instrument Z that affects exposure but not the outcome directly. For example, random variation in email send time due to server load, or a randomized encouragement to receive emails.

3. Write the 2SLS setup

Write the first stage: Exposure = α0 + α1 Z + α2 X + v. Write the structural equation: Outcome = β0 + β1 Exposure + β2 X + ε. Explain that β1 is the causal effect of interest.

4. State GMM moment conditions

For 2SLS, the moment conditions are E[Z * (Outcome - β0 - β1 Exposure - β2 X)] = 0 and E[X * (Outcome - β0 - β1 Exposure - β2 X)] = 0. If multiple instruments, use GMM with weight matrix.

5. Discuss assumptions and tests

Mention relevance (first-stage F-stat > 10), exogeneity (exclusion restriction), and overidentification tests (Sargan/Hansen) if applicable. Discuss potential violations and robustness checks.

Key Points to Mention

  • Endogeneity of reminder email exposure (self-selection, targeting)
  • Instrument relevance: Z must be correlated with exposure
  • Exclusion restriction: Z affects outcome only through exposure
  • First-stage and structural equations with covariates
  • GMM moment conditions and efficient weighting
  • Overidentification tests and weak instrument diagnostics

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

Q5

What tests would you run to check instrument strength and validity? How do you interpret a situation where the first-stage F-stat is around 8 and the Hansen J test is insignificant, especially under heteroskedasticity and clustering?

A/B Testing & ExperimentationTechnical Trade-offsRoot Cause Analysis
Author's notes

F around 8 is below the classic threshold so I said weak instrument, discussed bias toward OLS, and mentioned using a robust or cluster-adjusted version of the stat rather than the textbook cutoff.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining the standard diagnostic tests for instrumental variables: first-stage F-statistic for instrument strength, overidentification tests (e.g., Hansen J) for validity, and robustness checks under heteroskedasticity and clustering. Then interpret the specific scenario: an F-stat of 8 is below the conventional threshold of 10, indicating weak instruments, while an insignificant Hansen J suggests the instruments are valid but the weak instrument problem may inflate size distortions and bias. Emphasize that under heteroskedasticity and clustering, the Hansen J test remains valid if using robust or clustered standard errors, but the weak instrument issue requires caution and possibly alternative methods like LIML or weak-instrument-robust inference.

Pro tip: Mention that the Hansen J test can have low power, so insignificance doesn't guarantee validity; also, with weak instruments, the Hansen J test may be unreliable, so focus on the economic significance and robustness of results.

1. Outline diagnostic tests for IV

List the key tests: first-stage F-stat for instrument strength, overidentification tests (Sargan/Hansen J) for validity, and tests for endogeneity (e.g., Durbin-Wu-Hausman). Mention that under heteroskedasticity, use robust or clustered standard errors.

2. Interpret first-stage F-statistic

Explain that an F-stat around 8 is below the rule-of-thumb threshold of 10, indicating potential weak instrument problem. Discuss consequences: biased 2SLS estimates, incorrect standard errors, and unreliable inference.

3. Interpret Hansen J test

An insignificant Hansen J suggests the instruments are not rejected as valid (i.e., they satisfy the exclusion restriction). However, note that this test has low power and may not detect invalid instruments, especially with weak instruments.

4. Consider heteroskedasticity and clustering

Under heteroskedasticity and clustering, the Hansen J test should be based on robust or clustered standard errors. If insignificant, it still suggests validity, but the weak instrument issue may dominate.

5. Recommend remedies and robustness checks

Suggest using weak-instrument-robust methods (e.g., Anderson-Rubin test, LIML), reporting confidence intervals, and checking sensitivity. Also, consider adding stronger instruments or using alternative identification strategies.

Key Points to Mention

  • First-stage F-statistic and the rule of thumb (F > 10) for strong instruments
  • Consequences of weak instruments: bias, size distortions, and unreliable inference
  • Hansen J test for overidentifying restrictions and its interpretation
  • Robustness to heteroskedasticity and clustering: use of robust/clustered standard errors
  • Low power of overidentification tests and the need for economic reasoning
  • Alternative estimators: LIML, Fuller, and weak-instrument-robust inference (e.g., Anderson-Rubin)

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