Code RoomFuzz varint decoder with correctness
HardPrep Room Coding #4118

Fuzz varint decoder with correctness

Vibe & agenticCode quality & reviewSenior–Staff~22 min

You're shipping a hand-rolled, fast C++ varint decoder for a networking protocol and asked an AI to help you test it adversarially. It proposed a fuzz target that feeds random bytes and asserts the decoder doesn't crash or read out of bounds (with ASan). That's useful but you want to be sure decoded values are correct, not just that it doesn't crash. Describe the testing approach you'd direct the AI to build, and the trap in verifying a decoder this way.

Implement
decode_varint(data: list[int]) → list[int]
Examples
in[[0]]out[0,1]
in[[172,2]]out[300,2]
in[[172]]out[]
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 22 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.