Balance Task Assignments Across Teammates by Estimated Hours
Last updated: November 29, 2026
Quick Overview
Given tasks with hour estimates and a list of teammates, assign every task so the busiest teammate's total load is as small as possible, using a fast greedy approach suitable for an interactive workload view.
Asana
November 29, 20260
0
0 solved
Given tasks with hour estimates and a list of teammates, assign every task so the busiest teammate's total load is as small as possible, using a fast greedy approach suitable for an interactive workload view.
Asana's Workload view helps managers spread effort across a team, so 'suggest a balanced assignment' is a believable feature request. The interviewer checks heap usage, knowing that the exact problem is NP-hard, and the ability to explain why a greedy heuristic is good enough.
What the Interviewer Expects
- Recognizes this as minimum-makespan scheduling and that exact optimization is NP-hard
- Uses the longest-processing-time-first greedy with a min-heap of loads
- Breaks ties deterministically so suggestions are stable
- Shows a counterexample where greedy is not optimal
- States the 4/3 approximation bound or an equivalent intuition
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you respect existing assignments and only place new tasks?
- What if some tasks can only go to people with a certain skill tag?
- How would you compute the exact optimum for small inputs?
- How would you explain the suggestion to a manager in the UI?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: {task_gid: hours} and teammate names. Output: a mapping from teammate to tasks and the resulting maximum load. It must run instantly for a few hundred tasks and give the same answer for the s...
High-Level Design
Sort tasks by hours descending and give each to whoever currently has the least load, tracked with a min-heap of (load, name). Placing big tasks first leaves small ones to fill gaps, which is why LP...