Compute Correct Variance for Add-to-Cart per Session Metric

Last updated: November 29, 2026

Quick Overview

An experiment randomizes customers, but the team's key metric is add-to-cart events per session. Explain why a naive per-session t-test is wrong and compute the correct standard error.

Amazon
Analytics & Experimentation
Data Scientist
Amazon
November 29, 2026
Data Scientist
Onsite
Analytics & Experimentation
Hard

0

0

0 solved


An experiment randomizes customers, but the team's key metric is add-to-cart events per session. Explain why a naive per-session t-test is wrong and compute the correct standard error.

A frequent Amazon onsite question for experimentation-heavy Data Scientist roles in retail and search. The interviewer checks whether you spot the mismatch between randomization unit and analysis unit and can apply the delta method or a bootstrap.

What the Interviewer Expects
  • Identify that sessions within a customer are correlated
  • Write the metric as a ratio of per-customer sums
  • Derive or apply the delta method variance
  • Mention cluster bootstrap as a check
  • Explain how the naive approach inflates false positives
Key Topics to Cover
Delta method
Ratio metrics
Analysis unit mismatch
Cluster bootstrap
False positive rate
How to Approach This
  1. Define success metrics carefully. A good metric is measurable, actionable, and aligned with business goals.
  2. Run experiments long enough to account for novelty effects and weekly seasonality.
  3. Use funnel analysis to identify where users drop off for maximum optimization impact.
  4. Segment results by key dimensions (platform, country, user cohort) to catch hidden patterns.
  5. Consider network effects and interference between treatment and control groups.
Possible Follow-up Questions
  • What happens if treatment changes the number of sessions?
  • How would CUPED combine with a ratio metric?
  • When would you prefer a bootstrap over the delta method?
  • How would you report the effect to a PM?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Browse Analytics Questions
Sample Answer
Clarify

Randomization is by customer. The metric is R=∑iXi/∑iYiR = \sum_i X_i / \sum_i Y_i, where XiX_i is add-to-carts and YiY_i is sessions for customer ii. Treatment might also change YiY_i, which matters for inte...

Approach

Treating sessions as independent rows understates variance, because a heavy shopper contributes many correlated sessions. The fix is to treat the customer as the independent unit and compute the varia...


Submit Your Answer
Markdown supported