FastPrepWork Order Critical Path
Problems/Work Order Critical Path

Work Order Critical Path

Hadrian logoHadrian● MediumFULLTIMEPHONE SCREEN

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The interview report defines a work order as a dependency DAG of identified, typed operations with durations and asks for the longest duration from a source operation to shipping. The array interface and explicit shipping identifier are execution details. Approximate source match: 91%.

A work order contains operations in a directed acyclic graph. Each operation has a unique identifier, a type label, and a positive duration in days. dependencies[i] lists the operation identifiers that must finish before operationIds[i] can start.

Every maximal dependency path ends at the operation named by shippingId. Return the maximum total duration along any dependency path that ends at shipping, including the shipping operation itself.

The type labels are descriptive metadata and do not change scheduling behavior.

Function

criticalPathDuration(operationIds: String[], operationTypes: String[], dependencies: String[][], durations: int[], shippingId: String) → int

Examples

Example 1

operationIds = ["cut","paint","inspect","ship"]operationTypes = ["FAB","FINISH","QA","SHIP"]dependencies = [[],["cut"],["paint"],["inspect"]]durations = [2,4,1,1]shippingId = "ship"return = 8

The only path to shipping lasts 2 + 4 + 1 + 1 = 8 days.

Example 2

operationIds = ["a","b","c","ship"]operationTypes = ["FAB","FAB","QA","SHIP"]dependencies = [[],[],["a"],["b","c"]]durations = [5,9,3,2]shippingId = "ship"return = 11

The branch b to ship lasts 11 days, longer than the a-to-c branch at 10 days.

Constraints

  • 1 <= operationIds.length == operationTypes.length == dependencies.length == durations.length <= 500.
  • Operation identifiers are unique nonempty ASCII strings, and shippingId names one operation.
  • Every dependency names another operation, the graph is acyclic, and every maximal path ends at shipping.
  • 1 <= durations[i] <= 100000; the answer fits a signed 32-bit integer.

More Hadrian Phone Screen questions

  • Process Graph Rule ValidationPHONE SCREEN · Seen Aug 2026

Similar questions at other companies

  • All Halfway Courses Across Course TracksCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Minimum Completion Time for DAG DependenciesAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Longest Name Chain in a Directed Acyclic GraphOscar Health · PHONE SCREEN
  • Service Dependency Load FactorsRobinhood · PHONE SCREENRobinhood interview questions
  • Longest Chain BookingAirbnb · PHONE SCREENAirbnb interview questions
  • Critical Path Through Dependent TasksModular · PHONE SCREEN · ONSITE INTERVIEW
  • Earliest Dataset Readiness in a PipelinexAI · PHONE SCREENxAI interview questions
  • Longest Path in a Directed Acyclic GraphSuno · PHONE SCREEN
  • Select Transactions with Child-Pays-for-Parent PackagesCoinbase · PHONE SCREENCoinbase interview questions
  • Choose a Road to Maximize Average Route Toll IncreaseHarness · PHONE SCREEN
All Hadrian interview questionsSee Hadrian hiring insights
Saved
class Solution {
    public int criticalPathDuration(String[] operationIds, String[] operationTypes, String[][] dependencies, int[] durations, String shippingId) {
        // Write your code here.
    }
}
Checking account…