Reported October 2026
Unitygraph

ETL Pipeline Scheduler

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

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

The Unity OA reported in October 2026 hands you an ETL Pipeline Scheduler, and the trap is hiding in the tie-break rule. It looks like plain topological sort, and it is. But the lexicographically smallest ready job means a regular FIFO queue gives you wrong answers that still look right on the easy examples. You've got jobs, edges, and a cycle case that returns an empty array. If you blank on the ordering detail, StealthCoder is the safety net running invisibly during the live OA. Know the trick before you open the invite.

The problem

An ETL pipeline contains uniquely named jobs and dependency edges. A dependency [before, after] means job before must finish before job after can run.
Return one valid execution order. Whenever several jobs are ready, choose the lexicographically smallest job identifier so the answer is deterministic. If the dependencies contain a cycle, return an empty array.

Function
scheduleEtlPipeline(jobIds: String[], dependencies: String[][]) → String[]

Examples
Example 1
jobIds = ["extract","transform","load"]
dependencies = [["extract","transform"],["transform","load"]]
return = ["extract","transform","load"]
The dependencies force the conventional ETL order.
Example 2
jobIds = ["load_b","extract","load_a"]
dependencies = [["extract","load_a"],["extract","load_b"]]
return = ["extract","load_a","load_b"]
After extraction, both loads are ready and their identifiers determine the tie.
Example 3
jobIds = ["a","b"]
dependencies = [["a","b"],["b","a"]]
return = []
The cycle leaves no complete pipeline order.

Constraints
1 <= jobIds.length <= 20000.
Job identifiers are unique nonempty ASCII strings.
0 <= dependencies.length <= 50000; every edge contains two known, different identifiers and edges are distinct.

Reported by candidates. Source: FastPrep

Pattern and pitfall

This is Kahn's algorithm with a twist. Build an adjacency map and an indegree count for every job, including jobs with no edges. Push all zero-indegree jobs into a min-heap keyed by the identifier string. Pop the smallest, append it to the result, decrement the indegree of its children, and push any that hit zero. The pitfall is using a plain queue. It passes Example 1 and fails whenever two jobs become ready at different times. Compare strings as strings, not by length. The cycle check is simple: if the result length is less than jobIds.length, return an empty array. With 20000 jobs and 50000 edges, the heap version runs in O((V+E) log V). If you freeze mid-OA, StealthCoder can hand you this structure as a hedge, but the logic is short enough to own.

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 ETL Pipeline Scheduler 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 Unity's OA.

Unity 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.

ETL Pipeline Scheduler FAQ

What's the trick in the Unity ETL Pipeline Scheduler?+

Kahn's topological sort, but swap the queue for a min-heap so the smallest identifier among ready jobs always goes next. That single change handles the deterministic tie-break. Without it, you'll get a valid order that isn't the expected one.

How do I detect the cycle case?+

Count how many jobs you emit. If the output length is less than jobIds.length, some jobs never reached indegree zero, which means a cycle exists. Return an empty array. No separate cycle detection pass is needed.

Why does a regular queue fail here?+

A FIFO queue orders ready jobs by when they became ready, not by name. If a later-ready job has a smaller identifier than one already waiting, the queue emits the wrong one. The heap always compares the current ready set.

Do I need to handle jobs with no dependencies?+

Yes. Initialize indegree to zero for every id in jobIds, not just ones appearing in edges. Isolated jobs must still show up in the result, and they start in the heap immediately.

How do I prepare for this in 48 hours?+

Write Kahn's algorithm from memory twice, once with a queue and once with a heap. Then test a case where a small-named job unlocks late. Also practice a cyclic input. That covers every branch this problem has.

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

OA at Unity?
Invisible during screen share
Get it