Code RoomSMS retry ignores transient failures
HardPrep Room Coding #1731

SMS retry ignores transient failures

Code reviewNetworking & APIsSenior–Staff~30 min

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.

0:00 of about 30 min
Mark a line and say what kind of problem it is.0 findings
1public void sendWithRetry(String phone, String body) {
2 int attempts = 0;
3 while (attempts < 3) {
4 try {
5 smsClient.send(phone, body); // POST /messages
6 return;
7 } catch (IOException e) {
8 attempts++;
9 }
10 }
11 throw new RuntimeException("sms failed");
12}
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.