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
Coding & Algorithms
Software Engineer
Asana
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

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
heaps
greedy algorithms
load balancing
approximation
scheduling
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. 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 Problems
Sample 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...


Submit Your Answer
Markdown supported