AI Interview Prep is optimized for larger screens
Please open this on a laptop or desktop (1024px and wider) to use the full editor, whiteboard, and AI coaching surface.
Understand the problem
Restate the problem precisely. Interviewers reward candidates who pause, define the contract, and name the guarantees before coding.
There are a total of `numCourses` courses you have to take, labeled from `0` to `numCourses - 1`. You are given an array `prerequisites` where `prerequisites[i] = [aᵢ, bᵢ]` indicates that you must take course `bᵢ` first if you want to take course `aᵢ`. Return the ordering of courses you should take to finish all courses. If there are many valid answers, return any of them. If it is impossible to finish all courses, return an empty array.
Once you've drafted a response, click Submit for AI review and a senior engineer will critique your reasoning.