KatInterview

Design and Analyze a Counterfactual Online Experiment for a Ranking Model

Machine LearningModel answer
HardModel answerMachine Learningmachine learningexperimentationranking

Last updated

Design an online experiment to measure the causal impact of a new ML ranking model, handling interference, novelty effects, and metric trade-offs at scale.

Scenario

You are a senior ML engineer at a large e-commerce marketplace. Your team has trained a new item-ranking model that, in offline evaluation, improves NDCG@10 by 4% and predicted purchase rate by 2.1% over the current production model.

Your manager asks you to run an online experiment before shipping. The platform serves 50 million daily active users and processes roughly 200 million search sessions per day. Items on the platform can appear in multiple users' feeds simultaneously, and seller inventory is shared across all users.

What is expected

Answer the following, reasoning step by step:

  1. Experiment design — What type of online experiment would you run? Justify your randomization unit choice and explain any interference risks specific to a marketplace ranking problem.

  2. Metric selection — Which primary and guardrail metrics would you choose, and why? Discuss the tension between short-term engagement metrics and long-term business metrics.

  3. Novelty and primacy effects — How would you detect and handle them in this experiment?

  4. Statistical considerations — How long should you run the experiment? What sample size or power calculation approach would you use? How do you handle multiple comparisons?

  5. Decision framework — The experiment shows a statistically significant +1.8% lift in purchases but a −0.6% drop in session length. How do you decide whether to ship?

  6. Failure modes — Name at least three subtle ways this experiment could give you a misleading result even if implemented correctly.

Hints

Hint 1

Consider how shared seller inventory creates interference between treatment and control groups — this is called a market-level spillover effect. How would you detect or bound it?

Hint 2

For novelty effects, think about whether the change in user behavior is driven by genuine model improvement or just user curiosity about seeing different results. What cohort analysis would reveal this?

Hint 3

When two metrics move in opposite directions (purchases up, session length down), think about whether that is actually a bad sign — what causal story could make both movements a positive outcome?