System Design · Junior · Question 34 of 75

Why set a timeout on network requests?

Explanation

fetch has no timeout by default: a "hung" request keeps the loading indicator spinning forever. Use AbortSignal.timeout(ms) and show a clear state with a retry button.

Further reading

Problem with a question

System Design · Junior · question 34

Test yourself

Take the System Design · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz