Grokking the Modern Frontend System Design Interview
0% completed
Exercise: When Debounced Requests Fire
Design an Autocomplete cut 12 suggestion requests to 2 with a 250 ms debounce. Each key press clears the timer and starts it again, so a request is sent only after the input has been quiet for the whole wait. This exercise computes the moments at which those requests are sent.
The Task
Write debounceFires(keyTimes, waitMs), which returns the times, in milliseconds, at which the debounced request fires.
keyTimesholds the time of every key press, in increasing order
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%