FastPrepCourse Schedule
Problems/Course Schedule

Course Schedule

Amazon logoAmazon● MediumFULLTIMEPHONE SCREENONSITE INTERVIEW

Updated Nov 2026

QuestionExamples

Problem statement

Source note: This problem is backed by a real Amazon onsite interview report. The report named Course Schedule and discussed graph modeling, topological sorting, and cycle detection, but it did not say whether the requested result was feasibility or an ordering and did not include a function interface, examples, or constraints. This judged version uses the feasibility form, so the core task match is about 85%.

There are numCourses courses labeled from 0 to numCourses - 1. Each pair [course, prerequisite] means the prerequisite must be completed before the course.

Return true if all courses can be completed, or false if the prerequisite graph contains a cycle.

The problem statement continues
Pro

Examples

Example 1

numCourses = 2prerequisites = [[1,0]]return = true
02 · Example 2
FastPrep Pro
Reported in 1 Amazon interview this week

Unlock this recently reported problem

FastPrep Pro gives you full access to interview problems reported within the last week.

  • Full problem statement and constraints
  • 1 more worked example, explained
  • Guided hints and editorial
  • Run your code on real test cases
$8.25/month

$99 billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week

More Amazon Onsite Interview questions

  • Assign Escalations to TeamsONSITE INTERVIEW · Seen Nov 2026
  • Best Time to Buy and Sell StockONSITE INTERVIEW · Seen Nov 2026
  • Maximum Earnings Across WarehousesONSITE INTERVIEW · Seen Nov 2026
  • Priority Message BufferONSITE INTERVIEW · Seen Nov 2026
  • Search in a Rotated Sorted ArrayPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Top K Frequent ElementsOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • LRU Cache for Query ResultsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Maximal SquareONSITE INTERVIEW · Seen Nov 2026
  • Serialize and Deserialize a Binary TreeONSITE INTERVIEW · Seen Nov 2026
  • Course Schedule IIPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Course ScheduleOracle · ONSITE INTERVIEWOracle interview questions
  • Course SchedulePlaud · ONSITE INTERVIEW
  • Course ScheduleNykaa · PHONE SCREENNykaa interview questions
  • Course ScheduleFlexTrade · ONSITE INTERVIEWFlexTrade interview questions
  • Course ScheduleBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Course Schedule FeasibilityTesla · PHONE SCREENTesla interview questions
  • Can All Courses Be FinishedC3.ai · ONSITE INTERVIEWC3.ai interview questions
  • Trace Terminal Company OwnershipPalantir · ONSITE INTERVIEWPalantir interview questions
  • Can You Finish All Courses?Intuit · OAIntuit interview questions
  • Package Install OrderVerily · ONSITE INTERVIEW

Interview reports that mention this question

  • Amazon Frontend Engineer Interviews: 21 Experiences (Part 1 of 2)

Amazon interview experiences

  • Amazon Experienced SDE Onsite Questions: 1 Experience
  • Amazon SDE Onsite Interview Questions: 9 Experiences
  • Amazon SDE II and L5 FDE Interview Questions: 4 Experiences
  • Amazon Full-Time OA Problems, Earlier Reports (Part 5 of 5)
  • Amazon Full-Time OA Problems, Recent Reports (Part 4 of 5)
See Amazon hiring insights
CodePython 3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import heapq
from collections import defaultdict
 
class Solution:
def solve(self, values, queries):
# Build the adjacency structure
n = len(values)
graph = defaultdict(list)
for u, v in queries:
graph[u].append(v)
 
best = [float("inf")] * n
heap = [(0, 0)]
while heap:
cost, node = heapq.heappop(heap)
if cost > best[node]:
continue
Run and Submit unlock with Pro
FastPrep Pro
Reported in 1 Amazon interview this week

Unlock this recently reported problem

FastPrep Pro gives you full access to interview problems reported within the last week.

  • Full problem statement and constraints
  • 1 more worked example, explained
  • Guided hints and editorial
  • Run your code on real test cases
$8.25/month

$99 billed yearly — or $19 month-to-month. Cancel anytime.

Free plan — 2 of 2 free unlocks used this week