System Design · Junior · Question 17 of 75
Why use debounce in search-as-you-type?
- ✓Correct answer: To send a request after a pause in typing rather than on every character
- 2To send requests in parallel so they return faster
- 3To make the browser cache search responses forever
Explanation
Without debounce, the word "sneakers" produces 8 requests. A 200–300 ms delay reduces server load. Additionally, stale requests are cancelled (AbortController) so an old response doesn't overwrite a new one, and results are cached.