300ms. It is fast enough to feel responsive and slow enough to skip intermediate keystrokes. For scroll throttle: 100ms. For auto-save debounce: 1000ms. Adjust based on the use case.
What delay would you use for debounce in a search input?
More FAQs in Debounce vs Throttle Interview Questions (Walmart)
Debounce delays execution until activity stops (only the last call runs, after a delay). Throttle limits to once per interval (executes at a fixed rate, ignoring calls in between).
Debounce: function debounce(fn, delay) { let timer; return function(...args) { clearTimeout(timer); timer = setTimeout(() => fn.apply(this, args), delay); }; }. Throttle: function throttle(fn, delay) { let last = 0; return function(...args) { const now = Date.now(); if (now - last >= delay) { last = now; fn.apply(this, args); } }; }.
Debounce for search input (300ms), auto-save (1000ms), form validation (500ms). Throttle for scroll (100ms), mousemove (50ms), rapid button clicks (500ms). Debounce after activity stops; throttle during activity.
Still have questions?
Browse all our FAQs or reach out to our support team
Want to upskill yourself?
Your learning library
Small steps. Big possibilities.
Find your next course. Build something great.