Completing All Courses with Prerequisites
Asked at Apple · Coding Questions · Difficulty: Medium · Last asked Mar 20, 2026
A student must complete a number of courses, and some courses can only be taken after others. Decide whether there is an order in which every course can be taken so that each course's prerequisites come before it.
Loading the problem…
More Apple interview questions
- LLM conceptual questions
- Implement a Two-Hidden-Layer MLP with Backpropagation in NumPy
- Compare PPO, DPO, and GRPO
- Implement a Vision Transformer (ViT) from Scratch
- Sample from a Gaussian Distribution Using Only Uniform Sampling
- Diagnose a CTR Drop After a Ranking Model Launch