MEDIUMasked at 2 companies

Parallel Courses

A medium-tier problem at 62% community acceptance, tagged with Graph, Topological Sort. Reported in interviews at Snowflake and 1 others.

Founder's read

Parallel Courses hits your OA and you've got to order a dependency graph without getting tangled. Snowflake and TikTok ask this one. You're given courses with prerequisites, and you need to figure out the minimum semesters to finish them all. Most candidates see "graph" and panic, or try to brute-force the traversal. The acceptance rate sits at 62%, which means the other 38% either miss the topological sort pattern or implement it wrong. If this problem lands in your live assessment and you're not 100% on your topo-sort chops, StealthCoder solves it invisibly while you breathe.

Companies asking
2
Difficulty
MEDIUM
Acceptance
62%

Companies that ask "Parallel Courses"

If this hits your live OA

Parallel Courses is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.

Get StealthCoder
What this means

The trick is recognizing this as a graph depth problem disguised as a scheduling problem. You build an adjacency list from the prerequisites, then run a topological sort (usually Kahn's algorithm with BFS or DFS) to detect the order. The hard part most people miss: you don't just want the order, you want the depth of each node in the DAG. Each course lives at a level equal to 1 plus the maximum depth of its prerequisites. Candidates often implement topo-sort correctly but return the wrong value (order instead of depth), or forget that parallel courses at the same level mean you don't add extra semesters for them. If your live OA includes this and you blank on how to track depth during traversal, StealthCoder runs undetected and gives you the working solution on the first attempt.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Parallel Courses recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Parallel Courses interview FAQ

Is this really asked by Snowflake and TikTok as often as the stats say?+

Both companies are in the reported data for this problem. At 62% acceptance, it's not a rarity. If you're interviewing there, you should spend real time drilling topological sort by depth, not just the ordering.

What's the difference between finding the order and finding the number of levels?+

Order tells you a valid completion sequence. Levels tell you how many parallel semesters you need. This problem wants the latter. You need to track depth during traversal, not just track visited nodes.

Can I solve this with just DFS, or do I need Kahn's?+

Both work. DFS with memoization tracks depth naturally if you return max(depths of neighbors) plus one. Kahn's needs an in-degree map and a queue. Pick whichever you're faster with, but understand both for the interview.

How hard is this problem really?+

It's medium. The acceptance rate of 62% confirms it. The gap comes from not recognizing the depth-tracking requirement or misunderstanding what "parallel" means. Nail the topological sort pattern and you're done.

Do I need to detect cycles?+

The problem assumes valid input (a DAG with no cycles). Some variations require cycle detection. Check the problem statement. If cycles are possible, add validation during topo-sort to return an error early.

Want the actual problem statement? View "Parallel Courses" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.