Design Query Intent and Product Type Classification for Search

Last updated: November 29, 2026

Quick Overview

Design the component of Amazon product search that maps a raw query like "usb c charger 65w for laptop" to product types, attributes and intent before retrieval, so that downstream ranking can filter and boost correctly.

Amazon
ML System Design
Machine Learning Engineer
Amazon
November 29, 2026
Machine Learning Engineer
System Design Round
ML System Design
Medium

0

0

0 solved


Design the component of Amazon product search that maps a raw query like "usb c charger 65w for laptop" to product types, attributes and intent before retrieval, so that downstream ranking can filter and boost correctly.

An ML system design question in the style of Amazon Search (query understanding) interviews. The interviewer checks whether you can define a taxonomy-aware classification and tagging problem, obtain labels cheaply from behavior, and integrate it safely with retrieval so errors degrade gracefully.

What the Interviewer Expects
  • Defines outputs: product type distribution, attribute slots, and query intent
  • Derives training labels from click and purchase logs with noise handling
  • Chooses a model fitting the latency budget
  • Uses predictions as soft boosts rather than hard filters
  • Handles head versus tail queries differently
  • Plans offline metrics and online search impact tests
Key Topics to Cover
query classification
named entity tagging
weak supervision
product taxonomy
head and tail queries
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 handle a new product type added to the taxonomy?
  • What happens when the query is ambiguous like "apple"?
  • How do you serve queries in languages across marketplaces?
  • How would you detect that the classifier is hurting search?
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
  • Input: raw query string, marketplace, and optionally session context.
  • Output: probability distribution over product types (a taxonomy of thousands), attribute slots (brand, wattage, connector type...
L
  1. Normalization: lowercase, unit normalization ("65 w" to "65w"), tokenization.
  2. Head cache: the top few million queries get precomputed outputs refreshed daily from behavior, served by loo...

Submit Your Answer
Markdown supported