Python data engineering interview problem. Difficulty: advanced. Pattern: Sorting. About 20 minutes. Part of the Pro drill bank.
A shift planner has a list of task efforts and a number of workers. Work should be split so no worker is overloaded relative to the others.
Assign tasks to workers in a balanced way by workload.
Input: assign_tasks([4, 2, 7, 1], 2) Output: 7 This input follows the stated rules and produces this output.
Topics: lakebench, python, greedy.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Distribute a list of tasks with varying effort across a fixed number of workers to minimize the busiest worker's load.
Assign tasks to workers in a balanced way by workload.