Maximum Number of Tasks You Can Assign
A hard-tier problem at 51% community acceptance, tagged with Array, Two Pointers, Binary Search. Reported in interviews at Walmart Labs and 2 others.
Maximum Number of Tasks You Can Assign is a hard-difficulty problem that's shown up at Walmart Labs, Coupang, and IBM. The acceptance rate is just over 50%, which means half the people who attempt it walk away empty-handed. The problem looks like a straightforward greedy task assignment problem until you realize the obvious approach fails on the actual constraints. This is exactly the kind of problem where you either see the pattern or you don't, and if you blank during the live OA, StealthCoder surfaces a working solution in seconds while the proctor sees nothing.
Companies that ask "Maximum Number of Tasks You Can Assign"
Maximum Number of Tasks You Can Assign is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.
Get StealthCoderThe trick here is recognizing that you can't just greedily assign tasks in a single pass. You need binary search on the answer combined with a greedy verification step using a monotonic queue to check if a given number of tasks is actually assignable. The problem forces you to think about task-to-person pairing under constraints, and most candidates try to brute force or apply a naive greedy strategy that doesn't hold up. The topics array shows you're dealing with Array, Two Pointers, Binary Search, Greedy, Queue, Sorting, and Monotonic Queue mechanics all at once. That layering is what makes this a 50% problem. If you hit this live and the straightforward greedy approach isn't working, StealthCoder hedges the gap between half-baked logic and a fully working solution that passes all test cases.
Pattern tags
You know the problem.
Make sure you actually pass it.
Maximum Number of Tasks You Can Assign recycles across companies for a reason. It's hard-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Maximum Number of Tasks You Can Assign interview FAQ
Why doesn't a simple greedy approach work here?+
A single-pass greedy strategy fails because task constraints are interdependent. You can't just assign the easiest task to the least skilled person. The problem requires you to check whether a specific count of tasks is feasible under all constraints, which demands binary search on the answer combined with a verification pass using monotonic queue logic.
Is this problem still asked at major companies?+
Yes. Walmart Labs, Coupang, and IBM have all asked it. The 50% acceptance rate shows it's a real screening tool that separates strong candidates from those who haven't seen the pattern. It's not a throwaway problem.
What's the role of the monotonic queue here?+
The monotonic queue optimizes the verification step when you binary search on a candidate answer. It tracks which tasks can be assigned to which people without violating constraints, avoiding a nested loop that would TLE. It's the efficiency layer that makes the solution viable.
Do I need to know all seven topics listed to solve this?+
Not all at once with equal weight. The core pattern is binary search plus greedy verification. Array and Sorting get you set up. Two Pointers and Monotonic Queue handle the verification logic. The queue part is what most people miss until they've seen the trick before.
How do I approach this if I haven't seen it before?+
Start by asking: can I verify whether a given number of tasks is assignable? Once that's clear, binary search on the answer. If your verification is O(n log n) or worse, you're probably missing the monotonic queue optimization. That's where the pattern usually breaks down.
Want the actual problem statement? View "Maximum Number of Tasks You Can Assign" on LeetCode →