Execute an array of async tasks with a concurrency limit, ensuring at most N tasks run simultaneously while maintaining result order.
Asked in frontend interviews at Zomato and LinkedIn