DSAOne pattern at a time,animated.

108 lessons · 27 chapters
Start the course

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.

  1. Part 1Beginner33 lessons · 13 h
  2. Part 2Moderate32 lessons · 15 h
  3. Part 3Advanced43 lessons · 20 h
Part 1

Beginner

Read a problem, measure a solution, and learn the basic moves: arrays, hashing, binary search, recursion.

11 chapters ·33 lessons ·about 13 hours

06

Arrays

4 lessons
  1. 19Largest elements and rotationssoon25 min
  2. 20In-place moves with two pointerssoon25 min
  3. 21Rearrange, leaders and next permutationsoon25 min
  4. 22Matrix moves: spiral, rotate and set zeroessoon30 min
07

Hashing

1 lesson
  1. 23How a hash map workssoon20 min
  1. 24Binary searchsoon20 min
  2. 25Lower bound, upper bound, floor and ceilsoon25 min
  3. 26Search in a rotated sorted arraysoon30 min
  4. 27Binary search in a matrixsoon25 min
09

Strings

2 lessons
  1. 28Parentheses and number conversionssoon20 min
  2. 29Longest palindromic substringsoon25 min
10

Linked lists

3 lessons
  1. 30Singly linked listsoon30 min
  2. 31Doubly linked listsoon25 min
  3. 32Reverse a linked listsoon25 min
11

Bit manipulation

1 lesson
  1. 33Bits and the tricks you needsoon25 min
Part 2

Moderate

The core patterns, such as two pointers, sliding windows, stacks and greedy choices.

9 chapters ·32 lessons ·about 15 hours

12

Pattern recognition

1 lesson
  1. 34From problem words to patternssoon30 min
13

Array and hashing patterns

7 lessons
  1. 35Two sum, three sum and four sumsoon30 min
  2. 36Prefix sums with a hash mapsoon30 min
  3. 37Sort 0s, 1s and 2s in one passsoon20 min
  4. 38Majority element: the voting tricksoon20 min
  5. 39Maximum subarray: Kadane's algorithmsoon25 min
  6. 40Repeating, missing and merging without extra spacesoon25 min
  7. 41Count inversions with merge sortsoon30 min
14

Binary search on answers

3 lessons
  1. 42Binary search on answerssoon30 min
  2. 43Minimise the largest partsoon30 min
  3. 44Median of two sorted arrayssoon30 min
15

Sliding window and two pointers

4 lessons
  1. 45The sliding windowsoon20 min
  2. 46Longest window problemssoon30 min
  3. 47Minimum window substringsoon25 min
  4. 48Counting subarrayssoon30 min
16

Recursion and backtracking

5 lessons
  1. 49Recursion in practicesoon25 min
  2. 50Subsequences: pick or skipsoon30 min
  3. 51Combination sum and subsetssoon30 min
  4. 52Backtracking: N-Queens and Sudokusoon30 min
  5. 53Word search and rat in a mazesoon30 min
17

Linked list patterns

3 lessons
  1. 54Fast and slow pointerssoon30 min
  2. 55Add, split and sort linked listssoon25 min
  3. 56Reverse in groups, merge, flatten and clonesoon30 min
18

Stacks and queues

5 lessons
  1. 57Stacks and queuessoon30 min
  2. 58Infix, prefix and postfixsoon25 min
  3. 59Monotonic stack: next greater elementsoon30 min
  4. 60Largest rectangle and trapping rainwatersoon30 min
  5. 61Min stack, LRU cache and LFU cachesoon30 min
19

Greedy algorithms

3 lessons
  1. 62Greedy choicessoon25 min
  2. 63Scheduling and intervalssoon30 min
  3. 64Candy, jumps and wildcardssoon25 min
20

Bit tricks

1 lesson
  1. 65XOR trickssoon30 min
Part 3

Advanced

Heaps, trees, graphs, dynamic programming, tries and string matching.

7 chapters ·43 lessons ·about 20 hours

21

Heaps

3 lessons
  1. 66Heaps and priority queuessoon30 min
  2. 67Top K problemssoon30 min
  3. 68Median of a stream and task schedulingsoon30 min
22

Binary trees

7 lessons
  1. 69Binary trees and traversalssoon25 min
  2. 70Level order and iterative traversalssoon25 min
  3. 71Height, balance and diametersoon30 min
  4. 72Tree views: top, bottom, side and boundarysoon30 min
  5. 73Paths and the lowest common ancestorsoon30 min
  6. 74Build and serialise treessoon30 min
  7. 75Morris traversal and flatteningsoon25 min
23

Binary search trees

4 lessons
  1. 76Binary search treessoon20 min
  2. 77Insert and delete in a BSTsoon25 min
  3. 78Validate, kth smallest and successorsoon30 min
  4. 79BST iterator, two sum and recoverysoon30 min
24

Graphs

12 lessons
  1. 80Graphs and how to store themsoon25 min
  2. 81Breadth-first and depth-first searchsoon25 min
  3. 82Grids as graphs: islands and flood fillsoon30 min
  4. 83Many starting points: rotten orangessoon20 min
  5. 84Cycles and bipartite graphssoon25 min
  6. 85Topological sortsoon30 min
  7. 86Shortest paths with BFSsoon30 min
  8. 87Dijkstra's algorithmsoon30 min
  9. 88Bellman-Ford and Floyd-Warshallsoon30 min
  10. 89Minimum spanning treessoon25 min
  11. 90Disjoint set (union-find)soon30 min
  12. 91Strongly connected parts, bridges and cut pointssoon30 min
25

Dynamic programming

11 lessons
  1. 92What is dynamic programming?soon25 min
  2. 931D DP: frog jump and house robbersoon30 min
  3. 942D DP: grids and pathssoon30 min
  4. 953D DP and squares in a gridsoon25 min
  5. 96Subset sum and partitionssoon30 min
  6. 97Knapsack and coin changesoon30 min
  7. 98Longest common subsequencesoon30 min
  8. 99Edit distance and pattern matchingsoon30 min
  9. 100Buy and sell stocksoon30 min
  10. 101Longest increasing subsequencesoon30 min
  11. 102Partition DP: matrix chain multiplicationsoon30 min
26

Tries

2 lessons
  1. 103Tries: prefix treessoon30 min
  2. 104Tries for substrings and XORsoon30 min
27

Advanced strings and maths

4 lessons
  1. 105Words, brackets and count and saysoon20 min
  2. 106String search with a rolling hashsoon25 min
  3. 107KMP and the Z-functionsoon30 min
  4. 108Primes with the sieve of Eratosthenessoon25 min

0/108 read. Progress stays in this browser.