Vibe Engines
YouTube

Vibe Engines is free, interactive AI engineering & system design — runs in your browser. Pick a learning path

Roadmap · 2026 Edition

Data Structures
& Algorithms.

18 stations. 3 tracks. From Big-O and arrays to graphs and dynamic programming — at your own pace.

Foundations
~4h 0/6
Structures
~4.5h 0/6
Graphs
~5h 0/6
0 of 18 stations · ~0h of ~13h

The roadmap.

18 stations on 3 ladders, in order — each rung is written assuming the one above it. Mark them off as you go; your progress is saved in this browser.

0 / 18
Pick up at
Track 1 of 3

FoundationsStart here

6 rungs · ~4h · ends at Binary Search.

0/6 done
  1. Big-O & Complexity

    Start here

    F1 · Beginner · 30 min

    How to measure an algorithm by how its cost grows, not how long it happens to run. O(1), O(log n), O(n), O(n log n), O(n²) — recognising these lets you predict whether code scales to a million items before you ever run it.

    • Time vs space complexity
    • Common growth classes
    • Amortised analysis
    • Best / average / worst case

    Build itTake three solutions to the same problem and rank them by Big-O. Predict which wins at n = 1,000,000, then time them to check.

    ✓ CheckpointExplain why O(n) can beat O(log n) on real input, and what the notation deliberately hides.

  2. Arrays & Strings

    F2 · Beginner · 30 min

    The workhorse structure: contiguous memory, O(1) random access, O(n) insert/delete in the middle. Most interview problems start here — in-place manipulation, reversals, rotations, and the index arithmetic everything else builds on.

    • Random access & traversal
    • In-place edits
    • String building
    • Index math

    Build itReverse an array in place with two pointers, then rotate it by k positions using no extra memory.

    ✓ CheckpointExplain why inserting at the front of an array is O(n) and why that cost is invisible until it is not.

  3. Hashing & Sets

    F3 · Beginner · 45 min

    Hash maps trade memory for O(1) average lookups. Frequency counts, de-duplication, and “have I seen this before?” checks become trivial. The single most useful trick for cutting an O(n²) brute force down to O(n).

    • Hash maps & sets
    • Frequency counting
    • Collisions (basics)
    • The two-sum pattern

    Build itSolve two-sum in O(n) with a hash map, then find the first non-repeating character in a string.

    ✓ CheckpointExplain what a hash set buys over a sorted array, and the case where the array wins.

  4. Two Pointers & Sliding Window

    F4 · Intermediate · 45 min

    Two indices walking through a sequence — from opposite ends or as a fast/slow pair — crack a huge class of array and string problems in O(n) time and O(1) space. The sliding window is the same idea aimed at subarrays and substrings.

    • Opposite-end pointers
    • Fast / slow pointers
    • Fixed & variable windows
    • In-place partitioning

    Build itFind the longest substring without repeating characters using a sliding window backed by a set.

    ✓ CheckpointExplain how a sliding window turns an O(n²) scan into O(n), and what property the input must have.

  5. Math & Sieves

    F5 · Intermediate · 40 min

    Number theory shows up constantly — primes, GCD, modular arithmetic. The Sieve of Eratosthenes finds every prime up to n by crossing out multiples, far faster than testing each number for primality.

    • Primes & factorisation
    • GCD / LCM
    • Modular arithmetic
    • The Sieve

    Build itGenerate every prime under 1,000 with the Sieve, then work out why it runs in O(n log log n).

    ✓ CheckpointExplain why the sieve is faster than testing each number for primality, in terms of work reused.

  6. Binary Search

    F6 · Intermediate · 45 min

    On sorted data, halve the search space every step — O(log n) instead of O(n). The pattern reaches far past arrays: any time the answer space is monotonic, you can “binary search on the answer.”

    • Sorted-array search
    • Lower / upper bound
    • Search on the answer
    • Off-by-one safety

    Build itImplement binary search with zero off-by-one bugs, then reuse it to find a square root to six decimals.

    ✓ CheckpointWrite the binary search boundary condition from memory and say which off-by-one you get wrong most.

Track 2 of 3

Structures & SortingLevel up

6 rungs · ~4.5h · ends at Heaps & Priority Queues.

0/6 done
  1. Stacks & Queues

    T1 · Beginner · 30 min

    LIFO and FIFO — the two simplest abstract structures, yet they power undo systems, expression parsing, BFS, and scheduling. Half the battle is recognising that a problem is secretly a stack or queue problem.

    • Stack (LIFO)
    • Queue / deque (FIFO)
    • Monotonic stack
    • Matching & parsing

    Build itValidate balanced brackets with a stack, then build a min-stack that returns its minimum in O(1).

    ✓ CheckpointExplain what a monotonic stack maintains, and how that turns “next greater element” into one pass.

  2. Linked Lists

    T2 · Intermediate · 40 min

    Nodes joined by pointers: O(1) insert/delete, but no random access. The classic playground for pointer manipulation — reversal, cycle detection, and merging two lists in order.

    • Singly / doubly linked
    • Pointer reversal
    • Floyd cycle detection
    • Dummy-head trick

    Build itReverse a linked list iteratively, then detect a cycle with fast/slow pointers.

    ✓ CheckpointExplain why the fast/slow pointer finds a cycle, and why the meeting point is not the cycle start.

  3. Recursion & Backtracking

    T3 · Intermediate · 50 min

    A function that calls itself, peeling a problem down to a base case. Backtracking adds “try, recurse, undo” to explore every configuration — permutations, subsets, N-queens, Sudoku.

    • Base case & recursion
    • The call stack
    • Backtracking template
    • Pruning

    Build itGenerate all subsets of a set, then all permutations. Add pruning to place 8 queens without conflicts.

    ✓ CheckpointExplain what backtracking undoes and why forgetting the undo poisons every later branch.

  4. Sorting

    T4 · Intermediate · 50 min

    Ordering data unlocks binary search, two-pointer sweeps, and greedy methods. Merge sort guarantees O(n log n) with a stable divide-and-conquer; quicksort is usually faster in practice with in-place partitioning.

    • Divide & conquer
    • Merge sort (stable)
    • Quicksort & pivots
    • When to sort first

    Build itImplement merge sort, then quicksort, and compare how each behaves on already-sorted and reversed input.

    ✓ CheckpointExplain what stability means in a sort and give a case where losing it produces a wrong answer.

  5. Trees & BSTs

    T5 · Intermediate · 50 min

    Hierarchical nodes with children. Binary search trees keep data ordered for O(log n) search and insert; traversals — in-order, pre-order, post-order — visit every node in a meaningful sequence.

    • Binary trees
    • BST invariant
    • DFS traversals
    • Balanced trees (AVL / RB) intuition

    Build itDo an in-order traversal of a BST (it yields sorted order), then check whether an arbitrary tree is a valid BST.

    ✓ CheckpointExplain why an unbalanced BST degenerates to a list, and what input causes it.

  6. Heaps & Priority Queues

    T6 · Intermediate · 45 min

    A binary heap gives O(log n) insert and O(1) peek of the smallest (or largest) element — the engine behind priority queues, “top-k” problems, and Dijkstra’s frontier.

    • Min / max heap
    • Heapify in O(n)
    • Top-k pattern
    • Priority queue uses

    Build itFind the k largest values in a stream using a min-heap of size k, and explain why it is O(n log k).

    ✓ CheckpointExplain why a heap gives you the minimum in O(1) but the sorted order still costs O(n log n).

Track 3 of 3

Graphs & AdvancedGo further

6 rungs · ~5h · ends at Dynamic Programming.

0/6 done
  1. Graph Foundations

    P1 · Intermediate · 40 min

    Vertices and edges model networks, maps, dependencies, and state spaces. Representation matters: an adjacency list for sparse graphs, a matrix for dense ones — the choice changes the cost of every traversal.

    • Adjacency list vs matrix
    • Directed / weighted edges
    • Degree & connectivity
    • Modelling problems as graphs

    Build itBuild an adjacency list from an edge list, then count the connected components.

    ✓ CheckpointExplain when an adjacency matrix beats a list, in terms of density rather than preference.

  2. BFS & Flood Fill

    P2 · Intermediate · 45 min

    Breadth-first search explores level by level with a queue — giving the shortest path in unweighted graphs and powering flood fill, maze solving, and “nearest” queries.

    • Queue-based BFS
    • Shortest path (unweighted)
    • Flood fill
    • Multi-source BFS

    Build itFind the shortest path through a grid maze with BFS, then flood-fill a region of connected cells.

    ✓ CheckpointExplain why BFS finds the shortest path on an unweighted graph and DFS does not.

  3. DFS & Topological Sort

    P3 · Intermediate · 45 min

    Depth-first search dives down each branch with recursion or a stack. It detects cycles, finds components, and — on a DAG — produces a topological order for scheduling dependencies.

    • Recursive / iterative DFS
    • Cycle detection
    • Topological sort
    • Connected components

    Build itTopologically sort a build-dependency graph, and detect when a cycle makes ordering impossible.

    ✓ CheckpointExplain what a topological order guarantees and what its existence tells you about the graph.

  4. Shortest Paths

    P4 · Advanced · 55 min

    When edges carry weights, BFS is not enough. Dijkstra greedily expands the cheapest frontier with a heap; it is the backbone of routing, networks, and every “least-cost” problem.

    • Weighted edges
    • Dijkstra + heap
    • Edge relaxation
    • Negative edges (Bellman-Ford)

    Build itRun Dijkstra on a weighted road network to find the cheapest route, using a priority queue for the frontier.

    ✓ CheckpointExplain why Dijkstra breaks on negative edges, and which algorithm you reach for instead.

  5. Heuristic Search (A*)

    P5 · Advanced · 50 min

    A* speeds up shortest-path search by adding a heuristic — an estimate of the distance still to go — so it aims toward the goal instead of expanding evenly. With an admissible heuristic it stays optimal.

    • Heuristics & admissibility
    • f = g + h
    • A* vs Dijkstra
    • Greedy best-first

    Build itPathfind across a terrain grid with A* and a Manhattan heuristic, then compare how many nodes it expands versus Dijkstra.

    ✓ CheckpointExplain what makes an A* heuristic admissible, and what an inadmissible one costs you.

  6. Dynamic Programming

    P6 · Advanced · 60 min

    DP solves a problem by caching its overlapping subproblems — top-down with memoisation or bottom-up with a table. Once you spot the recurrence, exponential brute force collapses to polynomial time.

    • Overlapping subproblems
    • Memoisation vs tabulation
    • State & transitions
    • Classic DPs (knapsack, LCS, edit distance)

    Build itSolve climbing-stairs with memoisation, re-derive it bottom-up, then move on to the 0/1 knapsack.

    ✓ CheckpointState the DP state for a problem you solved, and say why that state is sufficient.

The roadmap at a glance

All 18 rungs on one screen. Each track assumes the one before it; the highlighted rung is where a track ends and the next one picks up.

FoundationsF1 Big-O & ComplexityF2 Arrays & StringsF3 Hashing & SetsF4 Two Pointers & Sliding WindowF5 Math & SievesF6 Binary SearchStructures & SortingT1 Stacks & QueuesT2 Linked ListsT3 Recursion & BacktrackingT4 SortingT5 Trees & BSTsT6 Heaps & Priority QueuesGraphs & AdvancedP1 Graph FoundationsP2 BFS & Flood FillP3 DFS & Topological SortP4 Shortest PathsP5 Heuristic Search (A*)P6 Dynamic Programming
Track order matters more than rung order inside a track: finish a track's last rung before starting the next track.

Worked example: a three-hours-a-week plan

Say you have three focused hours a week — an evening or two. Take the rungs in order and never split one across two weeks; a rung that would push the week past three hours starts the next week. The rung times add up to 13h 15m.

WeekRungsTime
Week 1F1 Big-O & Complexity, F2 Arrays & Strings, F3 Hashing & Sets, F4 Two Pointers & Sliding Window2h 30m
Week 2F5 Math & Sieves, F6 Binary Search, T1 Stacks & Queues, T2 Linked Lists2h 35m
Week 3T3 Recursion & Backtracking, T4 Sorting, T5 Trees & BSTs2h 30m
Week 4T6 Heaps & Priority Queues, P1 Graph Foundations, P2 BFS & Flood Fill, P3 DFS & Topological Sort2h 55m
Week 5P4 Shortest Paths, P5 Heuristic Search (A*), P6 Dynamic Programming2h 45m

That is 5 weeks of reading. The Build-it exercise on each rung is extra and is where most of the learning happens, so plan to spend at least as long building as reading — or halve the pace and do both in the same week.

What each track costs in time

The rung times above, added up per track. Use it to plan the slow stretch: a track that takes a larger share of the total is where the plan above spends more weeks.

TrackRungsTimeShareLongest rung
1. Foundations63h 55m30%F3 Hashing & Sets (45m)
2. Structures & Sorting64h 25m33%T3 Recursion & Backtracking (50m)
3. Graphs & Advanced64h 55m37%P6 Dynamic Programming (1h)

Common mistakes on the Data Structures & Algorithms path

  • Counting problems instead of patterns

    Solving hundreds of problems one by one does not transfer. Name the pattern after each one, such as sliding window (F4) or monotonic stack (T1), and new problems start to look familiar.

  • Skipping complexity

    Every interviewer asks for time and space. If F1 was skipped, you cannot say why your solution is O(n log n) or whether it fits the input size.

  • Memorising binary search without the invariant

    A copied template breaks the moment the problem asks for the first true instead of an exact match. Know what lo and hi mean at every step (F6).

  • Jumping to DP before recursion

    Dynamic programming (P6) is recursion plus a cache. Without T3 you cannot write the recurrence, so DP looks like a bag of tricks.

  • Picking the wrong traversal

    DFS does not give shortest paths on unweighted graphs; BFS does (P2). Dijkstra is wrong once edges can be negative; use Bellman-Ford (P4).

Where this shows up: jobs and interviews

  • Where it shows up in the job

    Rarely as puzzles. It shows up as choices: a hash map instead of a nested loop, a heap for top-k, a graph walk for dependencies, and spotting O(n²) code before it meets real data.

  • What coding interviews look like

    One or two problems in a shared editor. You restate the problem, propose an approach, give its complexity, code it, then test it with edge cases.

  • Which rungs come up most

    The Foundations track plus stacks and linked lists (T1, T2) cover many common questions. Trees, heaps and BFS/DFS (T5, T6, P2, P3) are standard; DP and weighted shortest paths (P4, P6) show up in harder rounds.

  • How you are judged

    Interviewers score communication, correctness, complexity and testing, not only a passing answer. Practise out loud, and re-solve a problem from scratch a few days later to check it stuck.

Check yourself

Open a question only after you have answered it out loud. If one stumps you, the rung in brackets is where to go back to.

Find two numbers in an unsorted array that sum to a target. What is the O(n) approach, and what does it cost?

Walk the array with a hash map of value to index; for each x, check whether target - x is already in the map before inserting x. O(n) time, O(n) extra space. Sorting plus two pointers uses O(1) extra space but costs O(n log n) and loses the original indices. (F3)

You need the k largest values from a stream of n numbers. Which structure, and what is the cost?

A min-heap of size k. Push each value and pop the smallest when the heap grows past k. That is O(n log k) time and O(k) space, versus O(n log n) to sort everything. (T6)

Find the fewest moves through a grid maze where every step costs the same. BFS or DFS, and why?

BFS. It visits cells in order of distance, so the first time it reaches the exit is via a shortest path. DFS can reach the exit by a long route first. (P2)

Climbing stairs: you can take 1 or 2 steps. What is the DP state, and how small can the memory get?

ways(i) = ways(i-1) + ways(i-2), the number of ways to reach step i. Memoisation or a table is O(n); bottom-up needs only the last two values, so O(1) space. (P6)

Data Structures & Algorithms roadmap — frequently asked questions

The common questions before you start — how long it takes, whether to follow it in order, and how it stays current.

How long does this roadmap take?

It runs 18 stations across 3 tracks — roughly ~13h of focused learning, plus the time you spend actually building. It is self-paced, so most people work through it over a few weeks, an evening or a single station at a time.

Do I have to follow the stations in order?

The tracks are ordered so each station builds on the one before, and following them start to finish is the intended path. But every station also stands alone — if you already have the foundations, jump straight to the part you need.

Is it free?

Yes. The whole roadmap, and every handbook, lab, and challenge it links to, is free and open — no sign-up and no paywall.

How is the roadmap kept current?

It teaches the durable fundamentals of the role first, then the tooling and the AI-era shifts on top — so most of it stays relevant as individual tools churn, and it is revised as the role itself changes.

Who is this roadmap for?

Anyone stepping into or leveling up in the Data Structures & Algorithms role — whether you are switching in, early-career, or a senior filling gaps. Start where you are; the ladder shows what is left.

Play the algorithms.

Seven stations on this map are fully playable — watch binary search, sorting, BFS, Dijkstra, and A* run step by step.

Browse the algorithm games →
Finished this one? 0 / 31 Roadmaps done
NextFizz Buzz Next in “Crack the Coding Interview” · step 2 of 11

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Roadmaps