YOUR BRIEF
What to work through
Work through search autocomplete as a spoken system design interview. Start by clarifying the scope, sketch a working design and explain the trade-offs behind your choices.
- Return the top 5 suggestions for the prefix typed so far
- Rank suggestions by how often each query was searched
- Match only the start of a query; no spell check
- Keep suggestions current as new queries come in
- Never suggest offensive or unwanted queries
BEFORE YOU START
Constraints to discuss
- Suggestions show within 100 ms
- 10 million daily users, 24,000 requests a second on average
- Highly available
- English, lowercase, no special characters
Need a starting point?
Watch for these common gaps as you prepare:
- Counting searches, not keystrokes, and sizing the service for 1,200 requests a second
- Walking the whole subtree and sorting on every keystroke
- Updating the trie on every search, on the request path
- Sharding by alphabet ranges as if letters were equally common
- No way to remove an offensive suggestion quickly
Why this question is in the collection
These sources connect the problem to company interview reports or preparation guides. They do not guarantee what a company will ask you.