Code RoomSearch results race condition
HardPrep Room Coding #4076

Search results race condition

Vibe & agenticConcurrencySenior–Staff~20 min

This AI-written search-as-you-type component sometimes shows results for a previous query. Reproduce the race and fix it.

Implement
displayed_query(issued_queries: list[str], arrival_order: list[int], ignore_stale: bool) → str
Examples
in[["ca","cat"],[1,0],false]out"ca"
in[["ca","cat"],[1,0],true]out"cat"
in[["ca","cat"],[0,1],false]out"cat"
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 20 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.