Design Related Searches Suggestions Below Product Search Results

Last updated: November 29, 2026

Quick Overview

Design the "Related searches" module that appears on an Amazon search results page, suggesting a handful of alternative queries that help the customer refine or broaden what they typed.

Amazon
ML System Design
Machine Learning Engineer
Amazon
November 29, 2026
Machine Learning Engineer
Onsite
ML System Design
Easy

0

0

0 solved


Design the "Related searches" module that appears on an Amazon search results page, suggesting a handful of alternative queries that help the customer refine or broaden what they typed.

An entry-level ML system design question in the style of Amazon Search onsites. The interviewer wants a clean pipeline built from query logs, sensible candidate sources, and a ranking objective tied to whether the suggested query leads to a purchase.

What the Interviewer Expects
  • Mines candidates from session reformulations and co-clicks
  • Defines a success metric beyond clicking the suggestion
  • Ranks with simple features before reaching for deep models
  • Filters unsafe, competitor-trademark and zero-result suggestions
  • Serves from precomputed tables with a fallback for unseen queries
Key Topics to Cover
query reformulation mining
co-click graphs
learning to rank
precomputation
content safety filters
How to Approach This
  1. Start by mapping the business objective to a concrete ML objective and metric.
  2. Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
  3. Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
  4. Address the serving latency budget and whether batch or real-time inference is needed.
  5. Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
  • How do you produce suggestions for a query never seen before?
  • How would you balance refinements against broader queries?
  • How do you avoid suggesting queries that lead to zero results?
  • How would you evaluate before launch?
Sharpen Your Skills on Codemia

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

Practice ML System Design Problems
Sample Answer
M
  • Show up to 8 related queries per results page.
  • Suggestions should lead to successful searches: the customer clicks one and then purchases or adds to cart.
  • Latency budget is small (under 10 ms), ...
L
  1. Offline mining (daily): from search sessions, collect pairs (query A, query B) where B follows A within the same session, and pairs of queries whose clicked products overlap.
  2. **Candidate tab...

Submit Your Answer
Markdown supported