← All questions
MediumCoding
Course Schedule IV
Asked at
Groww
1Give yourself 5 minutes
2Answer out loud, not in your head
3Then compare with the answer below
0
Stuck? Show a way to structure it+
- 01Build directed prerequisite edges.
- 02Choose closure strategy from n and query count.
- 03Propagate prerequisite sets in topological order.
- 04Answer each query from the closure.
- 05Discuss cycles according to the contract.
Reference answer
Then expect these follow-ups
When would Floyd-Warshall be preferable?
Tests: follow-up reasoning
How would you handle a new prerequisite edge online?
Tests: follow-up reasoning
Free to read · better with Enzo
Practice this out loud with Enzo
Enzo runs it as a mock interview, pushes back with follow-ups, and grades you on the rubric.
Next question