Minimum Effort Task Schedule
Reported by candidates from Microsoft's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Microsoft reportedly served this one in July 2026, and the input size is the first thing to read. With n up to 300, trying every way to split the tasks into contiguous days blows up fast, so brute force is dead on arrival. The task is called Minimum Effort Task Schedule. You split an ordered list into exactly deadline groups and pay the max of each group. It's a partition DP, and it's the same shape as Minimum Difficulty of a Job Schedule. If you've seen that, you're fine. If you haven't, you can still get there. StealthCoder sits invisibly as a safety net if your mind goes blank mid-assessment.
The problem
A project manager is assigning a series of tasks for the team. There is a list of n tasks that need to be completed in order, and each requires a level of effort. All the tasks need to be completed within deadline days. The manager wants to plan the tasks such that there is at least one task on each day and the sum of the levels of effort of all the days is minimum. The level of effort of a day is given by the highest level of effort of any task that is performed on that day. Find this minimum sum of effort. Complete the function minimumEffort. minimumEffort has the following parameters: int efforts[n]: the order and effort required for the tasks. int deadline: the number of days in which all of the tasks must be completed. Return the minimum overall level of effort that can be achieved with optimal planning. Function minimumEffort(efforts: int[], deadline: int) → int Examples Example 1 efforts = [1, 2, 3, 4, 5] deadline = 3 return = 8 An optimal plan is: Day 1: the first task, with effort 1. Day 2: the second task, with effort 2. Day 3: the remaining tasks, with effort max(3, 4, 5) = 5. The sum of the levels of effort of all the days is 1 + 2 + 5 = 8. Return 8. Constraints 1 <= n <= 300 1 <= deadline <= n <= 300
Reported by candidates. Source: FastPrep
Pattern and pitfall
The trick is dynamic programming over prefixes. Define dp[d][i] as the minimum total effort to finish the first i tasks in exactly d days. To fill it, pick where the last day starts, call it j. The last day covers tasks j through i-1, and its cost is the max of that range. So dp[d][i] = min over j of dp[d-1][j] + max(efforts[j..i-1]). Walk j downward from i-1 and keep a running max so you don't recompute it. That gives O(deadline * n^2), which is about 27 million operations at n=300. Fine. The common pitfalls are forgetting each day needs at least one task, which means j must be at least d-1, and not handling deadline greater than n. Here deadline is at most n, so a valid plan always exists. Use a large sentinel for impossible states. If the recurrence escapes you live, StealthCoder is the hedge that reads the problem and hands you the working solution.
If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.
You can drill Minimum Effort Task Schedule cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.
Get StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as minimum difficulty of a job schedule. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass Microsoft's OA.
Microsoft reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Minimum Effort Task Schedule FAQ
How hard is Minimum Effort Task Schedule really?+
It's a medium-to-hard DP. The idea is simple once you see it, but the state definition trips people up. With n at 300, an O(deadline * n^2) solution passes comfortably. If you've done partition-into-k-groups problems, this is the same skeleton.
What's the trick to solving it?+
Define dp[d][i] as the minimum effort for the first i tasks over exactly d days. Try every start point for the last day and track a running max while scanning backward. That avoids recomputing the range max and keeps the whole thing at O(deadline * n^2).
Is there a known LeetCode version of this?+
Yes. It matches Minimum Difficulty of a Job Schedule almost exactly. Same ordered tasks, same max-per-day cost, same at-least-one-task-per-day rule. Solving that one first is the fastest prep if you only have a day or two.
What edge cases should I test before submitting?+
Test deadline equal to 1, where the answer is the global max. Test deadline equal to n, where the answer is the sum of all efforts. Also test a single task. Check that your dp never lets a day be empty, which is the usual off-by-one bug.
How do I prepare in 48 hours?+
Write the partition DP from scratch twice. Once with a plain triple loop, once with the running max optimization. Then do one or two related problems like splitting an array into k subarrays. Focus on the state definition and base cases, not memorizing code.