Code RoomIncomplete retry contract tests
HardPrep Room Coding #4115

Incomplete retry contract tests

Vibe & agenticAlgorithms & data structuresSenior–Staff~19 min

An AI agent tested a retry wrapper around an HTTP client (Java) — it should retry on 5xx and network errors with backoff, but NOT retry on 4xx, and give up after maxAttempts. The agent mocked the client and wrote:

This is the only retry test and it passes. What does it fail to verify about the retry contract, and how would you close the gaps?

Implement
retry_decision_trace(outcomes: list[str], max_attempts: int) → list[str]
Examples
in[["io_error","200"],3]out["try:io_error","try:200","return:200"]
in[["400"],3]out["try:400","return:400"]
in[["503","503","503"],3]out["try:503","try:503","try:503","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 19 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.