Quick Overview

Determine whether every course can be completed from a list of prerequisite pairs. Use topological sorting to detect cycles in O(V + E) time, then discuss returning an order or reconstructing a cycle.

Determine Whether All Courses Can Be Completed

Company: Amazon

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

Overview: Determine whether every course can be completed from a list of prerequisite pairs. Use topological sorting to detect cycles in O(V + E) time, then discuss returning an order or reconstructing a cycle.

Read the full Amazon Software Engineer interview experience this question came from

Loading…