Code Room
Code reviewHardcr-g095
Subject Retry logicLevel Senior–Staff~30 minCommon in Networking & APIs interviewsIndustries Software development

Question

Review this Java retrying SMS sender.

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.

Talk through your review
Code to reviewjava
public void sendWithRetry(String phone, String body) {    int attempts = 0;    while (attempts < 3) {        try {            smsClient.send(phone, body);   // POST /messages            return;        } catch (IOException e) {            attempts++;        }    }    throw new RuntimeException("sms failed");}
Run or narrate your approach, then ask the coach.