Code RoomEvent tags cross-request leak
MediumPrep Room Coding #4406

Event tags cross-request leak

Vibe & agenticAlgorithms & data structuresMid~14 min

An AI wrote this helper used by a FastAPI service to accumulate request tags before saving. QA reports that tags from one user's request mysteriously show up on a later, unrelated user's request. Find the bug.

Implement
build_event_tags(base_tags: list[str], names: list[str]) → list[list[str]]
Examples
in[["env:prod"],["signup","login"]]out[["env:prod","event:signup"],["env:prod","event:login"]]
in[[],["a","a","a"]]out[["event:a"],["event:a"],["event:a"]]
in[["t1","t2"],["x"]]out[["t1","t2","event:x"]]
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 14 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.