9. Design Search Autocomplete
Return useful prefix suggestions quickly while refreshing rankings and removing unsafe entries.
The brief
Design autocomplete for a public search box that returns ten suggestions after each typed prefix. Explain candidate lookup, popularity ranking and how a new index becomes visible. Handle corrections, language normalization and removed suggestions without exposing raw individual search histories.
- Serve 100,000 prefix lookups/second at peak over 100 million known phrases.
- Popularity updates hourly, while an operator may require an entry to disappear within five minutes.
- Users type, backspace and change language; a response for an older prefix may arrive last.
Constraints
- Suggestion latency≤ 50 milliseconds
- Declare p95 backend lookup latency in a healthy region.
- Removal precedence
- Explain how a blocked phrase remains absent across stale caches and index versions.
- Aggregation privacy
- Use aggregate signals and a stated retention policy rather than publishing rare personal queries.
What to cover
- 01
Lookup and ranking
Define normalized keys, prefix matching, top-k selection and tie-breaking.
- 02
Index lifecycle
Show aggregation, index building, validation, version switching and rollback.
- 03
Capacity and caches
Estimate index memory and hot-prefix traffic using stated phrase-size assumptions.
- 04
Client and removal walkthrough
Trace out-of-order responses and an urgent removal; compare two prefix-index choices.
Worked designs
No worked design has been published for this brief yet. You can start an attempt and share your approach in the discussion.
Review rubric
AI feedback uses these criteria. Scores are practice feedback.
Suggestion contract
Normalization, lookup and ranking are consistent.
Safe index updates
Refresh, rollback and removal work across versions.
Capacity evidence
Memory and hot-prefix estimates support latency claims.
Client and privacy behavior
Stale responses and query aggregation have explicit safeguards.
Discussion
Share an approach, ask a question, or tag @Coach.
Loading discussion…