sagelearnai

Design Search Typeahead (Autocomplete)

Prompt: "Design the search suggestions that appear as users type into a search box."

Typeahead is about latency: suggestions must appear within ~100 ms of each keystroke for billions of keystrokes a day. The key insight is to precompute top suggestions per prefix offline and serve them from memory.

In this lesson

  • Learning objectives
  • 1. Requirements
  • 2. Estimates
  • 3. API
  • 4. High-level design
  • 5. Deep dives
  • 6. Operations and cost
  • 7. What each level adds
  • Self-check

Questions covered

  1. Design Google-style search suggestions.
  2. Why not compute suggestions from the trie on every keystroke?

This lesson is part of System Design Interview: Concepts, Patterns & Real Designs. Unlock the full course to read it, take the quiz and track your progress.

See plans →

Last reviewed 2026-11-05.