Code RoomInventory counts drift under load
HardPrep Room Coding #4426

Inventory counts drift under load

Vibe & agenticNetworking & APIsSenior–Staff~19 min

An AI wrote this EventBridge-triggered Lambda (Go) that applies inventory deltas. Stock counts drift over time under high event volume. The arithmetic looks right. What's the underlying serverless issue?

Implement
apply_inventory_deltas(event_ids: list[str], deltas: list[int], starting_count: int) → int
Examples
in[["e1","e2"],[5,-2],10]out13
in[["e1","e1"],[5,5],0]out5
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 19 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.