Code Room
Vibe codingHardvc-g083
Subject Ai prompt iterationLevel Senior–Staff~20 minCommon in Algorithms & data structures interviewsIndustries Software development, Technology

Question

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?

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.

Describe your solution

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.