The Minimum Processing Time problem gives you a list of processor speeds and a list of tasks, each with a processing time. Each processor can handle exactly a fixed number of tasks (say 4), and all tasks assigned to a processor finish at the same time (determined by the slowest task on that processor plus the processor speed). Your goal is to assign tasks to processors to minimize the total time for all tasks to finish. This is a classic Minimum Processing Time interview question involving greedy scheduling.
Companies like Akuna Capital, Adobe, and Nutanix ask this to evaluate greedy reasoning and sorting skills. Real-world scheduling and task allocation problems underpin systems design in distributed computing. The array, sorting, and greedy interview pattern is central, and interviewers want to see whether candidates can identify the optimal pairing strategy without exhaustive enumeration.
The optimal strategy uses sorting and greedy pairing. Sort processors in descending order (slowest first) and tasks in descending order (longest first). Assign the top-k tasks (by time) to the slowest processor, the next k tasks to the next slowest, and so on. The finish time for each group is processorSpeed + max(task times in group). Since tasks are sorted, the max in each group is always the first task assigned to it. Answer = maximum finish time across all processors.
Processors: [3, 1] (each handles 2 tasks). Tasks: [5, 4, 2, 1].
Greedy assignment problems often rely on the "match extremes" insight: pair your heaviest burden with your strongest resource. For Minimum Processing Time, always ask: which processor can afford the longest tasks without becoming the bottleneck? Sorting both lists and matching them in order is almost always the key step. Practice similar greedy scheduling problems — they form a surprisingly large portion of interview questions at mid-level companies.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| Array With Elements Not Equal to Average of Neighbors | Medium | Solve | |
| Destroying Asteroids | Medium | Solve | |
| Divide Array Into Arrays With Max Difference | Medium | Solve | |
| Eat Pizzas! | Medium | Solve | |
| Eliminate Maximum Number of Monsters | Medium | Solve |