Problems
Callback's own problems and the LeetCode questions companies have been asking, in one place — pick a category, then filter by company, frequency, status, difficulty, topic, and language.
- Topological Sort49
- Array1842
- String778
- Hash Table749
- Math565
- Dynamic Programming534
- Sorting483
- Greedy401
- Depth-First Search338
- Binary Search305
- Matrix267
- Breadth-First Search261
Algorithms & Data Structures · Cycle detection dressed up as a scheduling question.
Algorithms & Data Structures · Kahn's algorithm: peel sensors with no pending inputs; leftovers mean a cycle.
Algorithms & Data Structures · Courses run in waves, and a wave takes as long as its slowest course.
Algorithms & Data Structures · Topological order with a 26-bit mask per node: inherited = AND of the parents, final = (inherited OR allow) AND NOT disallow.
Algorithms & Data Structures · A course may start once any one prerequisite is done: swap the max for a min and relax in topological order.
Algorithms & Data Structures · Kahn's queue over course objects; a failed attempt goes to the back of the queue and its dependants stay locked until it passes.
Algorithms & Data Structures · Allows flow down from every ancestor and a disallow stays local: OR the parents' allow sets in topological order, then subtract the node's own disallow.
Algorithms & Data Structures · Both allows and denies flow down the DAG as letter sets; a node's letters are its inherited allows minus its inherited denies.
Prerequisite Route to a Target Course
Algorithms & Data Structures · Collect the courses the target depends on, then order just those with a smallest-first topological sort; a cycle among them means no route.
Algorithms & Data Structures · Two bits flow down the DAG, allowed and denied; a node has access when it inherited an allow and no deny.
Algorithms & Data Structures · Insertion-ordered tasks with a dependency set each: refuse an edge that would close a cycle, emit the earliest ready task, and copy both structures.
Algorithms & Data Structures · Kahn's algorithm with a min-heap in place of the queue: in-degrees, a frontier of ready nodes, and an empty result when a node never becomes ready.
Order Validator With Rule Dependencies
Algorithms & Data Structures · Validation rules form a DAG: a rule is skipped when a prerequisite did not pass, a dependency that would close a cycle is refused, and removing a rule reconnects its prerequisites to its dependents.
Asked on LeetCode
36 questions tagged Topological Sort · all time
- Course Schedule IImediumDepth-First SearchBreadth-First SearchGraph TheoryTopological Sort25 companies
- Course SchedulemediumDepth-First SearchBreadth-First SearchGraph TheoryTopological Sort+123 companies
- Alien DictionaryhardArrayStringDepth-First SearchBreadth-First Search+316 companies
- Longest Increasing Path in a MatrixhardArrayDynamic ProgrammingDepth-First SearchBreadth-First Search+512 companies
- Parallel Courses IIIhardArrayDynamic ProgrammingGraph TheoryTopological Sort+19 companies
- Design Excel Sum FormulahardArrayHash TableStringGraph Theory+38 companies
- Find Eventual Safe StatesmediumDepth-First SearchBreadth-First SearchGraph TheoryTopological Sort+28 companies
- Parallel CoursesmediumGraph TheoryTopological SortDirected Acyclic Graph7 companies
- Tree DiametermediumTreeDepth-First SearchBreadth-First SearchGraph Theory+27 companies
- Collect Coins in a TreehardArrayTreeGraph TheoryTopological Sort6 companies
- Find All Possible Recipes from Given SuppliesmediumArrayHash TableStringGraph Theory+26 companies
- Minimum Height TreesmediumDepth-First SearchBreadth-First SearchGraph TheoryTopological Sort6 companies
- Sort Items by Groups Respecting DependencieshardDepth-First SearchBreadth-First SearchGraph TheoryTopological Sort+15 companies
- Longest Cycle in a GraphhardDepth-First SearchBreadth-First SearchGraph TheoryTopological Sort+25 companies
- Course Schedule IVmediumDepth-First SearchBreadth-First SearchGraph TheoryTopological Sort5 companies
- Number of Ways to Arrive at DestinationmediumDynamic ProgrammingGraph TheoryTopological SortShortest Path+15 companies
- Longest Path With Different Adjacent CharactershardArrayStringTreeDepth-First Search+24 companies
- Loud and RichmediumArrayDepth-First SearchGraph TheoryTopological Sort+14 companies
- Largest Color Value in a Directed GraphhardHash TableStringDynamic ProgrammingGraph Theory+44 companies
- Rank Transform of a MatrixhardArrayUnion-FindGraph TheoryTopological Sort+23 companies
- Sequence ReconstructionmediumArrayGraph TheoryTopological SortDirected Acyclic Graph3 companies
- Maximum Employees to Be Invited to a MeetinghardArrayDynamic ProgrammingDepth-First SearchGraph Theory+33 companies
- All Ancestors of a Node in a Directed Acyclic GraphmediumDepth-First SearchBreadth-First SearchGraph TheoryTopological Sort+13 companies
- Number of Increasing Paths in a GridhardArrayDynamic ProgrammingDepth-First SearchBreadth-First Search+42 companies
- Cat and MousehardMathDynamic ProgrammingGraph TheoryTopological Sort+42 companies
- All Paths from Source Lead to DestinationmediumGraph TheoryTopological SortKosaraju's AlgorithmTarjan's SCC Algorithm2 companies
- Network Recovery PathwayshardArrayBinary SearchDynamic ProgrammingGraph Theory+32 companies
- Count Ways to Build Rooms in an Ant ColonyhardArrayMathDynamic ProgrammingTree+61 company
- Minimum Runes to Add to Cast SpellhardArrayDepth-First SearchBreadth-First SearchGraph Theory+11 company
- Apply SubstitutionsmediumArrayHash TableStringDepth-First Search+31 company
- Build a Matrix With ConditionshardArrayGraph TheoryTopological SortMatrix+11 company
- Cat and Mouse IIhardArrayMathDynamic ProgrammingGraph Theory+61 company
- Number of Restricted Paths From First to Last NodemediumDynamic ProgrammingGraph TheoryTopological SortHeap (Priority Queue)+21 company
- Strange Printer IIhardArrayGraph TheoryTopological SortMatrix+11 company
- Minimize Maximum Value in a GridhardArrayUnion-FindGraph TheoryTopological Sort+21 company
- Distance to a Cycle in Undirected GraphhardDepth-First SearchBreadth-First SearchGraph TheoryTopological Sort1 company
Listings only — titles, difficulty, and tags link out to LeetCode. Imported from the leetcode-company-wise-problems snapshot dated 1 June 2025. Frequency is that dataset's own relative score within a company and time range.