Quant Memo
Coding/●●●●●

Slowest speed that still clears the queue

Your matching engine has piles of pending messages to process, one pile per symbol, sizes given as a list. In one hour a worker can process up to k messages from a single pile (if a pile has fewer than k left, that pile finishes that hour and the leftover capacity is wasted). You have H hours before the open.

piles = [3, 6, 7, 11], H = 8
answer: k = 4   (hours = 1 + 2 + 2 + 3 = 8)
k = 3 would need 1 + 2 + 3 + 4 = 10 hours

Find the smallest integer rate k that clears every pile within H hours.

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions