System design interview questionHard
Amazon

Design Product Search Autocomplete

Design personalized, trend-aware autocomplete and search suggestions for a large online store's product search, built around a ranking model you are given.

1. Problem Statement

Design the autocomplete for a large online store's product search. As a shopper types, the search box shows up to 10 query suggestions, personalized to that shopper and aware of what is trending in their country's store right now. A ranking model already exists: given a prefix, candidate queries, and features, it scores the candidates. How would you build the system around it?

2. Architecture Discussion Map

Use this as one discussion aid, not a single correct answer. Your design should follow from the requirements, scale, and trade-offs you establish.

Rendering architecture diagram...
Mermaid Source (For AI Bots)
graph LR
    A["Design Product Search Autocomplete"]
    A --> F1["Candidate generation versus model ranking"]
    A --> F2["Serve-time personalization, caching, and fallbacks"]
    A --> F3["Trending-query pipeline with minute-level freshness"]
    A --> F4["Marketplaces, locales, and cold start"]
    A --> F5["Privacy, safety, and abuse filtering"]

3. Key Focus Areas

  • 1
    Candidate generation versus model ranking
  • 2
    Serve-time personalization, caching, and fallbacks
  • 3
    Trending-query pipeline with minute-level freshness
  • 4
    Marketplaces, locales, and cold start
  • 5
    Privacy, safety, and abuse filtering

4. What the Interviewer Looks For

The interviewer probes these areas, and the report grades the interview against them.

  • Requirements, latency budget, and estimation
  • Candidate generation versus ranking
  • Serve-time personalization and caching
  • Trending and fresh-query pipeline
  • Marketplaces, locales, and cold start
  • Privacy, safety, and abuse

5. What Strong Candidates Should Demonstrate

  • Split autocomplete into candidate generation and model ranking, and size each stage.
  • Blend per-shopper signals into ranking within a strict latency budget, with fallbacks.
  • Decide what stays cacheable once results are personalized.
  • Surface trending queries within a minute while keeping manipulation and private searches out of suggestions.

Want interactive feedback?

Practice drawing this system component-by-component on a live whiteboard while the interviewer probes at your target level.

Continue to Dashboard

Core Concepts

PersonalizationCandidate GenerationStream ProcessingCaching

Continue preparing

Build a complete software engineer mock interview plan

Prepare by company

Related System Design

Design Twitter Feed

Design a scalable news feed system where users can post tweets and follow other users.

Related System Design

Design Typeahead

Design the search-box typeahead for a large web search engine: popular completions for every prefix, shared by all users in a locale.