Design a search query autocomplete system
OpenAIMachine Learning Engineer · OnsiteLast updated
This question evaluates a candidate's ability to design a real-time, low-latency search autocomplete system, exercising competencies in architecture, indexing and serving, ranking and personalization, typo-tolerance, multilingual support, abuse prevention and privacy-aware data handling; it is categorized under System Design and emphasizes practical application with architectural-level conceptual reasoning. It is commonly asked to assess how candidates balance stringent latency and scalability requirements with personalization and trending signals, robustness to input errors and multiple languages, and metrics-driven trade-offs across caching, ranking and monitoring.
Question
Design a search autocomplete system that suggests completions as the user types.
Requirements
- Sub-100ms latency per keystroke.
- Suggestions should be personalized and reflect trending queries.
- Must handle typos and multiple languages.
- Support abuse prevention (spam, offensive queries) and privacy constraints.
Deliverables
Architecture (data collection, indexing, serving), ranking strategy, caching, and evaluation metrics.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.