Code Room
Vibe codingHardvc-g051
Subject Ai iteration recoveryLevel Senior–Staff~18 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

You're using a coding agent to add idempotency to a payment-creation endpoint in a Java service. Twice it has produced code that 'works' in the happy path but reuses the idempotency key incorrectly under concurrent duplicate requests — the second request still creates a charge. Each fix tweaks the surface but misses the race. How do you diagnose why it keeps getting this wrong, and how do you re-steer or take over?

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.