Code RoomRetry flaky downstream calls correctly
HardPrep Room Coding #4049

Retry flaky downstream calls correctly

Vibe & agenticAlgorithms & data structuresSenior–Staff~20 min

You ask an AI to write a Java method that retries a flaky downstream call. It produces a clean loop with exponential backoff and `Thread.sleep`. You note it retries on every exception; it adds a catch for `IOException` only. Still wrong in prod: it retries a request that already succeeded server-side, causing duplicate charges, and it retries on a 400 that will never succeed. Two rounds in and the model keeps treating retry as a generic mechanism. What context is it missing and how do you re-steer?

Implement
plan_retry_actions(outcomes: list[str], max_attempts: int) → list[str]
Examples
in[["timeout","503","200"],5]out["retry","retry","done"]
in[["400"],3]out["fail"]
in[["timeout","timeout"],2]out["retry","exhausted"]
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 20 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.