Code RoomShort write ignores partial sends
MediumPrep Room Coding #4277

Short write ignores partial sends

Vibe & agenticNetworking & APIsMid–Senior~16 min

An AI produced this C function to send a complete buffer over a non-blocking-capable socket for a media-streaming proxy. It works in light testing. Explain the bug, the condition that triggers it, and the fix.

Implement
send_all_chunks(payload_len: int, accept_script: list[int]) → list[int]
Examples
in[10,[4,4,4]]out[4,4,2]
in[10,[10]]out[10]
in[10,[3,0,3,-1,100]]out[3,3,4]
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 16 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.