DSAOne pattern at a time,animated.
Why learn DSA?
Most coding interviews give you one problem and 45 minutes. The problems change, but the patterns behind them repeat.
This course teaches you to read a problem and see its pattern: what it really asks, what its limits allow, and which approach fits.
Every solution starts with brute force and earns its way to optimal, with a moving picture at each step. The problems come from Striver's A2Z and 180 patterns sheets.
Every solution comes in Java, Python and TypeScript. Pick yours once, and every lesson follows it.
The roadmap
108 lessons in 27 chapters. Three parts, easiest first. Each part builds on the one before it. The first 18 are ready to read. The rest are on the way.
Beginner
Read a problem, measure a solution, and learn the basic moves: arrays, hashing, binary search, recursion.
11 chapters ·33 lessons ·about 13 hours
Language toolbox
3 lessonsMaths, arrays, hashing and strings
5 lessonsArrays
4 lessons- 19Largest elements and rotationssoon25 min
- 20In-place moves with two pointerssoon25 min
- 21Rearrange, leaders and next permutationsoon25 min
- 22Matrix moves: spiral, rotate and set zeroessoon30 min
Hashing
1 lesson- 23How a hash map workssoon20 min
Binary search
4 lessons- 24Binary searchsoon20 min
- 25Lower bound, upper bound, floor and ceilsoon25 min
- 26Search in a rotated sorted arraysoon30 min
- 27Binary search in a matrixsoon25 min
Strings
2 lessons- 28Parentheses and number conversionssoon20 min
- 29Longest palindromic substringsoon25 min
Linked lists
3 lessons- 30Singly linked listsoon30 min
- 31Doubly linked listsoon25 min
- 32Reverse a linked listsoon25 min
Bit manipulation
1 lesson- 33Bits and the tricks you needsoon25 min
Moderate
The core patterns, such as two pointers, sliding windows, stacks and greedy choices.
9 chapters ·32 lessons ·about 15 hours
Pattern recognition
1 lesson- 34From problem words to patternssoon30 min
Array and hashing patterns
7 lessons- 35Two sum, three sum and four sumsoon30 min
- 36Prefix sums with a hash mapsoon30 min
- 37Sort 0s, 1s and 2s in one passsoon20 min
- 38Majority element: the voting tricksoon20 min
- 39Maximum subarray: Kadane's algorithmsoon25 min
- 40Repeating, missing and merging without extra spacesoon25 min
- 41Count inversions with merge sortsoon30 min
Binary search on answers
3 lessons- 42Binary search on answerssoon30 min
- 43Minimise the largest partsoon30 min
- 44Median of two sorted arrayssoon30 min
Sliding window and two pointers
4 lessons- 45The sliding windowsoon20 min
- 46Longest window problemssoon30 min
- 47Minimum window substringsoon25 min
- 48Counting subarrayssoon30 min
Recursion and backtracking
5 lessons- 49Recursion in practicesoon25 min
- 50Subsequences: pick or skipsoon30 min
- 51Combination sum and subsetssoon30 min
- 52Backtracking: N-Queens and Sudokusoon30 min
- 53Word search and rat in a mazesoon30 min
Linked list patterns
3 lessons- 54Fast and slow pointerssoon30 min
- 55Add, split and sort linked listssoon25 min
- 56Reverse in groups, merge, flatten and clonesoon30 min
Stacks and queues
5 lessons- 57Stacks and queuessoon30 min
- 58Infix, prefix and postfixsoon25 min
- 59Monotonic stack: next greater elementsoon30 min
- 60Largest rectangle and trapping rainwatersoon30 min
- 61Min stack, LRU cache and LFU cachesoon30 min
Greedy algorithms
3 lessons- 62Greedy choicessoon25 min
- 63Scheduling and intervalssoon30 min
- 64Candy, jumps and wildcardssoon25 min
Bit tricks
1 lesson- 65XOR trickssoon30 min
Advanced
Heaps, trees, graphs, dynamic programming, tries and string matching.
7 chapters ·43 lessons ·about 20 hours
Heaps
3 lessons- 66Heaps and priority queuessoon30 min
- 67Top K problemssoon30 min
- 68Median of a stream and task schedulingsoon30 min
Binary trees
7 lessons- 69Binary trees and traversalssoon25 min
- 70Level order and iterative traversalssoon25 min
- 71Height, balance and diametersoon30 min
- 72Tree views: top, bottom, side and boundarysoon30 min
- 73Paths and the lowest common ancestorsoon30 min
- 74Build and serialise treessoon30 min
- 75Morris traversal and flatteningsoon25 min
Binary search trees
4 lessons- 76Binary search treessoon20 min
- 77Insert and delete in a BSTsoon25 min
- 78Validate, kth smallest and successorsoon30 min
- 79BST iterator, two sum and recoverysoon30 min
Graphs
12 lessons- 80Graphs and how to store themsoon25 min
- 81Breadth-first and depth-first searchsoon25 min
- 82Grids as graphs: islands and flood fillsoon30 min
- 83Many starting points: rotten orangessoon20 min
- 84Cycles and bipartite graphssoon25 min
- 85Topological sortsoon30 min
- 86Shortest paths with BFSsoon30 min
- 87Dijkstra's algorithmsoon30 min
- 88Bellman-Ford and Floyd-Warshallsoon30 min
- 89Minimum spanning treessoon25 min
- 90Disjoint set (union-find)soon30 min
- 91Strongly connected parts, bridges and cut pointssoon30 min
Dynamic programming
11 lessons- 92What is dynamic programming?soon25 min
- 931D DP: frog jump and house robbersoon30 min
- 942D DP: grids and pathssoon30 min
- 953D DP and squares in a gridsoon25 min
- 96Subset sum and partitionssoon30 min
- 97Knapsack and coin changesoon30 min
- 98Longest common subsequencesoon30 min
- 99Edit distance and pattern matchingsoon30 min
- 100Buy and sell stocksoon30 min
- 101Longest increasing subsequencesoon30 min
- 102Partition DP: matrix chain multiplicationsoon30 min
Tries
2 lessons- 103Tries: prefix treessoon30 min
- 104Tries for substrings and XORsoon30 min
Advanced strings and maths
4 lessons- 105Words, brackets and count and saysoon20 min
- 106String search with a rolling hashsoon25 min
- 107KMP and the Z-functionsoon30 min
- 108Primes with the sieve of Eratosthenessoon25 min
0/108 read. Progress stays in this browser.