Code Room
System designHardsd-g331
Subject TypeaheadLevel Senior–Staff~45 minCommon in Distributed systems interviewsIndustries Technology

Question

Design a *personalized* typeahead for a marketplace search box at 1M autocomplete QPS, p99 < 40ms. The catch: the suggestion list for a given prefix must blend three sources at request time — a global popularity-ranked completion trie, this user's own recent searches and purchases (the last ~90 days), and what's hot in the user's *current session* (e.g. they just searched 'tent', so 'sleeping bag' should rise). You must not regress the 40ms budget by doing a per-request ML scoring round trip. How do you structure the index, where does personalization live, and how do you merge the three lists deterministically?

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.

Narrate your design
Loading whiteboard…
Run or narrate your approach, then ask the coach.