Prevents hanging requests. Frame the concept in practical terms so you can explain it during interview discussion.
Setting a timeout in HttpClient avoids indefinite waiting for a response, which can cause application hang-ups. It specifies a maximum time the client will wait for a response. For example, if a request to a shipping API takes too long due to server issues, a timeout ensures the request fails gracefully after a set period, allowing the app to handle the situation, such as retrying or logging an error.
Additional Notes
What does setting a timeout achieve in HttpClient?