Skip to content
Sharp

HTTP JSON APIs · interview question

How can you ensure that a Java application using HttpClient does not suffer from resource exhaustion during network failures?

Multiple choiceHardchapter-11-curatedpremiumhttp-json-apisapi-versioning
Choose one answer
Answer and explanation

Correct answer

B. Set appropriate timeout configurations

Why

Setting appropriate timeout configurations ensures that requests will not hang indefinitely during network failures, thus preventing resource exhaustion by allowing resources to be freed after a defined period.

Test yourself on HTTP JSON APIs

A free test with instant, explained results. No account needed.

Start free test
All HTTP JSON APIs questions →