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
November 29, 20260
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
How to Approach This
- Start by mapping the business objective to a concrete ML objective and metric.
- Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
- Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
- Address the serving latency budget and whether batch or real-time inference is needed.
- 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 ProblemsSample 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
- Normalization: lowercase, unit normalization ("65 w" to "65w"), tokenization.
- Head cache: the top few million queries get precomputed outputs refreshed daily from behavior, served by loo...