Code Room
Code reviewHard
Question
Review this Java HTTP client used for all calls to a third-party API. Occasionally threads pile up and the request pool exhausts.
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
@Configurationclass HttpConfig { @Bean RestTemplate client() { SimpleClientHttpRequestFactory f = new SimpleClientHttpRequestFactory(); f.setConnectTimeout(2000); return new RestTemplate(f); }} @Serviceclass PartnerClient { private final RestTemplate client; PartnerClient(RestTemplate client) { this.client = client; } Quote getQuote(String sku) { return client.getForObject("https://partner.example/q/" + sku, Quote.class); }}Run or narrate your approach, then ask the coach.