🔤Typeahead / Autocomplete
0 nodes · 0 edgesHint 1 — locked
Hint 2 — locked
Hint 3 — locked
🔤
Typeahead / Autocomplete
● Beginner20–30 min
Problem
Build a typeahead service that returns top-5 search suggestions in < 100 ms as the user types. Suggestions are ranked by query frequency. The system ingests billions of search queries daily to keep suggestions up-to-date.
Functional Requirements
- Return top-5 relevant suggestions for a given prefix
- Rank suggestions by historical query frequency
- Update suggestions as new queries arrive (near-real-time)
- Support multiple languages and regions
- Filter out inappropriate/spam queries
Non-Functional
- 10M active users, 100K prefix queries/sec peak
- < 100 ms p99 suggestion latency
- Suggestions update within 1 hour of trend changes
- Read:write ratio ~ 1000:1
Prerequisites
Trie data structureCachingPrefix-based indexing
🔤
Design your Typeahead / Autocomplete
Drag components from the Brief panel → switch to Components tab
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
UML
15
Needs Work
Click a dimension to see what's missing. Score updates as you design.
Speed
RPS
Hit Play to start simulation00:00