← Google questions

Calculate semesters needed to complete courses with prerequisites

Filed under Google

Given a course completion dependency where a prerequisite must be finished before the target course, calculate the total number of semesters needed to complete all courses using topological sorting.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Google questions

Collected from public candidate posts and coding forums. Updated Nov 2026.