FastPrepEarliest Concurrent Workflow Stages
Problems/Earliest Concurrent Workflow Stages

Earliest Concurrent Workflow Stages

Intuit logoIntuit● MediumNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Intuit new grad online assessment. The challenge says the function should return a list of lists, with each list as one stage. Each step should run in the earliest possible stage.

The report allows any order inside a stage. Here, names sort in ASCII order, repeated dependencies count once, and the input has limits.

Our version is about 95% the same as the full report.

Each pair [before, after] in precursorSteps says the first workflow step must finish before the second may begin. The pairs can arrive in any order.

Return a list of stages, each itself a list of step names. All steps in a stage run concurrently. Every step must appear exactly once, in its earliest possible stage: a step with no prerequisites belongs to stage 0, and every other step belongs one stage after its latest prerequisite.

Include exactly the names mentioned in the pairs. Empty input returns an empty list of stages. For this exercise, assume repeated copies of the same dependency count once, and sort names within each stage in ascending ASCII order. Preserve the names exactly, including case and internal spaces.

Function

createWorkflowStages(precursorSteps: String[][]) → String[][]

Examples

Example 1

precursorSteps = [["clean","build"],["metadata","binary"],["build","link"],["link","binary"],["clean","metadata"],["build","resources"]]return = [["clean"],["build","metadata"],["link","resources"],["binary"]]

Clean starts in stage 0. Build and metadata follow in stage 1. Link and resources then start in stage 2. Binary waits for both metadata and link, so its earliest stage is 3.

Example 2

precursorSteps = [["boil","serve"],["chop","boil"],["stir","boil"],["set table","serve"]]return = [["chop","set table","stir"],["boil"],["serve"]]

Chop, set table, and stir have no prerequisites. Boil follows chop and stir. Serve must wait for boil, so it starts in stage 2 even though set table finishes earlier.

Constraints

  • For this exercise, assume 0 <= precursorSteps.length <= 500.
  • Every pair contains exactly two step names.
  • Each name has 1 to 50 printable ASCII characters and contains at least one non-space character.
  • The directed dependency graph is acyclic.

More Intuit Online Assessment questions

  • Employee Promotion OpportunitiesOA · Seen Oct 2026
  • Next Pascal Row CoefficientOA · Seen Oct 2026
  • Parse Router LogsOA · Seen Oct 2026
  • Longest Repeated Letter Block with Adjacent SwapsOA · Seen Oct 2026
  • Maximum Square-Free DivisorOA · Seen Oct 2026
  • Two Tribes from Taller-Person CountsOA · Seen Oct 2026
  • Shortest Path from an Encoded GraphOA · Seen Sep 2026
  • Oldest and Youngest EmployeesOA · Seen Sep 2026
  • Pressure-Isolation Shutdown OrderOA · Seen Sep 2026
  • Submask Sum QueriesOA · Seen Sep 2026

Similar questions at other companies

  • Package Install OrderVerily · ONSITE INTERVIEW
  • Task Build Order and File-Change RerunsVanta · PHONE SCREEN
  • Topological Sort with Secondary OrderingRoblox · PHONE SCREEN · ONSITE INTERVIEWRoblox interview questions
  • Evaluate Formulas with Cycle DetectionInstacart · PHONE SCREEN · ONSITE INTERVIEWInstacart interview questions
  • Available Recipes from Initial SuppliesAmazon · PHONE SCREEN
  • Validate CSV References and Field DependenciesStripe · PHONE SCREENStripe interview questions
  • Recipes You Can PrepareIndeed · PHONE SCREENIndeed interview questions
  • Data Pipeline Steps with Search and Run OrderRippling · PHONE SCREENRippling interview questions
  • Propagate Spreadsheet Cell UpdatesOpenAI · PHONE SCREENOpenAI interview questions
  • Lexicographically Smallest Topological OrderCoinbase · PHONE SCREENCoinbase interview questions

Interview reports that mention this question

  • Intuit OA: What It Tests (2026)

Intuit interview experiences

  • Intuit Software Engineering Intern - Full Stack OA Format
All Intuit interview questionsSee Intuit hiring insights
Saved
class Solution {
    public String[][] createWorkflowStages(String[][] precursorSteps) {
        // Write your code here
    }
}
Checking account…