Check feasibility of AI course schedule
Company: Uber
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: hard
Interview Round: Onsite
Overview: This question evaluates competency in analyzing directed graphs and dependency resolution, focusing on cycle detection and the feasibility of ordering prerequisites for course completion.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: (2, [[0,1]])
Expected Output: True
Explanation: Acyclic.
Input: (2, [[0,1],[1,0]])
Expected Output: False
Explanation: Cycle.
Hints
- Use deterministic tie-breaking for prompts with multiple valid outputs.
- For design-style APIs, simulate operations with explicit inputs.