KatInterview

Design an Experiment for a Commerce Recommendation Feature

Statistics & ExperimentsModel answer
HardModel answerStatistics & Experimentsexperimentationcausal-inferencemetric-design

Last updated

Design a full evaluation plan for a new recommendation module: define metrics, pick a test design, govern the ramp, and debug a conflicting mid-test signal.

Scenario

Your team is about to launch a personalized recommendation module in a commerce app. Before it goes live, you need a rigorous evaluation plan. Two complications make a simple A/B test insufficient:

  • Cross-user interference: recommendations are served by a shared model retrained on live traffic, and popular items deplete shared inventory. One user's experience can affect another's.
  • Traffic seasonality: weekly shopping patterns and promotional events mean a short test window can produce misleading results.

Answer all five parts below. Be precise — write formulas where they add clarity, specify units, and call out assumptions explicitly.


Part 1 — Primary metric and guardrails

Define an Overall Evaluation Criterion (OEC) for the commerce app. Then define three guardrail metrics. For each metric provide:

  • A precise formula
  • Units and measurement window
  • The non-inferiority margin you would pre-register

Part 2 — Test design

Choose among a user-level RCT, a geo-cluster design, or a time-based switchback. Justify your choice against three concerns: interference between users, non-stationarity over time, and practical operational constraints. If no single design handles everything, say how you would combine them.

Part 3 — Ramp strategy and statistical governance

Describe your traffic ramp schedule from 1% to full exposure. Cover:

  • Automated stopping rules (for harm and for SRM)
  • How you would pre-register the experiment
  • A sample-size calculation with realistic assumptions
  • How CUPED (or covariate adjustment more broadly) reduces the required sample

Part 4 — Quasi-experimental fallback

Suppose the engineering team cannot randomize at all — the module must roll out market by market. Propose a quasi-experimental method (difference-in-differences or synthetic control). State the identifying assumptions, flag the pitfalls specific to a staggered rollout, and list the falsification tests you would run before trusting the estimate.

Part 5 — Mid-test metric conflict

Midway through the experiment you observe: the OEC is flat, add-to-cart rate is up, and checkout conversion rate is down. Walk through your diagnostic checklist. What data cuts would you request first, and what hypotheses would each cut help you rule in or out?

Hints

Hint 1

For the OEC, think about what GMV alone gets wrong — returns, cost of goods, and artificially promoted low-margin items can all make a bad feature look like a winner. Build those adjustments into the formula from the start, and anchor the denominator to assigned users so the treatment cannot game who gets counted.

Hint 2

The core reason a pure user-level RCT is risky here is SUTVA violation: shared inventory and shared model training couple treated and control users. A randomized saturation design lets you simultaneously estimate the direct effect on treated users and the spillover onto control users, so you can report the total effect that actually matters for a full launch decision.

Hint 3

When add-to-cart goes up but conversion goes down, the problem almost certainly lives between those two funnel steps — the cart-to-checkout or checkout-to-payment flow. Start by slicing on device type, new vs. returning user, and latency bucket before assuming the recommendation logic itself is broken.