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

Programming Exercises

Write a program to implement a rate limiter that allows N executions per second.

Hard

Problem Statement

Write a program to implement a rate limiter that allows N executions per second.

Sample Input

Function: printMessage, Limit: 2 calls per second.

Sample Output

Message 1
Message 2
Rate limit exceeded

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
function rateLimiter(fn: Function, limit: number): Function { // Your logic here }
Log in or sign up to run or submit your code.Log inSign up
Input
Function: printMessage, Limit: 2 calls per second.
Expected Output
Message 1
Message 2
Rate limit exceeded