Amazon Interview Question

The coding question I was asked was similar to the Course Scheduler problem in leetcode which is based on Topological Sort Algorithm on directed graphs