Amazon interview question

Graph database related questions with topological sort