Design Search Autocomplete
MolocoSoftware Engineer · OnsiteLast updated
This question evaluates system design skills for building a large-scale, low-latency autocomplete service, including distributed architecture, indexing and ranking strategies, caching, ingestion pipelines, sharding, and operational trade-offs.
Design a large-scale autocomplete service for a search engine. As a user types a query prefix, the system should return the top 5 suggested full queries in under 100 ms. Suggestions should be ranked by popularity, recent trends, and basic quality filters. The service must handle very high read traffic, frequent query updates, hot prefixes, and continuous ingestion of new search logs. Discuss the API, data model, indexing strategy, ranking, cache design, online and offline update pipelines, sharding, and how you would keep results fresh and reliable.
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.