Skip to content

Interview Solver

FeaturesPricingHelp
Sign In
FeaturesPricingHelpSign In
Interview Questions›Topics›Topological Sort

Topological Sort Interview Questions

Master 34 topological sort problems frequently asked in technical interviews. These questions test your understanding of topological sortconcepts and are essential for coding interview success.

34
Total Problems
0
Easy
15
Medium
19
Hard

Related Topics

Graph TheoryArrayDepth-First SearchBreadth-First SearchDirected Acyclic GraphDynamic ProgrammingMatrixString
#269HardFrequency: 95.2%

Alien Dictionary

Asked at Uber
ArrayStringDepth-First SearchBreadth-First SearchGraph TheoryTopological SortDirected Acyclic Graph
#1
Rank
#329HardFrequency: 92.5%

Longest Increasing Path in a Matrix

Asked at DoorDash
ArrayDynamic ProgrammingDepth-First SearchBreadth-First SearchGraph TheoryTopological SortMemoizationMatrixDirected Acyclic Graph
#2
Rank
#210MediumFrequency: 85.9%

Course Schedule II

Asked at TikTok
Depth-First SearchBreadth-First SearchGraph TheoryTopological Sort
#3
Rank
#207MediumFrequency: 82.3%

Course Schedule

Asked at TikTok
Depth-First SearchBreadth-First SearchGraph TheoryTopological SortDirected Acyclic Graph
#4
Rank
#631HardFrequency: 78.6%

Design Excel Sum Formula

Asked at Airbnb
ArrayHash TableStringGraph TheoryDesignTopological SortMatrix
#5
Rank
#1431MediumFrequency: 53.4%

All Ancestors of a Node in a Directed Acyclic Graph

Asked at Oracle
Depth-First SearchBreadth-First SearchGraph TheoryTopological SortDirected Acyclic Graph
#6
Rank
#881MediumFrequency: 50.3%

Loud and Rich

Asked at PayPal
ArrayDepth-First SearchGraph TheoryTopological SortDirected Acyclic Graph
#7
Rank
#1101MediumFrequency: 47.5%

Parallel Courses

Asked at Uber
Graph TheoryTopological SortDirected Acyclic Graph
#8
Rank
#1558MediumFrequency: 47.5%

Course Schedule IV

Asked at Uber
Depth-First SearchBreadth-First SearchGraph TheoryTopological Sort
#9
Rank
#2364HardFrequency: 44.8%

Longest Path With Different Adjacent Characters

Asked at Uber
ArrayStringTreeDepth-First SearchGraph TheoryTopological Sort
#10
Rank
#3825MediumFrequency: 42.7%

Apply Substitutions

Asked at Google
ArrayHash TableStringDepth-First SearchBreadth-First SearchGraph TheoryTopological Sort
#11
Rank
#2717HardFrequency: 41.6%

Collect Coins in a Tree

Asked at Uber
ArrayTreeGraph TheoryTopological Sort
#12
Rank
#2220MediumFrequency: 39.1%

Find All Possible Recipes from Given Supplies

Asked at TikTok
ArrayHash TableStringGraph TheoryTopological SortDirected Acyclic Graph
#13
Rank
#1177MediumFrequency: 39.1%

Tree Diameter

Asked at TikTok
TreeDepth-First SearchBreadth-First SearchGraph TheoryTopological SortDP on Trees
#14
Rank
#820MediumFrequency: 35.1%

Find Eventual Safe States

Asked at Amazon
Depth-First SearchBreadth-First SearchGraph TheoryTopological SortKosaraju's AlgorithmTarjan's SCC Algorithm
#15
Rank
#1347HardFrequency: 33.3%

Distance to a Cycle in Undirected Graph

Asked at Oracle
Depth-First SearchBreadth-First SearchGraph TheoryTopological Sort
#16
Rank
#444MediumFrequency: 31.8%

Sequence Reconstruction

Asked at Google
ArrayGraph TheoryTopological SortDirected Acyclic Graph
#17
Rank
#310MediumFrequency: 30.4%

Minimum Height Trees

Asked at Google
Depth-First SearchBreadth-First SearchGraph TheoryTopological Sort
#18
Rank
#2246HardFrequency: 29.3%

Maximum Employees to Be Invited to a Meeting

Asked at Microsoft
ArrayDynamic ProgrammingDepth-First SearchGraph TheoryTopological SortKosaraju's AlgorithmTarjan's SCC Algorithm
#19
Rank
#2176HardFrequency: 24.6%

Parallel Courses III

Asked at TikTok
ArrayDynamic ProgrammingGraph TheoryTopological SortDirected Acyclic Graph
#20
Rank
#2090MediumFrequency: 24.4%

Number of Ways to Arrive at Destination

Asked at Google
Dynamic ProgrammingGraph TheoryTopological SortShortest PathDijkstra's Algorithm
#21
Rank
#949HardFrequency: 22.1%

Cat and Mouse

Asked at Google
MathDynamic ProgrammingGraph TheoryTopological SortMemoizationMinimaxGame TheoryZero-Sum Game
#22
Rank
#1257HardFrequency: 22.1%

Rank Transform of a Matrix

Asked at Google
ArrayUnion-FindGraph TheoryTopological SortSortingMatrix
#23
Rank
#1727HardFrequency: 20.9%

Cat and Mouse II

Asked at Google
ArrayMathDynamic ProgrammingGraph TheoryTopological SortMemoizationMinimaxMatrixGame TheoryZero-Sum Game
#24
Rank
#1912MediumFrequency: 20.9%

Number of Restricted Paths From First to Last Node

Asked at Google
Dynamic ProgrammingGraph TheoryTopological SortHeap (Priority Queue)Shortest PathDijkstra's Algorithm
#25
Rank
#1986HardFrequency: 20.9%

Largest Color Value in a Directed Graph

Asked at Google
Hash TableStringDynamic ProgrammingGraph TheoryTopological SortMemoizationCountingDirected Acyclic Graph
#26
Rank
#2472HardFrequency: 20.9%

Build a Matrix With Conditions

Asked at Google
ArrayGraph TheoryTopological SortMatrixDirected Acyclic Graph
#27
Rank
#511MediumFrequency: 19.5%

All Paths from Source Lead to Destination

Asked at Google
Graph TheoryTopological SortKosaraju's AlgorithmTarjan's SCC Algorithm
#28
Rank
#1696HardFrequency: 18%

Strange Printer II

Asked at Google
ArrayGraph TheoryTopological SortMatrixDirected Acyclic Graph
#29
Rank
#2506HardFrequency: 16.4%

Minimize Maximum Value in a Grid

Asked at Google
ArrayUnion-FindGraph TheoryTopological SortSortingMatrix
#30
Rank
#2409HardFrequency: 12%

Number of Increasing Paths in a Grid

Asked at Microsoft
ArrayDynamic ProgrammingDepth-First SearchBreadth-First SearchGraph TheoryTopological SortMemoizationMatrix
#31
Rank
#3919HardFrequency: 10.3%

Network Recovery Pathways

Asked at Amazon
ArrayBinary SearchDynamic ProgrammingGraph TheoryTopological SortHeap (Priority Queue)Shortest Path
#32
Rank
#1309HardFrequency: 8.1%

Sort Items by Groups Respecting Dependencies

Asked at Google
Depth-First SearchBreadth-First SearchGraph TheoryTopological SortDirected Acyclic Graph
#33
Rank
#2439HardFrequency: 7.3%

Longest Cycle in a Graph

Asked at Microsoft
Depth-First SearchBreadth-First SearchGraph TheoryTopological SortKosaraju's AlgorithmTarjan's SCC Algorithm
#34
Rank
View All Topics

Master Topological Sort in Real Interviews

Get AI-powered assistance when solving topological sort problems during your actual interviews.

Get Started Free

No credit card required

Interview Solver
  • Home
  • About
  • Pricing
  • Sign in
  • Contact
  • Blog
  • Companion
  • Help Center
  • Developers
  • Use Cases
  • Software Engineer
  • Product Manager
  • Misc
  • Privacy Policy
  • Terms and Conditions
  • Refund & Cancellation
  • Discord Community
  • Affiliate Program
  • Compare
  • All Comparisons
  • vs Final Round AI
  • vs UltraCode
  • vs Interview Coder
  • vs LockedIn AI
  • vs AI Apply
  • Free Tools
  • ATS Resume Checker
  • STAR Method Builder
  • Salary Lookup
  • Big O Cheat Sheet
  • Total Comp Calculator
  • View All →
  • Interview Questions
  • Google Questions
  • Amazon Questions
  • Microsoft Questions
  • Meta Questions
  • Apple Questions
  • TikTok Questions
  • View All →
© 2026 Interview Solver, Inc. All rights reserved.