Code RoomConnection reset diagnosis
HardPrep Room Coding #4327

Connection reset diagnosis

Vibe & agenticAlgorithms & data structuresSenior–Staff~22 min

A Go service throws intermittent 'connection reset by peer' errors under load. You paste the stack traces and a code snippet into an AI agent and it concludes with high confidence: "Root cause: you're not setting a read timeout on the HTTP client, so slow upstreams pile up connections — add client.Timeout = 30s and it's fixed." The fix is plausible and easy. Before you ship it, how do you verify this is actually the root cause and not a coincidence?

Implement
rank_reset_hypothesis(samples: list[str]) → str
Examples
in[["reset|300|40","reset|280|45","ok|10|40","ok|12|42","ok|8|38"]]out"idle_keepalive_reuse"
in[["reset|10|5000","reset|12|4800","ok|11|100","ok|9|120"]]out"slow_upstream_timeout"
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.