Amazon interview question

algorithm topology sort in graph