Try this practice problem: you have courses and prerequisites. Each prerequisite means you must take course before course . Return any valid ordering of courses, or an empty array if it is impossible. This is topological sort. Build a directed graph where for each prerequisite.
Run Kahn's or DFS-based topological sort. If the graph has a cycle, return empty. Otherwise, return the topological order. This problem tests your ability to recognize DAG structure and apply topological sort.