Async & Promises
Async Map with Concurrency Limit
hardJS SpecificJS / TS3 tests
Problem Statement
Implement `asyncParallelLimit(items, limit, asyncFn)`, which processes an array of items through an asynchronous function `asyncFn(item, index)` with at most `limit` tasks running concurrently. Results must be returned in the original order of items.
Examples
Example 1:
const fetchUser = async (id) => ({ id, name: 'User ' + id });
const users = await asyncParallelLimit([1, 2, 3, 4], 2, fetchUser);
// processes 2 at a time, returns results for 1, 2, 3, 4 in orderJavaScript & TypeScript starter code included
Run this as a live interviewPractice solo
3 test cases. No second person needed.