7. Typeahead

Easy

Design a typeahead/auto-completion feature that creates suggestions as a user types a query into a search engine

Functional Requirements
  • Return a list of the top 3 suggestions based on the user input so far
  • Suggestions should be ordered according to popularity and recency
Nonfunctional Requirements
  • Very low latency, should feel real-time
  • High availability
  • Should still function quickly with usage spikes
Assumptions
  • 35% of queries are completely unique
Estimated Usage
  • 4 billion queries per day
  • Smooth usage

Seen this question in a real interview before?

Not all editor features are supported on mobile