What delay does Flipkart typically expect for debounce in a search input?
300ms is the standard. It is fast enough to feel responsive and slow enough to skip intermediate keystrokes. The interviewer may ask you to justify the choice.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Debounce Interview Questions (Flipkart)
function debounce(fn, delay) { let timer; return function(...args) { clearTimeout(timer); timer = setTimeout(() => fn.apply(this, args), delay); }; }
Debounce delays execution until activity stops (search input, only the last call runs). Throttle limits to once per interval (scroll handler, calls at most once per N ms).
Use jest.useFakeTimers() to control time. Call the debounced function multiple times, advance the timer by the delay, and verify only the last call's callback executed.
Still have questions?
Browse all our FAQs or reach out to our support team
