DoorDash interview question

question about topology sort / DFS