Reported September 2026
IBMgraph

Flight Delay Propagation

Reported by candidates from IBM's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live IBM OA. Under 2s to a working solution.
Founder's read

The mistake that sinks a first attempt on this IBM question, reported in September 2026, is walking the dependency edges in the wrong direction. Flight Delay Propagation looks like a story problem, but it's a plain graph reachability task. You get flightFrom and flightTo arrays, a list of initially delayed flights, and you return every flight that ends up delayed, sorted. If you read the edge as from-to and spread delay forward, you'll fail example 2 immediately. This page gives you the direction, the traversal, and the edge cases. If you freeze during the live OA, StealthCoder is the silent backup that reads the problem and hands you a working solution.

The problem

A network contains flightNodes flights, numbered from 1 through flightNodes. Dependencies are given by the parallel arrays flightFrom and flightTo.
For every index i, flight flightFrom[i] cannot depart until flight flightTo[i] has landed. Therefore, if flightTo[i] is delayed, flightFrom[i] also becomes delayed. That new delay propagates transitively to every flight that depends on it.
The array delayed lists the initially delayed flights. Return every flight that is initially delayed or becomes delayed through the dependency network. Include each flight exactly once and return the IDs in ascending order.

Function
propagateFlightDelays(flightNodes: int, flightFrom: int[], flightTo: int[], delayed: int[]) → int[]

Examples
Example 1
flightNodes = 6
flightFrom = [2,3,4,5]
flightTo = [1,2,2,4]
delayed = [1]
return = [1,2,3,4,5]
Flight 1 delays flight 2. Flight 2 then delays flights 3 and 4, and flight 4 delays flight 5. Flight 6 is unaffected.
Example 2
flightNodes = 5
flightFrom = [1,2,3,4]
flightTo = [2,3,4,5]
delayed = [5]
return = [1,2,3,4,5]
Flight 5 delays flight 4, which delays 3, then 2, then 1. The direction follows from flightTo[i] to its dependent flightFrom[i].
Example 3
flightNodes = 6
flightFrom = [2,2,3,5,6,6]
flightTo = [1,1,2,4,5,5]
delayed = [4,4]
return = [4,5,6]
The repeated initial ID and repeated dependency pairs have no extra effect. The delay spreads from flight 4 to 5 and then to 6.

Constraints
2 <= flightNodes <= 10^5.
flightFrom.length = flightTo.length.
Every value in flightFrom, flightTo, and delayed is between 1 and flightNodes, inclusive.
Dependency pairs and initially delayed IDs may be repeated; repetitions do not duplicate an ID in the result.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is the edge direction. Flight flightFrom[i] depends on flightTo[i], so delay travels from flightTo[i] to flightFrom[i]. Build an adjacency list keyed by flightTo, with flightFrom as the neighbor. Then run BFS or DFS from every initially delayed flight, using a visited array of size flightNodes + 1. Collect the visited IDs by scanning 1 through flightNodes, which gives ascending order for free and skips a sort. Duplicates in edges and in delayed are harmless because the visited check absorbs them. Pitfall one is reversing the edges. Pitfall two is recursive DFS on a chain of 10^5 flights, which can overflow the stack in some languages, so use an iterative queue or stack. Total work is O(V + E). If you blank mid-assessment, StealthCoder is the hedge that runs invisibly and gives you the multi-source BFS fast.

If you see this problem in your OA tomorrow, the play is to recognize the pattern in 30 seconds. StealthCoder buys you that recognition.

If this hits your live OA

You can drill Flight Delay Propagation cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass IBM's OA.

IBM reuses patterns across OAs. Built by an Amazon engineer who passed his OA cold and still thinks the filter is broken. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Flight Delay Propagation FAQ

What's the trick in the IBM Flight Delay Propagation problem?+

Edge direction. Delay flows from flightTo[i] to flightFrom[i], because flightFrom waits on flightTo. Build the graph with flightTo as the key and flightFrom as the neighbor, then run a multi-source BFS or DFS from all delayed flights. Check example 2 against your direction before submitting.

How hard is this problem really?+

Easy to medium. It's graph reachability with one twist, the reversed direction. If you've done a BFS on an adjacency list, you can solve it in about 15 minutes. Most failures come from misreading the dependency direction, not from algorithm difficulty.

Do I need to sort the output?+

Not explicitly. Loop IDs from 1 to flightNodes and append each one that's marked visited. That produces ascending order in O(V) time. It also guarantees each flight appears exactly once, which matters because the delayed list can contain duplicates.

Will recursion work with 10^5 flights?+

It can break. A single chain of 10^5 dependencies means recursion depth of 10^5, which overflows the stack in several languages. Use an iterative BFS with a queue or an explicit stack for DFS. Mark nodes visited when you push them, not when you pop.

How do I prepare for this in 48 hours?+

Write a multi-source BFS on an adjacency list from scratch twice. Then practice reversing edge direction on a small example by hand. Test on duplicate edges, duplicate delayed IDs, and a long chain. That covers every trap this IBM question sets.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with IBM.

OA at IBM?
Invisible during screen share
Get it