Code RoomRetry helper returns null
MediumPrep Room Coding #4255

Retry helper returns null

Vibe & agenticAlgorithms & data structuresMid–Senior~18 min

You're the staff engineer doing a sampling audit of agent contributions across your Java services after noticing a rise in silent production failures. This retry helper, generated by an agent and copy-pasted into several services, is a representative sample:

What's wrong here, and given it's already spread across services, how do you run the audit and remediation as a leadership task rather than a one-off fix?

Implement
retry_plan(attempt_results: list[str], max_attempts: int, base_delay_ms: int, max_delay_ms: int) → list[str]
Examples
in[["retryable","ok"],3,100,1000]out["try:retryable","sleep:100","try:ok","return:ok"]
in[["fatal"],3,100,1000]out["try:fatal","throw:non_retryable"]
in[["retryable","retryable","retryable"],3,100,250]out["try:retryable","sleep:100","try:retryable","sleep:200","try:retryable","throw: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 18 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.