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
November 29, 20260
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
How to Approach This
- Define success metrics carefully. A good metric is measurable, actionable, and aligned with business goals.
- Run experiments long enough to account for novelty effects and weekly seasonality.
- Use funnel analysis to identify where users drop off for maximum optimization impact.
- Segment results by key dimensions (platform, country, user cohort) to catch hidden patterns.
- 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 QuestionsSample Answer
Clarify
Randomization is by customer. The metric is , where is add-to-carts and is sessions for customer . Treatment might also change , 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...