Back to problems

Worker-Task Matching with Specialties

Algorithm · Stripe · Hard

You are building a system that assigns an ordered stream of tasks to multiple workers while keeping their workloads as balanced as possible. You receive a collection of worker names and a collection of tasks, with every task containing a unique integer id and a positive integer duration. Process the tasks in the order provided, assigning each task individually. At the time of assignment, select the worker whose current total workload—the sum of the durations of tasks already…

Checking your access…