Code RoomChecksum overflow wraps validation
MediumPrep Room Coding #4291

Checksum overflow wraps validation

Vibe & agenticAlgorithms & data structuresMid–Senior~18 min

An AI wrote this Go code to verify a packet's trailing checksum before processing it. It accepts every valid packet in tests but also lets corrupted ones through. Find the validation bug, the packet that slips past, and the fix.

Implement
verify_packet(packet: list[int]) → bool
Examples
in[[1,2,3,10,6]]outtrue
in[[3,2,1,10,6]]outfalse
in[[0,0]]outtrue
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 18 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.