DSA roadmap

Learn data structures and algorithms, end to end

21 chapters, 70 topics, ~514 problems. Read a lesson, solve the exercise, take a quiz. Your code compiles and runs in your browser — C++, Python and JavaScript today, Java soon.

2 courses live9 lessons authored100% in-browser execution
Step 1

Learn the Basics

54 problems

Language fundamentals, time/space complexity, and the hashing intuition every other step rides on.

Language Fundamentals
soon

Variables, control flow, I/O, functions, and arrays in C++, Java, JavaScript, and Python.

Time and Space Complexity
soon

Big-O notation, common growth classes, how to reason about loops, recursion, and amortized costs.

Hashing
soon

Hash maps, hash sets, frequency counting, the classic two-sum pattern.

Step 2

Sorting Techniques

7 problems

Build every classic sort from scratch. Then understand why we use the built-in sort for almost everything else.

Elementary Sorts
soon

Selection, bubble, insertion. Quadratic but instructive.

Efficient Sorts
soon

Merge sort, quick sort. The recursive sorts that get you to O(n log n).

Step 3

Arrays

40 problems1 live

The most important data structure. Master the patterns here and binary search, two pointer, sliding window all click later.

Arrays — Easy
ready

Linear scans, two-pass tricks, basic counting. The warmup problems.

Arrays — Medium
soon

Kadane, Dutch national flag, majority element, set matrix zeroes, rotations.

Arrays — Hard
soon

Merge intervals, count inversions, median of two sorted arrays, reverse pairs.

Step 4

Binary Search

32 problems

Binary search isn't just for sorted arrays. Learn to recognize the monotonic predicate and you'll see binary search everywhere.

Binary Search on 1D Arrays
soon

Classic lower bound, upper bound, first and last occurrence, rotated arrays.

Binary Search on the Answer
soon

Search over a range of possible answers. Aggressive cows, koko eating bananas, painter's partition.

Binary Search on 2D Matrices
soon

Row-column elimination, treating a matrix as a flattened sorted array.

Step 5

Strings — Basic and Medium

15 problems

Character manipulation, palindromes, anagrams. The classic warmup before advanced string algorithms.

String Basics
soon

Reverse, palindrome check, anagram check, longest common prefix.

String Medium
soon

Roman to integer, group anagrams, longest substring without repeating, sort by frequency.

Step 6

Linked Lists

31 problems1 live

Pointer manipulation that carries over to trees, graphs, allocators, parsers. Master the dummy node + two pointer patterns.

Singly Linked List
ready

Build the data structure. Insertions, deletions, reversal, the most asked DSA topic in interviews.

Doubly Linked List
soon

Prev + next pointers. The data structure behind LRU caches and browser history.

Linked List Medium
soon

Floyd's cycle detection, merge two sorted, remove nth from end, palindrome check, intersection.

Linked List Hard
soon

Reverse in k-groups, copy list with random pointer, sort, flatten a multilevel list.

Step 7

Recursion

25 problems

Pattern by pattern. Once you internalize parametrized recursion, backtracking and dynamic programming both stop being scary.

Recursion Basics
soon

Print 1 to N, factorial, sum of N, recursion tree intuition.

Subsequences and Subsets
soon

Power set, subsequences with sum K, count subsequences, the take-or-skip pattern.

Backtracking
soon

N-queens, sudoku solver, rat in a maze, word break, palindrome partitioning.

Step 8

Bit Manipulation

18 problems

Bitwise tricks that turn O(n) lookups into O(1) and unlock subset enumeration, parity, XOR.

Bit Basics
soon

AND, OR, XOR, shift, set/clear/toggle the i-th bit.

Bit Tricks
soon

Count set bits, single non-repeating, XOR of range, power of two, n divisors.

Step 9

Stacks and Queues

30 problems

LIFO and FIFO. Plus the monotonic stack and deque, two of the most reused patterns in competitive programming.

Stack and Queue Basics
soon

Implementations using arrays and linked lists. Stack from queues, queue from stacks.

Monotonic Stack
soon

Next greater element, daily temperatures, largest rectangle in histogram, sum of subarray minimums.

Monotonic Deque
soon

Sliding window maximum, the classic monotonic deque pattern.

Step 10

Sliding Window and Two Pointer

12 problems

Whenever you see 'longest subarray with property X', this is your tool. Internalize the expand-shrink template.

Two Pointer
soon

Pair sum on a sorted array, three sum, remove duplicates, container with most water.

Sliding Window
soon

Longest substring without repeating, max consecutive ones, minimum window substring, fruits into baskets.

Step 11

Heaps and Priority Queues

17 problems

The data structure of choice for top-K problems, streaming medians, and Dijkstra's algorithm.

Heap Basics
soon

Heapify, sift up, sift down, build heap in O(n), implement a priority queue from scratch.

Top-K Problems
soon

K largest elements, K closest points to origin, K-th smallest in a sorted matrix, top K frequent.

Streaming Median and Merge
soon

Two-heap median, merge K sorted lists, the two-heap pattern.

Step 12

Greedy Algorithms

16 problems

When local optimal choices give the global optimum. Learn the standard problems and the proof patterns.

Greedy Basics
soon

Assign cookies, lemonade change, valid parenthesis after replacements.

Scheduling and Intervals
soon

N meetings in one room, minimum platforms, job sequencing for max profit.

Classic Greedy
soon

Fractional knapsack, jump game I and II, candy distribution, minimum coins.

Step 13

Binary Trees

39 problems

Traversals, structural problems, the most-asked tree patterns. Recursion on trees is the easiest place to internalize tree DP.

Traversals
soon

Preorder, inorder, postorder (recursive and iterative). Level order BFS. Morris traversal.

Structural Problems
soon

Height, diameter, balanced check, identical trees, symmetric trees, max path sum.

Construction and Views
soon

Build a tree from traversals, top/bottom/left/right views, vertical order traversal.

Lowest Common Ancestor
soon

LCA in a binary tree, LCA in a BST, k-th ancestor with binary lifting.

Step 14

Binary Search Trees

16 problems

BST invariant, search/insert/delete, and the inorder traversal trick that makes a lot of BST problems easy.

Operations on a BST
soon

Search, insert, delete, ceiling, floor, k-th smallest, validate BST.

BST Medium and Hard
soon

Recover a BST, merge two BSTs, pair sum in a BST, BST iterator with O(h) memory.

Step 15

Graphs

54 problems

Traversals, shortest paths, MST, topological sort. The most varied chapter in DSA.

Representation
soon

Adjacency list vs matrix, directed vs undirected, edge list, when to use each.

BFS and DFS
soon

Traversal templates, connected components, cycle detection, bipartite check.

Topological Sort
soon

Kahn's algorithm and DFS-based, course schedule, alien dictionary.

Shortest Paths
soon

Dijkstra, Bellman-Ford, Floyd-Warshall, 0/1 BFS, shortest path in DAG.

Minimum Spanning Tree
soon

Prim's and Kruskal's. Why MSTs matter and how to spot them in problem statements.

Disjoint Set Union
soon

Union by rank, path compression, the data structure that makes Kruskal's fast and unlocks Number of Islands II.

Tarjan, Bridges, Articulation Points
soon

Strongly connected components, bridges in a graph, articulation points. Disc/low time intuition.

Step 16

Dynamic Programming

56 problems

DP by pattern. Once you can spot which standard pattern a problem maps to, DP stops feeling magical.

1D DP
soon

Fibonacci, climbing stairs, frog jump, max sum of non-adjacent, house robber.

DP on Grids
soon

Unique paths, min path sum, triangle, chocolate pickup.

DP on Subsequences
soon

Subset sum, partition, target sum, count subsets, the take-or-skip pattern with memoization.

Knapsack Patterns
soon

0/1 knapsack, unbounded knapsack, coin change I and II, rod cutting.

Longest Increasing Subsequence
soon

O(n^2) DP, O(n log n) binary search variant, printing the LIS, longest divisible subset.

DP on Strings
soon

Longest common subsequence, edit distance, shortest common supersequence, wildcard matching.

DP on Stocks
soon

All six stock problems with one unified state machine.

Partition DP
soon

Matrix chain multiplication, palindrome partitioning, burst balloons, boolean evaluation.

DP on Trees
soon

Tree diameter via DP, max path sum, house robber on a tree, rerooting technique.

Step 17

Tries

7 problems

Prefix tree data structure. Used for autocomplete, longest common prefix, max XOR pair, word search II.

Trie Basics
soon

Insert, search, starts-with. Build the data structure from scratch.

Trie Applications
soon

Max XOR of two numbers, count distinct substrings, word search II.

Step 18

Strings — Advanced

7 problems

Failure function, suffix arrays, hashing. The string algorithms that show up in hard interviews and competitive programming.

KMP
soon

Knuth-Morris-Pratt failure function. Substring matching in O(n + m).

Z Algorithm
soon

Z-function. Pattern matching, string period detection.

String Hashing
soon

Rabin-Karp, polynomial hashing, double hashing to defeat anti-hash tests.

Manacher's Algorithm
soon

Longest palindromic substring in O(n).

Step 19

Math Foundations

18 problems

The number theory you actually need: GCD, LCM, primes, modular arithmetic, combinatorics. Topics Striver underweights but interviews ask for.

Number Theory Basics
soon

GCD by Euclid's algorithm, LCM, sieve of Eratosthenes, prime factorization.

Modular Arithmetic
soon

Modular addition, multiplication, inverse via Fermat's little theorem, fast exponentiation.

Combinatorics
soon

nCr mod p, Pascal's triangle, stars and bars, basic counting.

Step 20

Segment Trees and Fenwick Trees

12 problems

Range query data structures. Striver barely touches these; for competitive programming and FAANG-tier interviews they're table stakes.

Segment Tree Basics
soon

Build, point update, range query. Sum, min, max segment trees.

Segment Tree with Lazy Propagation
soon

Range updates with lazy propagation. The pattern that turns O(n*q) into O((n+q) log n).

Fenwick Tree (BIT)
soon

Binary indexed tree, prefix sums in O(log n), counting inversions in O(n log n).

Step 21

Data Structure Design

8 problems

LRU cache, LFU cache, time-based key-value, snapshot array. The 'design X' problems that combine multiple DSAs.

LRU Cache
soon

Hash map + doubly linked list. The most-asked design problem in interviews.

LFU Cache
soon

Frequency tracking with O(1) operations. Hash map + nested doubly linked list.

Other Design Problems
soon

Time-based key-value store, snapshot array, randomized set, design Twitter.