KatInterview

Design an Online Experiment for a Two-Stage ML Ranker

Machine LearningModel answer
HardModel answerMachine Learningmachine learningonline experimentsranking

Last updated

Design an A/B test to evaluate a new learned second-stage ranker, covering metric choice, experiment validity, novelty effects, and post-experiment rollout decisions.

Context

You work on the search team at a large e-commerce platform. The current system uses a two-stage pipeline:

  1. Stage 1 (retrieval): A fast approximate model that returns the top-500 candidates from millions of items.
  2. Stage 2 (ranker): A gradient-boosted tree model that reorders the top-500 and serves the top-20 to the user.

Your team has trained a new deep learning second-stage ranker. Offline evaluation shows a +4% NDCG@20 improvement on a held-out set. You are now asked to design and run an online experiment to decide whether to ship it.

What is expected

Walk through your full experiment design as you would in an interview. Cover:

  1. Metric selection — primary, secondary, and guardrail metrics; why NDCG alone is not enough.
  2. Experiment setup — unit of randomization, traffic split, duration, and any stratification.
  3. Validity threats — novelty effects, interference, position bias, and how you handle each.
  4. Statistical considerations — power analysis sketch, multiple testing, and when to stop early.
  5. Interpretation and launch decision — how you reconcile offline vs. online metrics, what a "mixed result" looks like, and the rollout strategy.

Hints

Hint 1

NDCG is a ranking quality metric, but the business cares about something else — what is the bridge metric, and why might they diverge?

Hint 2

Two users on the same household device, or the same user across sessions, can break the independence assumption — how does your randomization unit address this?

Hint 3

The new deep model is more expensive to serve. How does latency factor into your guardrail metrics and your rollout plan?