The curated path
Everything a CS degree teaches about DSA, without the overwhelm
One concept at a time, start to finish: learn it, drill it, pass the test, then solve real problems with the guidance fading step by step, until you can spot the pattern in a problem you have never seen. Learn any concept for free. Practice and testing unlock with premium.
New here? Start at the beginning.
The path is ordered. Begin with Big-O Notation and work straight down, one module at a time.
You’re not signed in. Your progress here won’t be saved.
1Big-O Notation
Given a short piece of code, state its time complexity and explain why, out loud, without guessing.
3 steps
Big-O Notation
Given a short piece of code, state its time complexity and explain why, out loud, without guessing.
2Hash Maps
Spot when a problem needs lookup by key, and explain why a hash map turns an O(n) search into an O(1) lookup.
16 steps
Hash Maps
Spot when a problem needs lookup by key, and explain why a hash map turns an O(n) search into an O(1) lookup.
- LessonHash MapsFree
- PracticeApplied drillsFree
- TestGraded testFree
- ProblemTwo SumEasy · Hash MapFree
- DrillSpot the AI's bug: Find two numbers that add to a targetCatch the AI's mistake · Hash MapFree
- ProblemContains DuplicateEasy · SetFree
- DrillSpot the AI's bug: Detect a duplicate in a listCatch the AI's mistake · SetFree
- ProblemValid AnagramEasy · Frequency MapFree
- DrillSpot the AI's bug: Check if two strings are anagramsCatch the AI's mistake · Frequency MapFree
- ProblemRansom NoteEasy · Hash MapPremium
- DrillSpot the AI's bug: Build a note from magazine lettersCatch the AI's mistake · Frequency MapFree
- ProblemFirst Unique Character in a StringEasy · Frequency MapPremium
- ProblemGroup AnagramsMedium · Hash MapPremium
- ProblemTop K Frequent ElementsMedium · Frequency MapPremium
- ProblemLongest Consecutive SequenceMedium · SetPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelFree
3Two Pointers
Spot when two indices walking an array can replace a nested loop, and tell whether they move toward each other or in the same direction.
16 steps
Two Pointers
Spot when two indices walking an array can replace a nested loop, and tell whether they move toward each other or in the same direction.
- LessonTwo PointersFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemValid PalindromeEasy · Two PointersPremium
- DrillSpot the AI's bug: Check if a string is a palindromeCatch the AI's mistake · Two PointersPremium
- ProblemSquares of a Sorted ArrayEasy · Two PointersPremium
- DrillSpot the AI's bug: Square a sorted array, keep it sortedCatch the AI's mistake · Two PointersPremium
- ProblemTwo Sum IIMedium · Two PointersPremium
- DrillSpot the AI's bug: Two-sum on a sorted arrayCatch the AI's mistake · Two PointersPremium
- ProblemMove ZeroesEasy · Two PointersPremium
- DrillSpot the AI's bug: Move all zeroes to the endCatch the AI's mistake · Two PointersPremium
- ProblemContainer With Most WaterMedium · Two PointersPremium
- Problem3SumMedium · Two PointersPremium
- ProblemLongest Palindromic SubstringMedium · Two PointersPremium
- ProblemTrapping Rain WaterHard · Two PointersPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
4Sliding Window
Recognize a contiguous-subarray problem and maintain a window that grows and shrinks in one pass, instead of re-checking every subarray.
14 steps
Sliding Window
Recognize a contiguous-subarray problem and maintain a window that grows and shrinks in one pass, instead of re-checking every subarray.
- LessonSliding WindowFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemMaximum Average Subarray IEasy · Sliding WindowPremium
- DrillSpot the AI's bug: Highest-average window of length kCatch the AI's mistake · Sliding WindowPremium
- ProblemMinimum Size Subarray SumMedium · Sliding WindowPremium
- DrillSpot the AI's bug: Shortest subarray summing to at least targetCatch the AI's mistake · Sliding WindowPremium
- ProblemLongest Substring Without Repeating CharactersMedium · Sliding WindowPremium
- DrillSpot the AI's bug: Longest substring without repeatsCatch the AI's mistake · Sliding WindowPremium
- ProblemFruit Into BasketsMedium · Sliding WindowPremium
- ProblemPermutation in StringMedium · Sliding WindowPremium
- ProblemFind All Anagrams in a StringMedium · Sliding WindowPremium
- ProblemMinimum Window SubstringHard · Sliding WindowPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
5Prefix Sum
Precompute cumulative sums so any range total is O(1), and combine prefix sums with a hash map to count subarrays.
12 steps
Prefix Sum
Precompute cumulative sums so any range total is O(1), and combine prefix sums with a hash map to count subarrays.
- LessonPrefix SumFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemRunning Sum of 1d ArrayEasy · Prefix SumPremium
- DrillSpot the AI's bug: Running sum of an arrayCatch the AI's mistake · Prefix SumPremium
- ProblemRange Sum Query - ImmutableEasy · Prefix SumPremium
- DrillSpot the AI's bug: Sum of a range, many queriesCatch the AI's mistake · Prefix SumPremium
- ProblemFind Pivot IndexEasy · Prefix SumPremium
- DrillSpot the AI's bug: Find the pivot indexCatch the AI's mistake · Prefix SumPremium
- ProblemProduct of Array Except SelfMedium · Prefix SumPremium
- ProblemSubarray Sum Equals KMedium · Prefix SumPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
6Recursion
Read and write a simple recursive function by naming its base case and recursive case, and trace how the call stack unwinds.
16 steps
Recursion
Read and write a simple recursive function by naming its base case and recursive case, and trace how the call stack unwinds.
- LessonRecursionFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemSubsetsMedium · BacktrackingPremium
- DrillSpot the AI's bug: Generate all subsetsCatch the AI's mistake · BacktrackingPremium
- ProblemCombinationsMedium · BacktrackingPremium
- DrillSpot the AI's bug: All combinations of k from nCatch the AI's mistake · BacktrackingPremium
- ProblemPermutationsMedium · BacktrackingPremium
- DrillSpot the AI's bug: Generate all permutationsCatch the AI's mistake · BacktrackingPremium
- ProblemCombination SumMedium · BacktrackingPremium
- DrillSpot the AI's bug: Combinations that sum to a targetCatch the AI's mistake · BacktrackingPremium
- ProblemGenerate ParenthesesMedium · BacktrackingPremium
- ProblemLetter Combinations of a Phone NumberMedium · BacktrackingPremium
- ProblemPalindrome PartitioningMedium · BacktrackingPremium
- ProblemWord SearchHard · BacktrackingPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
7Binary Search
Explain why binary search needs sorted input, how halving gives O(log n), and the off-by-one traps that break it.
16 steps
Binary Search
Explain why binary search needs sorted input, how halving gives O(log n), and the off-by-one traps that break it.
- LessonBinary SearchFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemBinary SearchEasy · Binary SearchPremium
- DrillSpot the AI's bug: Find a target in a sorted listCatch the AI's mistake · Binary SearchPremium
- ProblemSearch Insert PositionEasy · Binary SearchPremium
- DrillSpot the AI's bug: Find where a target belongsCatch the AI's mistake · Binary SearchPremium
- ProblemFirst Bad VersionEasy · Binary SearchPremium
- DrillSpot the AI's bug: Find the first bad versionCatch the AI's mistake · Binary SearchPremium
- ProblemKoko Eating BananasMedium · Binary SearchPremium
- DrillSpot the AI's bug: Slowest speed to finish in timeCatch the AI's mistake · Binary SearchPremium
- ProblemFind Minimum in Rotated Sorted ArrayMedium · Binary SearchPremium
- ProblemSearch in Rotated Sorted ArrayMedium · Binary SearchPremium
- ProblemFind Peak ElementMedium · Binary SearchPremium
- ProblemSearch a 2D MatrixMedium · Binary SearchPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
8Linked Lists
Explain how nodes and pointers form a list, why reaching an element is O(n) but inserting at a known spot is O(1), and when to pick one over an array.
15 steps
Linked Lists
Explain how nodes and pointers form a list, why reaching an element is O(n) but inserting at a known spot is O(1), and when to pick one over an array.
- LessonLinked ListsFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemReverse Linked ListEasy · Linked ListPremium
- DrillSpot the AI's bug: Reverse a linked listCatch the AI's mistake · Linked ListPremium
- ProblemMiddle of the Linked ListEasy · Linked ListPremium
- DrillSpot the AI's bug: Find the middle nodeCatch the AI's mistake · Fast and Slow PointersPremium
- ProblemLinked List CycleEasy · Linked ListPremium
- DrillSpot the AI's bug: Detect a cycle in a linked listCatch the AI's mistake · Fast and Slow PointersPremium
- ProblemMerge Two Sorted ListsEasy · Linked ListPremium
- ProblemRemove Nth Node From End of ListMedium · Linked ListPremium
- ProblemAdd Two NumbersMedium · Linked ListPremium
- ProblemReorder ListMedium · Linked ListPremium
- ProblemFind the Duplicate NumberMedium · Fast and Slow PointersPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
9Stacks and Queues
Describe LIFO and FIFO ordering, the core operations of each, and recognize which problems call for a stack versus a queue.
16 steps
Stacks and Queues
Describe LIFO and FIFO ordering, the core operations of each, and recognize which problems call for a stack versus a queue.
- LessonStacks and QueuesFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemValid ParenthesesEasy · StackPremium
- DrillSpot the AI's bug: Valid parenthesesCatch the AI's mistake · StackPremium
- ProblemBaseball GameEasy · StackPremium
- DrillSpot the AI's bug: Baseball game scoreCatch the AI's mistake · StackPremium
- ProblemMin StackMedium · StackPremium
- DrillSpot the AI's bug: Min stack with O(1) getMinCatch the AI's mistake · StackPremium
- ProblemEvaluate Reverse Polish NotationMedium · StackPremium
- DrillSpot the AI's bug: Evaluate reverse Polish notationCatch the AI's mistake · StackPremium
- ProblemDaily TemperaturesMedium · StackPremium
- ProblemNext Greater Element IIMedium · StackPremium
- ProblemDecode StringMedium · StackPremium
- ProblemLargest Rectangle in HistogramHard · StackPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
10Trees and Binary Search Trees
Describe a binary tree, the BST ordering property, what in-order traversal yields, and why a balanced BST searches in O(log n) while an unbalanced one degrades to O(n).
16 steps
Trees and Binary Search Trees
Describe a binary tree, the BST ordering property, what in-order traversal yields, and why a balanced BST searches in O(log n) while an unbalanced one degrades to O(n).
- LessonTrees and Binary Search TreesFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemMaximum Depth of Binary TreeEasy · Tree TraversalPremium
- DrillSpot the AI's bug: Maximum depth of a binary treeCatch the AI's mistake · Tree TraversalPremium
- ProblemInvert Binary TreeEasy · Tree TraversalPremium
- DrillSpot the AI's bug: Invert a binary treeCatch the AI's mistake · Tree TraversalPremium
- ProblemSame TreeEasy · Tree TraversalPremium
- DrillSpot the AI's bug: Are two trees the sameCatch the AI's mistake · Tree TraversalPremium
- ProblemSymmetric TreeEasy · Tree TraversalPremium
- DrillSpot the AI's bug: Is a tree symmetricCatch the AI's mistake · Tree TraversalPremium
- ProblemBalanced Binary TreeEasy · Tree TraversalPremium
- ProblemBinary Tree Level Order TraversalMedium · Tree TraversalPremium
- ProblemValidate Binary Search TreeMedium · Tree TraversalPremium
- ProblemLowest Common Ancestor of a Binary TreeMedium · Tree TraversalPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
11Heaps and Priority Queues
Explain why a heap gives O(1) access to the min or max with O(log n) inserts and removals, why it is not fully sorted, and when to reach for one.
15 steps
Heaps and Priority Queues
Explain why a heap gives O(1) access to the min or max with O(log n) inserts and removals, why it is not fully sorted, and when to reach for one.
- LessonHeaps and Priority QueuesFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemKth Largest Element in an ArrayMedium · Heap / Priority QueuePremium
- DrillSpot the AI's bug: Kth largest elementCatch the AI's mistake · Heap / Priority QueuePremium
- ProblemK Closest Points to OriginMedium · Heap / Priority QueuePremium
- DrillSpot the AI's bug: K closest points to the originCatch the AI's mistake · Heap / Priority QueuePremium
- ProblemTop K Frequent ElementsMedium · Frequency MapPremium
- DrillSpot the AI's bug: Top k frequent elementsCatch the AI's mistake · Heap / Priority QueuePremium
- ProblemTask SchedulerMedium · GreedyPremium
- ProblemFind K Pairs with Smallest SumsMedium · Heap / Priority QueuePremium
- ProblemMerge K Sorted ListsHard · K-Way MergePremium
- ProblemFind Median from Data StreamHard · Two HeapsPremium
- ProblemIPOHard · Two HeapsPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
12Union-Find
Maintain groups under merges and answer 'are these two connected?' in near-constant time, and tell when union-find beats a fresh BFS or DFS.
12 steps
Union-Find
Maintain groups under merges and answer 'are these two connected?' in near-constant time, and tell when union-find beats a fresh BFS or DFS.
- LessonUnion-FindFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemNumber of Connected Components in an Undirected GraphMedium · Union-FindPremium
- DrillSpot the AI's bug: Count connected componentsCatch the AI's mistake · Union-FindPremium
- ProblemRedundant ConnectionMedium · Union-FindPremium
- DrillSpot the AI's bug: Find the redundant edgeCatch the AI's mistake · Union-FindPremium
- ProblemGraph Valid TreeMedium · Union-FindPremium
- DrillSpot the AI's bug: Does the graph form a treeCatch the AI's mistake · Union-FindPremium
- ProblemAccounts MergeMedium · Union-FindPremium
- ProblemNumber of Islands IIHard · Union-FindPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
13Graphs (BFS and DFS)
Describe nodes and edges, pick between an adjacency list and matrix, and choose BFS or DFS based on what the problem needs.
16 steps
Graphs (BFS and DFS)
Describe nodes and edges, pick between an adjacency list and matrix, and choose BFS or DFS based on what the problem needs.
- LessonGraphs (BFS and DFS)Free
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemFlood FillEasy · Graph TraversalPremium
- DrillSpot the AI's bug: Flood fill an imageCatch the AI's mistake · Graph TraversalPremium
- ProblemNumber of IslandsMedium · Graph TraversalPremium
- DrillSpot the AI's bug: Count the islandsCatch the AI's mistake · Graph TraversalPremium
- ProblemMax Area of IslandMedium · Graph TraversalPremium
- DrillSpot the AI's bug: Largest island by areaCatch the AI's mistake · Graph TraversalPremium
- ProblemNumber of ProvincesMedium · Graph TraversalPremium
- DrillSpot the AI's bug: Count the provincesCatch the AI's mistake · Graph TraversalPremium
- ProblemClone GraphMedium · Graph TraversalPremium
- ProblemRotting OrangesMedium · Matrix TraversalPremium
- ProblemCourse ScheduleMedium · Topological SortPremium
- ProblemPacific Atlantic Water FlowMedium · Graph TraversalPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
14Greedy
Decide when taking the locally-best choice at each step is provably safe, and recognize when it isn't and you need dynamic programming instead.
13 steps
Greedy
Decide when taking the locally-best choice at each step is provably safe, and recognize when it isn't and you need dynamic programming instead.
- LessonGreedyFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemBest Time to Buy and Sell Stock IIEasy · GreedyPremium
- DrillSpot the AI's bug: Best time to buy and sell (many trades)Catch the AI's mistake · GreedyPremium
- ProblemJump GameMedium · GreedyPremium
- DrillSpot the AI's bug: Can you reach the last indexCatch the AI's mistake · GreedyPremium
- ProblemJump Game IIMedium · GreedyPremium
- DrillSpot the AI's bug: Fewest jumps to the endCatch the AI's mistake · GreedyPremium
- ProblemGas StationMedium · GreedyPremium
- ProblemTask SchedulerMedium · GreedyPremium
- ProblemMeeting Rooms IIMedium · GreedyPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
15Sorting
Explain why naive sorts are O(n^2), the divide-and-conquer idea that gets merge sort to O(n log n), and what sorted data unlocks.
15 steps
Sorting
Explain why naive sorts are O(n^2), the divide-and-conquer idea that gets merge sort to O(n log n), and what sorted data unlocks.
- LessonSortingFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemSort an ArrayMedium · Sorting AlgorithmsPremium
- DrillSpot the AI's bug: Sort an array of numbersCatch the AI's mistake · Sorting AlgorithmsPremium
- ProblemMeeting RoomsEasy · GreedyPremium
- DrillSpot the AI's bug: Can you attend every meetingCatch the AI's mistake · Sorting AlgorithmsPremium
- ProblemMerge IntervalsMedium · IntervalsPremium
- DrillSpot the AI's bug: Merge overlapping intervalsCatch the AI's mistake · IntervalsPremium
- ProblemNon-Overlapping IntervalsMedium · GreedyPremium
- ProblemSquares of a Sorted ArrayEasy · Two PointersPremium
- ProblemFind All Numbers Disappeared in an ArrayEasy · Cyclic SortPremium
- ProblemFind All Duplicates in an ArrayMedium · Cyclic SortPremium
- ProblemFirst Missing PositiveHard · Cyclic SortPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
16Dynamic Programming
Recognize overlapping subproblems, use memoization to compute each subproblem once, and tell when a problem is a DP candidate.
16 steps
Dynamic Programming
Recognize overlapping subproblems, use memoization to compute each subproblem once, and tell when a problem is a DP candidate.
- LessonDynamic ProgrammingFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemClimbing StairsEasy · Dynamic ProgrammingPremium
- DrillSpot the AI's bug: Count ways to climb stairsCatch the AI's mistake · Dynamic ProgrammingPremium
- ProblemMin Cost Climbing StairsEasy · Dynamic ProgrammingPremium
- DrillSpot the AI's bug: Min cost climbing stairsCatch the AI's mistake · Dynamic ProgrammingPremium
- ProblemHouse RobberMedium · Dynamic ProgrammingPremium
- DrillSpot the AI's bug: House robberCatch the AI's mistake · Dynamic ProgrammingPremium
- ProblemCoin ChangeMedium · Dynamic ProgrammingPremium
- DrillSpot the AI's bug: Fewest coins for an amountCatch the AI's mistake · Dynamic ProgrammingPremium
- ProblemUnique PathsMedium · Dynamic ProgrammingPremium
- ProblemLongest Increasing SubsequenceMedium · Dynamic ProgrammingPremium
- ProblemWord BreakMedium · Dynamic ProgrammingPremium
- ProblemEdit DistanceHard · Dynamic ProgrammingPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium
17Bit Manipulation
Use the bitwise operators (especially XOR) to solve specific structured problems in O(1) space, and recognize when bits are the wrong tool.
14 steps
Bit Manipulation
Use the bitwise operators (especially XOR) to solve specific structured problems in O(1) space, and recognize when bits are the wrong tool.
- LessonBit ManipulationFree
- PracticeApplied drillsPremium
- TestGraded testPremium
- ProblemNumber of 1 BitsEasy · Bit ManipulationPremium
- DrillSpot the AI's bug: Count the set bitsCatch the AI's mistake · Bit ManipulationPremium
- ProblemSingle NumberEasy · Bit ManipulationPremium
- DrillSpot the AI's bug: The number that appears onceCatch the AI's mistake · Bit ManipulationPremium
- ProblemMissing NumberEasy · Bit ManipulationPremium
- DrillSpot the AI's bug: Find the missing numberCatch the AI's mistake · Bit ManipulationPremium
- ProblemCounting BitsEasy · Bit ManipulationPremium
- ProblemReverse BitsEasy · Bit ManipulationPremium
- ProblemSingle Number IIMedium · Bit ManipulationPremium
- ProblemMaximum Product of Word LengthsMedium · Bit ManipulationPremium
- CapstoneRecognize it cold3 cold reads · no pattern labelPremium