Code RoomNested retry exceeds intended timeout
HardPrep Room Coding #2123

Nested retry exceeds intended timeout

Code reviewCode quality & reviewSenior–Staff~20 min

Review this Java client. `paymentClient` internally retries 3 times with 1s backoff (up to ~4s) before giving up.

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 20 min
Mark a line and say what kind of problem it is.0 findings
1Future<ChargeResult> f = executor.submit(() -> paymentClient.charge(req));
2try {
3 return f.get(1, TimeUnit.SECONDS);
4} catch (TimeoutException e) {
5 f.cancel(true);
6 return retryCharge(req); // our own retry: submit again, get(1s) again
7}
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.