← Amazon questions

Modified topological sort

Filed under Amazon

Given a Directed Acyclic Graph (DAG) with N nodes, reverse the direction of all edges. After reversing, perform a topological sort to find a valid linear ordering of the nodes. If multiple orderings…

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.