PracHub
QuestionsLearningGuidesInterview Prep
|Home/Coding & Algorithms/Plaid

Calculate Ordered Job Makespan Across Parallel Workers

Last updated: Jul 22, 2026

Quick Overview

Find the makespan when ordered jobs with different durations are dispatched to a fixed pool of identical workers. The exercise tests event-driven scheduling, tie handling, choosing an efficient representation of worker availability, empty workloads, excess workers, and 64-bit runtime bounds.

  • medium
  • Plaid
  • Coding & Algorithms
  • Software Engineer

Calculate Ordered Job Makespan Across Parallel Workers

Company: Plaid

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

# Calculate Ordered Job Makespan Across Parallel Workers A single stage has jobs with different durations and a fixed number of identical workers. Jobs must be assigned in the order they appear. At time 0, assign jobs in order to available workers. Whenever a worker finishes, immediately assign that worker the next unassigned job. A job cannot be split or processed by more than one worker. Return the time when all jobs are complete. ## Function Signature ```python def calculate_stage_duration(job_durations: list[int], num_workers: int) -> int: ``` ## Inputs - `job_durations[i]` is the positive integer duration of job `i`. - `num_workers` is the number of identical workers available at time 0. - If several workers become free at the same time, any of those tied workers may receive the next job; this does not change the makespan. ## Output Return the makespan, the earliest time at which all jobs have completed. Return `0` when there are no jobs. ## Constraints - `0 <= len(job_durations) <= 200_000` - `1 <= job_durations[i] <= 10^9` - `1 <= num_workers <= 200_000` - The result fits in a signed 64-bit integer. - The input array must not be mutated. ## Examples ```text job_durations = [5, 2, 10, 4, 8] num_workers = 2 output = 17 ``` ```text job_durations = [4, 7] num_workers = 5 output = 7 ``` ```text job_durations = [] num_workers = 3 output = 0 ```

Quick Answer: Find the makespan when ordered jobs with different durations are dispatched to a fixed pool of identical workers. The exercise tests event-driven scheduling, tie handling, choosing an efficient representation of worker availability, empty workloads, excess workers, and 64-bit runtime bounds.

Related Interview Questions

  • Count Completed Jobs in a Serial Multi-Worker Pipeline - Plaid (medium)
  • Count Completed Jobs in a Serial Single-Worker Pipeline - Plaid (medium)
  • Find Banks From Identifier Mappings - Plaid (medium)
  • Resolve routing-number to bank mapping - Plaid (easy)
|Home/Coding & Algorithms/Plaid

Calculate Ordered Job Makespan Across Parallel Workers

Plaid logo
Plaid
Jul 13, 2026, 12:00 AM
mediumSoftware EngineerTechnical ScreenCoding & Algorithms
2
0

Calculate Ordered Job Makespan Across Parallel Workers

A single stage has jobs with different durations and a fixed number of identical workers. Jobs must be assigned in the order they appear. At time 0, assign jobs in order to available workers. Whenever a worker finishes, immediately assign that worker the next unassigned job. A job cannot be split or processed by more than one worker. Return the time when all jobs are complete.

Function Signature

def calculate_stage_duration(job_durations: list[int], num_workers: int) -> int:

Inputs

  • job_durations[i] is the positive integer duration of job i .
  • num_workers is the number of identical workers available at time 0.
  • If several workers become free at the same time, any of those tied workers may receive the next job; this does not change the makespan.

Output

Return the makespan, the earliest time at which all jobs have completed. Return 0 when there are no jobs.

Constraints

  • 0 <= len(job_durations) <= 200_000
  • 1 <= job_durations[i] <= 10^9
  • 1 <= num_workers <= 200_000
  • The result fits in a signed 64-bit integer.
  • The input array must not be mutated.

Examples

job_durations = [5, 2, 10, 4, 8]
num_workers = 2
output = 17
job_durations = [4, 7]
num_workers = 5
output = 7
job_durations = []
num_workers = 3
output = 0

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Plaid•More Software Engineer•Plaid Software Engineer•Plaid Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.