Code RoomCustom framework invariants
HardPrep Room Coding #4500

Custom framework invariants

Vibe & agenticAlgorithms & data structuresSenior–Staff~20 min

You're the team's expert on your company's custom event-sourcing framework — it has unusual rules about idempotency keys and event ordering that aren't documented publicly. You ask an agent to add a new projection, and it writes confident, fluent code that follows mainstream event-sourcing conventions but violates two of your framework's invariants. The code compiles and passes the agent's tests. How do you handle working with AI in a domain where it will be confidently wrong, and how do you keep this from shipping?

Implement
apply_events_with_invariants(seqs: list[int], keys: list[str]) → list[str]
Examples
in[[1,2,3],["a","b","c"]]out["applied","applied","applied"]
in[[1,2,3],["a","b","a"]]out["applied","applied","duplicate"]
in[[5,3,6],["a","b","c"]]out["applied","out_of_order","applied"]
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.