← 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
Hiring now
Groww is hiring right now
landed applies to roles like these for you, on each company’s own site, with answers written for the role.
Get 5x interviews10 free auto-applies. No card.
Finance Content Creator
Bengaluru, India
Relationship Manager
India
Next question