Async Control Flow

Implement Concurrency Limiter

hardJS SpecificJS / TS4 tests

Problem Statement

Implement a `ConcurrencyLimiter` class (or function) that manages async task execution, ensuring that no more than `maxConcurrency` tasks run simultaneously while queueing additional tasks.

Examples

Example:
const limiter = new ConcurrencyLimiter(2);
limiter.add(() => fetch('/api/1'));
limiter.add(() => fetch('/api/2'));
limiter.add(() => fetch('/api/3')); // Waits until 1 or 2 finishes
JavaScript & TypeScript starter code included
Run this as a live interview

Practice solo

4 test cases. No second person needed.

Get new interview exercises

Practice problems and review drills, sent when we publish new ones. No spam.

Unsubscribe anytime. We never share your address.