FastPrepParallel Courses III
Problems/Parallel Courses III

Parallel Courses III

Snowflake logoSnowflake● HardFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Snowflake onsite interview. The report names the well-known task but does not copy its statement or limits. Our version is about 90% the same as the reported question.

Special thanks: 🌷 A special thank you to a lovely, amazing fren who shared that this question appeared again on November 9, 2026! (˶˃ ᵕ ˂˶) .ᐟ.ᐟ 🩵

There are n courses labeled from 1 through n. You are given prerequisite relations and the duration of every course.

Each relation [previous, next] means course previous must be completed before course next can start. Course i takes time[i - 1] months.

You may take any number of courses concurrently whenever all of their prerequisites are complete. Return the minimum number of months needed to complete every course.

Function

minimumTime(n: int, relations: int[][], time: int[]) → int

Examples

Example 1

n = 3relations = [[1,3],[2,3]]time = [3,2,5]return = 8

Courses 1 and 2 start together. Course 3 starts after month 3, when both prerequisites are complete, and finishes five months later at month 8.

Example 2

n = 5relations = [[1,5],[2,5],[3,5],[3,4],[4,5]]time = [1,2,3,4,5]return = 12

The critical chain is course 3, then course 4, then course 5, with total duration 3 + 4 + 5 = 12.

Constraints

  • 1 <= n <= 5 * 10^4
  • 0 <= relations.length <= min(n * (n - 1) / 2, 5 * 10^4)
  • Every relation contains two distinct course labels between 1 and n.
  • All relations are unique, and the prerequisite graph is acyclic.
  • time.length == n
  • 1 <= time[i] <= 10^4

More Snowflake interview questions

  • Configurable Per-Client Token BucketsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • LFU CacheOA · ONSITE INTERVIEW · Seen Nov 2026
  • Sliding-Window Rate LimiterONSITE INTERVIEW · Seen Sep 2026
  • Execute Tasks by PriorityONSITE INTERVIEW · Seen Aug 2026
  • Priority Task Execution with Duplicate IDsONSITE INTERVIEW · Seen Aug 2026
  • Design In-Memory File SystemPHONE SCREEN · Seen Nov 2026
  • Merge Two Binary TreesPHONE SCREEN · Seen Nov 2026
  • Connect Four from the Last MovePHONE SCREEN · Seen Nov 2026
  • Minimum Edits to a Perfect Binary TreePHONE SCREEN · Seen Nov 2026
  • Safest Shortest Path Through a GridOA · Seen Nov 2026

Similar questions at other companies

  • Minimum Semesters With Course CapacityAmazon · ONSITE INTERVIEW
  • Parallel Courses IIIGoogle · ONSITE INTERVIEWGoogle interview questions
  • Minimum Time to Complete Target CoursesMeta · ONSITE INTERVIEWMeta interview questions
  • Critical Path Through Dependent TasksModular · PHONE SCREEN · ONSITE INTERVIEW
  • Select Transactions with Child-Pays-for-Parent PackagesCoinbase · PHONE SCREENCoinbase interview questions
  • Choose a Road to Maximize Average Route Toll IncreaseHarness · PHONE SCREEN
  • Parallel Courses with DurationsCitadel · PHONE SCREENCitadel interview questions
  • All Halfway Courses Across Course TracksCrunchyroll · PHONE SCREENCrunchyroll interview questions
  • Work Order Critical PathHadrian · PHONE SCREENHadrian interview questions
  • Longest Name Chain in a Directed Acyclic GraphOscar Health · PHONE SCREEN

Snowflake interview experiences

  • Snowflake AI Coding Interview, Experienced Hires: 3 Experiences
All Snowflake interview questionsSee Snowflake hiring insights
Saved
class Solution {
    public int minimumTime(int n, int[][] relations, int[] time) {
        // Write your code here.
    }
}
Checking account…