Pinterest interview question

finding course order given prerequisite relationships