Code Room
Vibe codingMediumvc-g316
Subject Ai code reviewLevel Mid–Senior~18 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

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:

java
public <T> T withRetries(Callable<T> task, int maxAttempts) {    for (int i = 0; i < maxAttempts; i++) {        try {            return task.call();        } catch (Exception e) {            log.debug("attempt {} failed", i);        }    }    return null;}

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?

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.