Code Room
Code reviewMedium
Question
Review this Java client that calls a downstream service in a loop.
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
String fetch(String id) throws Exception { URL url = new URL("https://svc.internal/items/" + id); HttpURLConnection c = (HttpURLConnection) url.openConnection(); c.setRequestMethod("GET"); try (InputStream in = c.getInputStream()) { return new String(in.readAllBytes(), StandardCharsets.UTF_8); } finally { c.disconnect(); }}Run or narrate your approach, then ask the coach.