FastPrepTotal Pipeline Completion Time
Problems/Total Pipeline Completion Time

Total Pipeline Completion Time

Plaid logoPlaid● EasyFULLTIMEPHONE SCREEN
QuestionFunctionExamplesConstraints

Problem statement

Source note: The report directly preserves rows shaped as task time and task count and asks when all work completes. The single-worker rule and 64-bit bound make the computation deterministic and match the report at about 94%.

Each row of tasks is [taskTime, taskCount]. A single worker processes every task sequentially. Each of the taskCount tasks in that row takes exactly taskTime time units.

Return the time when all tasks from all rows have completed.

Function

totalPipelineTime(tasks: int[][]) → long

Examples

Example 1

tasks = [[3,4],[5,2]]return = 22

Four three-unit tasks and two five-unit tasks take 12 + 10 time units.

Example 2

tasks = [[7,1]]return = 7

The only task takes seven units.

Example 3

tasks = [[2,0],[4,3]]return = 12

The zero-count row contributes nothing.

Constraints

  • 1 <= tasks.length <= 10^5.
  • 0 <= taskTime, taskCount <= 10^9.
  • The answer fits a signed 64-bit integer.

More Plaid problems

  • Validate and Resolve Evaluation ChainsPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Rule References: Validity and EligibilityPHONE SCREEN · Seen Aug 2026
  • Bounded Token-Bucket Request QueueONSITE INTERVIEW · Seen Jul 2026
All Plaid interview questionsSee Plaid hiring insights
Saved
class Solution {
    public long totalPipelineTime(int[][] tasks) {
        // Write your solution here.
    }
}
Checking account…