← Amazon questions

Kahn's Algorithm / Topological Sort

Filed under Amazon

Given a set of tasks and their dependencies, determine if it is possible to complete all tasks and return a valid ordering using Kahn's algorithm (Topological Sort).

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.