DSA Mastery

Data structures, Big-O and the patterns behind interview problems.

56 levels with step-through visualizers, quizzes and 153 coding problems checked against test cases.

Units
12
Lessons
56
Coding problems
153
Visualizers
56
Pattern pages
22

Free: units 1 to 2 (9 lessons). Units 3 to 12 with DevArcade Pro.

See pricing

What you'll learn

  • Boot CampThe JavaScript you need, and how to measure speed
  • Linear LandArrays, strings, maps, lists, stacks, queues
  • Thinking LoopsRecursion and sorting
  • Branching ForestTrees, BSTs, heaps, graphs and tries
  • WorkshopBits, math and designing your own data structures
  • Pointer PassPatterns 1–3: move indices cleverly
  • Counting CavesPatterns 4–7: count, scan and precompute
  • Choice CanyonPatterns 8–10: sort, choose, keep the best
  • Explorer PeaksPatterns 11–14: walk every path
  • Graph SummitDependencies, groups, weighted paths and spanning trees
  • Expert RidgeString matching and range queries
  • Boss CastlePattern 15: dynamic programming

Course outline

12 units and 56 lessons. Each lesson has a short read with examples you run, a quiz, and coding problems tested in your browser; most have a step-through visualizer.

  1. Unit 1:Boot Camp

    The JavaScript you need, and how to measure speed

    Free
    1. JS Toolkit for DSA Arrays, loops, objects, Map and Set: the only JavaScript most interview problems need.
      2 problems
    2. Big-O Notation How to describe the speed of an algorithm as the input grows.
      2 problems
  2. Unit 2:Linear Land

    Arrays, strings, maps, lists, stacks, queues

    Free
    1. Arrays The workhorse structure: instant reads, costly middle inserts.
      2 problems
    2. Strings Arrays of characters, with one catch: you cannot change them in place.
      2 problems
    3. Hash Maps & Sets Trade a little memory for instant "have I seen it?" answers.
      2 problems
    4. Hashing Internals: Build a Hash Map How a Map finds keys in O(1): hash functions, buckets, collisions, load factor and resizing.
      3 problems
    5. Linked Lists Nodes holding a value and a pointer to the next node.
      2 problems
    6. Stacks Last in, first out. The most recent thing is always on top.
      2 problems
    7. Queues First in, first out. Fair lines, task schedulers and BFS.
      2 problems
  3. Unit 3:Thinking Loops

    Recursion and sorting

    Pro
    1. Recursion Solve a problem by solving a smaller copy of it.
      2 problems
    2. Sorting Basics Put things in order, then many problems become easy.
      2 problems
    3. Quick Sort, Quickselect & Counting Sort Partition around a pivot, find the k-th element in O(n) on average, and beat n log n for small integers.
      3 problems
    4. Analysing Recursive & Amortized Cost Recursion trees, the four recurrences to know, amortized O(1), and the hidden costs in everyday JavaScript.
      2 problems
  4. Unit 4:Branching Forest

    Trees, BSTs, heaps, graphs and tries

    Pro
    1. Binary Trees Nodes with up to two children. Recursion was made for them.
      2 problems
    2. Binary Search Trees Smaller to the left, bigger to the right, at every node.
      2 problems
    3. Heaps A tree packed into an array that always knows its minimum.
      2 problems
    4. Heap Sort and Stable Sorting Sort in place in O(n log n) with a heap, sort nearly sorted data with a small heap, and know when order among equals matters.
      3 problems
    5. Graphs Nodes and edges: maps, networks, dependencies, grids.
      2 problems
    6. Tries A tree of letters for lightning-fast prefix search.
      2 problems
    7. Trie II: Wildcards and Grid Words Wildcard search by branching, many-word grid search pruned by a trie, and prefix replacement.
      3 problems
  5. Unit 5:Workshop

    Bits, math and designing your own data structures

    Pro
    1. Bit Manipulation Numbers as rows of bits: AND, OR, XOR and shifts, the tricks built on them, and bitmasks as sets.
      3 problems
    2. Math for Coding Interviews Remainder against modulo, gcd and lcm, primes and the sieve, fast exponentiation and safe integers.
      3 problems
    3. Designing Data Structures: LRU Cache Turn required complexities into a design: a min stack, an LRU cache (map + doubly linked list), a time map.
      3 problems
  6. Unit 6:Pointer Pass

    Patterns 1–3: move indices cleverly

    Pro
    1. Two Pointers Two indices walk toward each other (or together) to skip useless pairs.
      3 problems
    2. Fast & Slow Pointers A hare that moves twice as fast finds cycles and middles in one pass; a dummy head removes edge cases.
      3 problems
    3. Sliding Window Keep a running window over a range and slide it instead of recomputing.
      3 problems
    4. Binary Search Halve the search space every step: O(log n).
      3 problems
    5. Binary Search on the Answer Boundaries with lower/upper bound, rotated arrays, and binary searching a monotonic yes/no question.
      3 problems
  7. Unit 7:Counting Caves

    Patterns 4–7: count, scan and precompute

    Pro
    1. Frequency Counting Count everything once in a map, then answer questions instantly.
      3 problems
    2. Matrix Traversal Walk a 2D grid in the order the problem needs: rows, columns, diagonals, spirals.
      3 problems
    3. Matrix II: Rotate, Zero and Search Rotate an image in place, zero rows and columns with O(1) extra space, and search a sorted grid from a corner.
      3 problems
    4. Monotonic Stack A stack kept in sorted order answers "next greater / smaller" in O(n).
      3 problems
    5. Monotonic Queue: Window Maximum A deque of indexes, decreasing front to back, gives the maximum of every window in O(n).
      3 problems
    6. Prefix Sum Precompute running totals once, answer any range sum in O(1).
      3 problems
  8. Unit 8:Choice Canyon

    Patterns 8–10: sort, choose, keep the best

    Pro
    1. Overlapping Intervals Sort by start time, then merge or compare neighbours.
      3 problems
    2. Greedy Make the best-looking choice now and never look back, when that provably works.
      3 problems
    3. Greedy II: Jumps, Circuits, Intervals Three greedy classics with the argument that makes each one correct.
      3 problems
    4. Top K Elements Keep only the k best candidates in a heap as you scan.
      3 problems
    5. Two Heaps: Running Median A max-heap for the lower half and a min-heap for the upper half give the median of a stream in O(log n).
      2 problems
  9. Unit 9:Explorer Peaks

    Patterns 11–14: walk every path

    Pro
    1. Backtracking Choose, explore, un-choose: systematically try every possibility.
      3 problems
    2. Backtracking on Grids & Constraints Mark, explore, restore on a grid; O(1) constraint checks for N-Queens; prune and skip duplicates.
      3 problems
    3. Binary Tree Traversal Preorder, inorder, postorder: three orders, one recursive shape.
      3 problems
    4. Tree Recipes: Invert, Diameter, LCA Return one thing while tracking another: height and diameter, path sums, and the lowest common ancestor.
      3 problems
    5. Depth-First Search Go as deep as you can, then back up. Recursion or a stack.
      3 problems
    6. Breadth-First Search Explore in rings of distance with a queue. Finds shortest paths.
      3 problems
  10. Unit 10:Graph Summit

    Dependencies, groups, weighted paths and spanning trees

    Pro
    1. Topological Sort Order tasks so every prerequisite comes first, and detect when a cycle makes that impossible.
      3 problems
    2. Union-Find (Disjoint Sets) Group items into sets and ask "same set?" in near-constant time, even while edges keep arriving.
      3 problems
    3. Weighted Shortest Paths Dijkstra for non-negative weights, Bellman-Ford for negative ones, stop limits and negative cycles.
      3 problems
    4. Graph Extras: Many Sources, Two Colours, All Pairs Multi-source BFS, bipartite checks, Floyd-Warshall for all pairs, and 0-1 BFS with a deque.
      4 problems
    5. Minimum Spanning Tree Connect every node for the least total weight: Kruskal sorts edges and uses union-find; Prim grows a tree.
      2 problems
  11. Unit 11:Expert Ridge

    String matching and range queries

    Pro
    1. String Matching: KMP and Rolling Hash Find a pattern in a text in O(n + m) with KMP's prefix function, or with a rolling hash.
      3 problems
    2. Range Queries: Fenwick and Segment Trees Answer range sums and minimums while the array keeps changing, in O(log n) per operation.
      3 problems
  12. Unit 12:Boss Castle

    Pattern 15: dynamic programming

    Pro
    1. Dynamic Programming Solve each small subproblem once, store it, build the big answer from it.
      4 problems
    2. Knapsack DP Take it or leave it: 0/1 and unbounded knapsack, subset sums, and counting the ways to make change.
      3 problems
    3. Sequence DP: Kadane, LIS, LCS Best subarray, longest increasing subsequence, longest common subsequence and edit distance.
      4 problems
    4. Interval DP & DP on Trees Fill a table by substring length for palindromes, and return tuples up a tree for house robber III.
      3 problems

Start DSA Mastery for free

Enroll for free and units 1 and 2 are yours. DevArcade Pro opens every unit of every course, including new ones as they launch, monthly or yearly.

All courses