Design Search-Bar Autocomplete Suggestions Across Amazon Marketplaces

Last updated: November 29, 2026

Quick Overview

Design the service behind the Amazon search box that returns the top query suggestions for a typed prefix in under 50 ms, per marketplace and language, refreshed as trends change.

Amazon
System Design
Software Engineer
Amazon
November 29, 2026
Software Engineer
System Design Round
System Design
Medium

0

0

0 solved


Design the service behind the Amazon search box that returns the top query suggestions for a typed prefix in under 50 ms, per marketplace and language, refreshed as trends change.

Autocomplete is high traffic and latency sensitive, and Amazon interviewers use it to test precomputation versus online serving. They check data structure choice, how suggestions are ranked, and how a trending query like a new console launch shows up within the hour.

What the Interviewer Expects
  • Estimate QPS from keystrokes and set a latency budget
  • Precompute top-k per prefix offline from query logs
  • Serve from in-memory tries or prefix tables, sharded by marketplace
  • Blend in a fast-path for trending queries
  • Filter offensive and policy-violating suggestions
Key Topics to Cover
Trie
Top-K Precomputation
Caching
Ranking
Content Filtering
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How would you personalize suggestions without breaking caching?
  • How do you handle typos in the prefix?
  • How would you add category hints like 'in Electronics' to a suggestion?
Sharpen Your Skills on Codemia

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

Practice System Design Problems
Sample Answer
Requirements

Functional: for a prefix return up to 10 suggestions; per marketplace (amazon.com, .de, .co.jp) and language; suppress blocked terms. Non-functional: if search sees about 100k queries per second, keys...

High-Level Design

Offline: a daily Spark job aggregates search logs over the last 30 days with time decay, keeps queries that led to engagement (clicks, purchases), computes a score, and builds for each prefix (up to a...


Submit Your Answer
Markdown supported