Data Structures & Algorithms Roadmap
Eighteen stations on three ladders, from Big-O, arrays and hashing through stacks, trees and heaps to BFS, shortest paths and dynamic programming, each with a Build it task and a checkpoint question. Use it to see which patterns this path covers and which ones, such as two pointers, sliding windows and dynamic programming, you will need to practice outside it.
Fizz Buzz
The classic screening question: return the list for 1 to n, testing divisibility by both 3 and 5 before either alone, or the FizzBuzz case never fires. Its real job here is mechanical, getting you comfortable with the editor, the Run shortcut and the hidden tests, so that the first problem that matters is not also your first time using the tool.
Binary Search: The Vault
You crack a vault of sorted dials by guessing, then watch the Halver find any value in O(log n) looks by keeping a low and high window and discarding the half that cannot hold the target. The Solve it exercise asks for binary_search(arr, target) against hidden tests, the base for first-occurrence, search-insert-position and binary-search-on-the-answer questions.
Two Sum
Find the two indices that add up to a target in one pass by storing each value's index in a hash map and checking whether target minus the current number has already been seen. It is the template for the trade-memory-for-time move behind Contains Duplicate, Group Anagrams and Subarray Sum Equals K, and the classic place to state the O(n²) brute force out loud before improving it.
BFS: The Flood
Breadth-first search played as a flood spreading through a maze in rings: a FIFO queue, a visited set, and the guarantee that the first time you reach a cell is the shortest path on an unweighted grid. The runnable Python and TypeScript version is your template for Number of Islands, Rotting Oranges, Word Ladder and any shortest-path question where every step costs the same.
Build Order: DFS & Topological Sort
You schedule eight dependent tasks by hand, then watch depth-first search finish nodes bottom-up and reverse that order into a valid build order, with a back edge exposing any cycle. It covers Course Schedule and alien-dictionary style questions, and its comparison with Kahn's in-degree algorithm gives you a second approach for when the interviewer asks for one.
Six Degrees: Union-Find
Union-find keeps items in groups through a parent array and answers whether two items are connected in near-constant time, once union by rank and path compression keep the trees flat. The Solve it task, counting connected groups from a list of edges, is the core of Number of Provinces, Redundant Connection and the cycle check inside Kruskal's minimum spanning tree.
Dijkstra: The Last Mile
Dijkstra played as a courier crossing a city: a min-priority queue pops the cheapest known corner, relaxes its streets and locks each distance for good, which only works because no street costs less than zero. Expect it on Network Delay Time and cheapest-route questions, along with the follow-ups on why one negative edge breaks it and what the O((V + E) log V) bound assumes.
Quicksort: The Pivot Pit
Watch Lomuto partitioning drop each pivot into its final position, then pick your own pivots and push the sort into its O(n²) worst case on already sorted input. Interviewers use it for Kth Largest Element through quickselect, for in-place partition questions such as Sort Colors, and for the classic follow-up on why randomizing the pivot matters.
Merge Sort: The Cascade
Merge sort played as a cascade of sorted runs doubling in size, which shows why it is O(n log n) on every input, stable, and paid for with an O(n) buffer. The merge step alone answers Merge Two Sorted Lists and Merge Sorted Array, and the same divide-and-conquer recursion is how you count inversions or sort a linked list.
Valid Parentheses
Decide whether a string of brackets is balanced and correctly nested by pushing each opener onto a stack and checking each closer against the top, with a closing-to-opening map making the match one lookup. Treat it as this path's final timed check: aim to finish in about ten minutes, then try Min Stack and Daily Temperatures, which use the same last-in, first-out idea.