Teradata interview question

Package dependency problem (i.e. topological sort)