Choose an Offline Metric for Ranking Amazon Search Results

Last updated: November 29, 2026

Quick Overview

You are evaluating a new learning-to-rank model for Amazon product search offline. Decide between NDCG, MAP, MRR and precision at k, justify the choice, and explain how you would compute it from purchase and click logs.

Amazon
Machine Learning
Machine Learning Engineer
Amazon
November 29, 2026
Machine Learning Engineer
Technical Screen
Machine Learning
Medium

0

0

0 solved


You are evaluating a new learning-to-rank model for Amazon product search offline. Decide between NDCG, MAP, MRR and precision at k, justify the choice, and explain how you would compute it from purchase and click logs.

This shows up in Amazon search and ranking interviews for applied science and MLE roles, usually right after a candidate describes a ranking model. The interviewer checks whether you can tie a metric to how shoppers actually scan a results page and to the graded relevance signals Amazon logs (impression, click, add to cart, purchase).

What the Interviewer Expects
  • Ties the metric to user behavior on a ranked page with strong position effects
  • Explains graded relevance and why NDCG handles it while MAP and MRR do not
  • Defines relevance labels from engagement events with sensible gains
  • Chooses a cutoff k grounded in the first screen on mobile and desktop
  • Mentions slicing by query type and checking agreement with online metrics
Key Topics to Cover
NDCG
graded relevance
MRR
position discount
offline-online correlation
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • How would you handle queries where no item was purchased?
  • Would you pick a different metric for navigational queries like a brand name?
  • How do you validate that offline NDCG gains predict online revenue lift?
  • How does position bias in the logged labels distort your metric?
Sharpen Your Skills on Codemia

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

Explore ML Interview Prep
Sample Answer
Clarify

Ask what decision the metric supports (ship or not ship a ranker), what labels exist (clicks, add to cart, purchases per query session), how many results fit above the fold (often 4 to 6 on mobile), a...

Approach

Search results are a ranked list with several possibly relevant items and multiple levels of relevance. That points to a metric that (1) rewards putting the best items at the top, (2) uses graded labe...


Submit Your Answer
Markdown supported