Frontend Engineer
Implement a debounce that can be cancelled.
- 1Your approach
- 2The follow-up
- 3Reflect & learn
THE INTERVIEWER ASKS
The scenario
Implement debounce(fn, delay) so a search callback runs once after typing stops. Explain what state the wrapper keeps.
How would you approach it?
Explain your assumptions, your approach, and why you chose it.