Pregunta de entrevista de Bloomberg

Topological sort question, sort classes based on prerequisite.