14 challenges match these filters
collectNames(ids) should resolve every name and report the count and the type of the first entry, so collectNames([1,2]) gives "2-string".
Async race condition
bookSeats(n) handles n concurrent booking requests for a single remaining seat and returns how many bookings succeeded. It should never exceed 1.
Async race condition
countLoads(n) makes n concurrent calls to a cached loader and returns how many times the expensive load actually ran. It should always be 1.
Async race condition
doubleLater(value) should resolve to double the value after a short delay, so doubleLater(4) gives 8.
Async race condition
getName(id) should resolve to the loaded user's name, so getName(1) gives "user1".
Async race condition
loadAll(ids) should load every id and return all the results as an array, so loadAll([1, 2, 3]) returns [10, 20, 30].
Async race condition
tallyVotes(votes) should add up every vote, so tallyVotes([1, 2, 3, 4]) returns 10.
Async race condition
safeDivide(a, b) should return a / b, or -1 when the division fails. safeDivide(10, 0) should return -1.
Async race condition
sumAsync(nums) should add up values fetched asynchronously, so sumAsync([1, 2, 3]) returns 6.
Async race condition
labelAll(items) should return the names in the same order they were passed in, regardless of how long each one takes.
Async race condition
sumDelayed(nums) should add up numbers that each arrive asynchronously, resolving to the total.
Async race condition
doubleAll(nums) should resolve to a list with every number doubled.
Async race condition
wordLengths(words) should resolve to a list of each word's length.
Async race condition
delayedDouble(n) should asynchronously resolve to n doubled, e.g. delayedDouble(5) eventually resolves to 10.
Async race condition