Connection close deferred
An AI wrote this Go helper to fetch and parse a record from a backend over a pooled TCP connection. It passes tests but the service runs out of file descriptors after a few hours under load. Find the leak, when it triggers, and the fix.
Implement
count_leaked_returns(statements: list[str]) → intExamples
in
[["acquire","write","early_return","read","early_return","defer_close","parse"]]out2in
[["acquire","defer_close","write","early_return","read","early_return"]]out0in
[["dial_error","early_return","acquire","defer_close"]]out0What 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.
Run or narrate your approach, then ask the coach.