Domanda di colloquio di Uber

Make a Scheduler in javascript with some given concurrency.

Risposta di colloquio

Anonimo

19 ott 2018

Just make a function which would take a concurrency integer argument and return an AddTask function. As and when you call a function (task) increase a pointer by 1. Once it's equal to concurrency number, push it to an array. Once done, reduce the RunningTask variable by one.