Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a function to debounce an input function with immediate execution support.

Hard

Problem Statement

Write a function to debounce an input function with immediate execution support.

Sample Input

Debounced function called multiple times within 2000ms.

Sample Output

Executed at: <Timestamp>

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
function debounce(fn: Function, delay: number, immediate: boolean = false): Function { // Your logic here }
Log in or sign up to run or submit your code.Log inSign up
Input
Debounced function called multiple times within 2000ms.
Expected Output
Executed at: <Timestamp>