Code RoomPersonalized typeahead at scale
HardPrep Room Coding #3450

Personalized typeahead at scale

System designDistributed systemsSenior–Staff~45 min

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.

Clarify5:00 left
Estimate5:00 planned
Design15:00 planned
Deep dive12:00 planned
Failure8:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.