FastPrepAutomation Pipeline, Part 3: Stage Duration
Problems/Automation Pipeline, Part 3: Stage Duration

Automation Pipeline, Part 3: Stage Duration

Plaid logoPlaid● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamples

Problem statement

Source note: Reported in a Plaid phone screen. Our version is about 99% the same as the reported question.

This is part 3 of a three-part automation-pipeline sequence.

A single pipeline stage contains jobs whose processing times appear in job_durations. All num_workers workers are free at time 0.

Consider the jobs in array order. Assign each job to a worker that becomes free earliest, then make that worker unavailable for the job's full duration. Each job is indivisible, and each worker processes at most one job at a time.

Implement calculate_stage_duration and return the time when every job has finished. Return 0 when job_durations is empty.

Function

calculate_stage_duration(job_durations: int[], num_workers: int) → int

Examples

Example 1

job_durations = [5,2,10,4,8]num_workers = 2return = 17

The successive worker availability times are [5,0], [5,2], [5,12], [9,12], and [17,12]. All jobs finish at time 17.

Example 2

job_durations = []num_workers = 2return = 0

There are no jobs to schedule, so the stage has duration 0.

More Plaid interview questions

  • Automation Pipeline, Part 2: Stage WorkersPHONE SCREEN · Seen Jul 2026
  • Automation Pipeline, Part 1: Single WorkerPHONE SCREEN · Seen Nov 2026
  • Validate and Resolve Evaluation ChainsPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Total Pipeline Completion TimePHONE SCREEN · Seen Sep 2026
  • Rule References: Validity and EligibilityPHONE SCREEN · Seen Aug 2026
  • Bounded Token-Bucket Request QueueONSITE INTERVIEW · Seen Jul 2026
  • Token Bucket Request DecisionsONSITE INTERVIEW · Seen Jul 2026

Similar questions at other companies

  • Assign Partitions to the Least-Loaded ServersAmazon · ONSITE INTERVIEW
  • Tennis Court SchedulingAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
  • Maximum Number of Events That Can Be AttendedByteDance · PHONE SCREENByteDance interview questions
  • Defer Expenses to Preserve BalanceDRW · PHONE SCREENDRW interview questions
  • Climb Detection with Recoverable DipsStrava · PHONE SCREEN
  • Minimize Array Sum After K Halving OperationsDocuSign · PHONE SCREENDocuSign interview questions
  • Dynamic Batch Completion TimesAmbience Healthcare · PHONE SCREEN
  • Experiment Bucket Allocation and RebalancingPinterest · PHONE SCREENPinterest interview questions
  • Maximum Number of Events That Can Be AttendedSnowflake · PHONE SCREENSnowflake interview questions
  • Generate an Optimal Portfolio Trading ReportPoint72 · PHONE SCREENPoint72 interview questions

Plaid interview experiences

  • Plaid interviews · November 2026
  • Plaid OA · November 2026
All Plaid interview questionsSee Plaid hiring insights
Saved
class Solution {
    public int calculate_stage_duration(int[] job_durations, int num_workers) {
        // write your code here
    }
}
Checking account…