Code Room
System designMedium
Question
Design a query-suggestion (search-as-you-type) system for a large web search engine that suggests full queries from prefixes, learned from aggregate query logs. Scale: billions of queries/day feeding the suggestions, p99 under 50ms, suggestions must reflect trending queries within hours, and must suppress offensive/illegal/PII-leaking completions.
What a strong answer looks like
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.
Learn the concepts
Loading whiteboard…
Run or narrate your approach, then ask the coach.