Design a Real-Time Suggestions Service
Design a Real-Time Typeahead/Autocomplete Service
Context
Design a real-time typeahead/autocomplete service for a consumer-facing web and mobile application. Users must see suggestion updates on each keystroke. The system should support global traffic, multiple locales, and both anonymous and signed-in users.
Requirements
The system design must cover the following aspects:
- API design and request/response schemas
- Data modeling and indexing (e.g., prefix trees, FST, inverted indexes)
- Ranking signals and personalization
- Latency targets and budgets (e.g., P95 < 100 ms)
- Caching layers (edge, in-memory, distributed)
- Scalability and capacity planning
- Freshness and backfill pipelines (batch + streaming)
- A/B experimentation hooks and telemetry
- Failure handling and graceful degradation
Candidates are expected to state assumptions where needed and justify all trade-offs.
AI interview prep
Core dilemma
Balancing ultra-low latency (P95 < 100ms on each keystroke) with highly relevant, personalized, and fresh suggestions across a global, high-scale user base, while managing data consistency and cost.
3 tradeoffs and 3 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Design a Real-Time Suggestions Service
Design a Real-Time Typeahead/Autocomplete Service
Context
Design a real-time typeahead/autocomplete service for a consumer-facing web and mobile application. Users must see suggestion updates on each keystroke. The system should support global traffic, multiple locales, and both anonymous and signed-in users.
Requirements
The system design must cover the following aspects:
- API design and request/response schemas
- Data modeling and indexing (e.g., prefix trees, FST, inverted indexes)
- Ranking signals and personalization
- Latency targets and budgets (e.g., P95 < 100 ms)
- Caching layers (edge, in-memory, distributed)
- Scalability and capacity planning
- Freshness and backfill pipelines (batch + streaming)
- A/B experimentation hooks and telemetry
- Failure handling and graceful degradation
Candidates are expected to state assumptions where needed and justify all trade-offs.