Code RoomQuery understanding and rewriting
HardPrep Room Coding #3457

Query understanding and rewriting

System designDatabases & SQLMid–Staff~45 min

Design the query-understanding layer that runs *before* retrieval and rewrites a raw query into a structured search request. It must: detect intent (navigational 'nike.com' vs. product 'running shoes' vs. question), recognize entities ('nike' = brand, 'size 10' = attribute, 'under $80' = price filter), expand synonyms ('sneakers' ⇄ 'trainers'), and segment multi-token brands ('north face'). Latency budget: < 25ms, because it's on the critical path before the actual search. How do you build this so it's fast, debuggable, and improvable without a model retrain for every new synonym?

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.