Code Room
Code reviewHard
Question
Review this Java helper that retries a payment POST on any failure.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
ChargeResult charge(ChargeRequest req) { for (int attempt = 0; attempt < 3; attempt++) { try { HttpResponse<String> r = client.send(post("/charges", req), ofString()); if (r.statusCode() < 500) return parse(r.body()); } catch (IOException | InterruptedException e) { // network blip — retry } } throw new ChargeException("charge failed");}Run or narrate your approach, then ask the coach.