Amazon Interview Question

Topological sorting algorithm with machine learning context