DSA Mastery
Learn Data Structures and Algorithms (DSA) Online
Data structures, Big-O and the patterns behind interview problems.
83 levels with step-through visualizers, quizzes and 225 coding problems checked against test cases, from Big-O to advanced graphs and dynamic programming.
- Units
- 18
- Lessons
- 83
- Coding problems
- 225
- Visualizers
- 83
- Pattern pages
- 22
Free: units 1 to 2 (9 lessons). Units 3 to 18 with DevArcade Pro.
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
- Graph DepthsTraversal templates, cycles, grids and hidden graphs
- Path FindersDijkstra in depth, minimax paths, counting routes and state search
- Graph MastersUnion-find II, Prim, strong components, bridges and Euler paths
- DP ForgeThe DP framework, 1D chains, prefix splits, state machines and grids
- DP TablesTwo-string tables, LIS techniques and knapsack in disguise
- DP SummitSplit points, bitmasks, tree states and the graph-plus-DP boss
Who it's for
Students preparing for placements and coding interviews, self-taught developers who want the computer science fundamentals, and anyone who has stalled on LeetCode-style problems and wants to see why a solution works.
Before you start
Basic JavaScript: variables, loops, functions and arrays. Every solution is written in JavaScript, so if you are new to it, start with JS Mastery first.
Course outline
18 units and 83 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.
- Free
Unit 1:Boot Camp
The JavaScript you need, and how to measure speed
- JS Toolkit for DSA Arrays, loops, objects, Map and Set: the only JavaScript most interview problems need.2 problems
- Big-O Notation How to describe the speed of an algorithm as the input grows.2 problems
-
- Free
Unit 2:Linear Land
Arrays, strings, maps, lists, stacks, queues
- Arrays The workhorse structure: instant reads, costly middle inserts.2 problems
- Strings Arrays of characters, with one catch: you cannot change them in place.2 problems
- Hash Maps & Sets Trade a little memory for instant "have I seen it?" answers.2 problems
- Hashing Internals: Build a Hash Map How a Map finds keys in O(1): hash functions, buckets, collisions, load factor and resizing.3 problems
- Linked Lists Nodes holding a value and a pointer to the next node.2 problems
- Stacks Last in, first out. The most recent thing is always on top.2 problems
- Queues First in, first out. Fair lines, task schedulers and BFS.2 problems
-
- Pro
Unit 3:Thinking Loops
Recursion and sorting
- Recursion Solve a problem by solving a smaller copy of it.2 problems
- Sorting Basics Put things in order, then many problems become easy.2 problems
- 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
- Analysing Recursive & Amortized Cost Recursion trees, the four recurrences to know, amortized O(1), and the hidden costs in everyday JavaScript.2 problems
-
- Pro
Unit 4:Branching Forest
Trees, BSTs, heaps, graphs and tries
- Binary Trees Nodes with up to two children. Recursion was made for them.2 problems
- Binary Search Trees Smaller to the left, bigger to the right, at every node.2 problems
- Heaps A tree packed into an array that always knows its minimum.2 problems
- 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
- Graphs Nodes and edges: maps, networks, dependencies, grids.2 problems
- Tries A tree of letters for lightning-fast prefix search.2 problems
- Trie II: Wildcards and Grid Words Wildcard search by branching, many-word grid search pruned by a trie, and prefix replacement.3 problems
-
- Pro
Unit 5:Workshop
Bits, math and designing your own data structures
- Bit Manipulation Numbers as rows of bits: AND, OR, XOR and shifts, the tricks built on them, and bitmasks as sets.3 problems
- Math for Coding Interviews Remainder against modulo, gcd and lcm, primes and the sieve, fast exponentiation and safe integers.3 problems
- 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
-
- Pro
Unit 6:Pointer Pass
Patterns 1–3: move indices cleverly
- Two Pointers Two indices walk toward each other (or together) to skip useless pairs.3 problems
- 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
- Sliding Window Keep a running window over a range and slide it instead of recomputing.3 problems
- Binary Search Halve the search space every step: O(log n).3 problems
- Binary Search on the Answer Boundaries with lower/upper bound, rotated arrays, and binary searching a monotonic yes/no question.3 problems
-
- Pro
Unit 7:Counting Caves
Patterns 4–7: count, scan and precompute
- Frequency Counting Count everything once in a map, then answer questions instantly.3 problems
- Matrix Traversal Walk a 2D grid in the order the problem needs: rows, columns, diagonals, spirals.3 problems
- 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
- Monotonic Stack A stack kept in sorted order answers "next greater / smaller" in O(n).3 problems
- Monotonic Queue: Window Maximum A deque of indexes, decreasing front to back, gives the maximum of every window in O(n).3 problems
- Prefix Sum Precompute running totals once, answer any range sum in O(1).3 problems
-
- Pro
Unit 8:Choice Canyon
Patterns 8–10: sort, choose, keep the best
- Overlapping Intervals Sort by start time, then merge or compare neighbours.3 problems
- Greedy Make the best-looking choice now and never look back, when that provably works.3 problems
- Greedy II: Jumps, Circuits, Intervals Three greedy classics with the argument that makes each one correct.3 problems
- Top K Elements Keep only the k best candidates in a heap as you scan.3 problems
- 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
-
- Pro
Unit 9:Explorer Peaks
Patterns 11–14: walk every path
- Backtracking Choose, explore, un-choose: systematically try every possibility.3 problems
- Backtracking on Grids & Constraints Mark, explore, restore on a grid; O(1) constraint checks for N-Queens; prune and skip duplicates.3 problems
- Binary Tree Traversal Preorder, inorder, postorder: three orders, one recursive shape.3 problems
- Tree Recipes: Invert, Diameter, LCA Return one thing while tracking another: height and diameter, path sums, and the lowest common ancestor.3 problems
- Depth-First Search Go as deep as you can, then back up. Recursion or a stack.3 problems
- Breadth-First Search Explore in rings of distance with a queue. Finds shortest paths.3 problems
-
- Pro
Unit 10:Graph Summit
Dependencies, groups, weighted paths and spanning trees
- Topological Sort Order tasks so every prerequisite comes first, and detect when a cycle makes that impossible.3 problems
- Union-Find (Disjoint Sets) Group items into sets and ask "same set?" in near-constant time, even while edges keep arriving.3 problems
- Weighted Shortest Paths Dijkstra for non-negative weights, Bellman-Ford for negative ones, stop limits and negative cycles.3 problems
- 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
- Minimum Spanning Tree Connect every node for the least total weight: Kruskal sorts edges and uses union-find; Prim grows a tree.2 problems
-
- Pro
Unit 11:Expert Ridge
String matching and range queries
- 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
- Range Queries: Fenwick and Segment Trees Answer range sums and minimums while the array keeps changing, in O(log n) per operation.3 problems
-
- Pro
Unit 12:Boss Castle
Pattern 15: dynamic programming
- Dynamic Programming Solve each small subproblem once, store it, build the big answer from it.4 problems
- Knapsack DP Take it or leave it: 0/1 and unbounded knapsack, subset sums, and counting the ways to make change.3 problems
- Sequence DP: Kadane, LIS, LCS Best subarray, longest increasing subsequence, longest common subsequence and edit distance.4 problems
- 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
-
- Pro
Unit 13:Graph Depths
Traversal templates, cycles, grids and hidden graphs
- Graph Traversal Templates Adjacency lists, matrices and edge lists, then BFS and DFS (recursive and iterative) as templates you can write from memory.3 problems
- Cycle Detection Find cycles in undirected graphs (parent tracking) and directed ones (three colours), and tell which nodes can never get stuck in a loop.3 problems
- Grid Graphs: Areas, Borders and Oceans Flood fill with a purpose: measure islands, capture regions by flooding from the border, and search backwards from the oceans.3 problems
- Implicit Graphs: Word Ladders and Locks When nobody hands you the edges: generate neighbours on the fly and let BFS find the fewest moves.2 problems
- Graph Shapes: Trees, Judges and Centres Read a graph's shape from its counts: when edges form a tree, what degrees reveal, and how peeling leaves finds the centre.3 problems
-
- Pro
Unit 14:Path Finders
Dijkstra in depth, minimax paths, counting routes and state search
- Dijkstra in Depth: Routes and Probabilities Rebuild the actual route, read the distance table, maximise a product instead of a sum, and run Dijkstra from every node when you must.3 problems
- Minimax Paths on Grids When a route is only as good as its worst step: Dijkstra with max instead of plus, and the binary-search and union-find alternatives.2 problems
- Counting Shortest Paths Not just how far, but how many ways: carry a counter through BFS or Dijkstra, and why enumerating paths explodes.2 problems
- Topological Sort II: Alien Alphabets and Critical Paths Build the dependency graph yourself from sorted words, then run DP along a topological order to find the longest (critical) path.2 problems
- State-Space Search: BFS with Extra Memory When position alone is not enough: add what you carry (eliminations left, nodes visited) to the BFS state, and size the state space before you start.2 problems
-
- Pro
Unit 15:Graph Masters
Union-find II, Prim, strong components, bridges and Euler paths
- Union-Find II: Rank, Labels and Merging Union by rank versus size, union-find over strings and coordinates, and the classic "merge records that share a key" problems.3 problems
- Prim's Algorithm and MST Tricks Grow a spanning tree from one node with a heap, and model "build here or connect there" choices with a virtual node.2 problems
- Strongly Connected Components Groups where everyone can reach everyone: Kosaraju's two passes, Tarjan's low-links, and the DAG of components they leave behind.2 problems
- Bridges and Articulation Points Find the single cables and single routers whose failure splits a network, in one DFS with discovery times and low-links.2 problems
- Euler Paths: Every Edge Once When can you trace a graph without lifting the pen, and Hierholzer's algorithm to build the route, including the smallest itinerary from a pile of tickets.2 problems
-
- Pro
Unit 16:DP Forge
The DP framework, 1D chains, prefix splits, state machines and grids
- The DP Framework: Memo, Table, Rolling One problem, four versions: plain recursion, memoisation, a bottom-up table and a rolling pair of variables, plus the state/transition/base-case checklist.3 problems
- 1D DP: Decode, Circle, Earn Three classic one-dimensional DPs with a twist each: two-way branching on digits, a circular street, and a problem that turns into house robber in disguise.3 problems
- Prefix DP: Word Break, Squares and Cuts When the last piece can have many lengths: dp[i] tries every split point j < i, with pruning that keeps it fast.3 problems
- State-Machine DP: Trading Stocks When "where am I?" is more than an index: holding or not, cooling down, trades used. Draw the states, then write one line per arrow.3 problems
- Grid DP: Paths, Obstacles and Squares Fill a table in reading order when moves only go right and down: minimum path sums, blocked cells, and the largest square of ones.3 problems
-
- Pro
Unit 17:DP Tables
Two-string tables, LIS techniques and knapsack in disguise
- String DP II: Subsequences, Interleaving, Wildcards Two-string tables beyond LCS: count hidden subsequences, weave two strings together, and match patterns with ? and *.3 problems
- LIS Techniques: Patience, Counting, Nesting Longest increasing subsequence in O(n log n) with the tails array, counting how many LIS there are, and turning 2D nesting into 1D LIS with a clever sort.3 problems
- Knapsack Variants: Signs, Two Budgets, Balance Recognise knapsack in disguise: plus/minus signs that become a subset count, two capacities at once, and splitting into two piles as evenly as possible.3 problems
-
- Pro
Unit 18:DP Summit
Split points, bitmasks, tree states and the graph-plus-DP boss
- Interval DP II: Split Points and Last Moves Try every split point k inside a range: matrix chains, cutting sticks, and bursting balloons by asking which one goes last.3 problems
- Bitmask DP: Small Sets, Big Savings When n is about 20 or less, a set fits in an integer: travelling salesman in n²·2ⁿ, assignments, and splitting into equal groups.3 problems
- Tree DP II: Paths, Cameras and Coins Post-order DP that returns one thing to the parent and records another globally, plus small state machines on nodes.3 problems
- Boss: DP on Graphs The finale: graphs whose structure gives DP its order. Count routes in a DAG, climb the longest increasing path with memoised DFS, and add time as a dimension.3 problems
-
DSA Mastery: frequently asked questions
Which language are the DSA problems in?
JavaScript. You write and run every solution in your browser, and it is checked against test cases the moment you press Run.
Is this enough for coding interviews?
It covers the data structures, Big-O analysis and the problem-solving patterns behind most interview questions: two pointers, sliding window, hashing, recursion, trees, graphs, greedy and dynamic programming. Pair it with timed practice and mock interviews before the real thing.
What makes the visualizers useful?
Each one steps through an algorithm frame by frame, showing pointers, the stack and the data changing, so you can see why a solution works before you write it yourself.
Is it free?
Yes, to start. Sign up free and units 1 and 2 of this course are yours, lessons, quizzes and coding problems included, with no time limit. DevArcade Pro opens the remaining units of every course.
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.