Bloomberg Interview Question

Topological sort question, sort classes based on prerequisite.