Bloomberg interview question

Topological sort question, sort classes based on prerequisite.