Code Room
Code reviewMedium
Question
Review this Java HTTP client config used for all calls to a slow third-party API.
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
OkHttpClient client = new OkHttpClient.Builder() .connectTimeout(2, TimeUnit.SECONDS) .build(); String fetch(String url) throws IOException { try (Response r = client.newCall(new Request.Builder().url(url).build()).execute()) { return r.body().string(); }}Run or narrate your approach, then ask the coach.