Data Structures & Algorithms
Learn to choose and build data structures that fit a problem. Explore arrays, trees, graphs, and dynamic programming through either Python or C++.
What helps
Begin with the language Foundations if needed. Loops, functions, and collections are useful before tackling the larger algorithmic problems.
Python pathway
Programming Foundations / Practice rooms / Track curriculum and enrollment
Complexity, Arrays & Hashing
Practice estimating work with Big-O, scanning arrays, building prefix sums and updating lists in place. Use sets and dictionaries to track duplicates, frequencies and earlier values. Compare the time and memory used by each approach.
- Big-O Thinking: 5 lessons
- Array Techniques: 5 lessons
- Hashing: Sets & Maps: 5 lessons
- Hashing Patterns: 5 lessons
- Putting It Together: 5 lessons
Two Pointers & Sliding Window
Use two indices to compare, merge and rearrange sequences. Maintain sums, counts and other state as a window moves through an array or string. Learn which input assumptions let each pointer move safely.
- Opposite Ends: 5 lessons
- In-place Partitioning: 5 lessons
- Fixed-size Window: 5 lessons
- Variable-size Window: 5 lessons
- Putting It Together: 5 lessons
Stacks, Queues & Strings
Build stacks and queues, then use them to match brackets, evaluate expressions and process values in order. Practice string operations and use monotonic stacks or deques to keep useful candidates for later queries.
- Build a Stack: 5 lessons
- Monotonic Stack: 5 lessons
- Build a Queue: 5 lessons
- String Techniques: 5 lessons
- Putting It Together: 5 lessons
Binary Search & Sorting
Use sorted order to narrow a search, then apply feasibility checks to search for a minimum speed or capacity. Implement sorting algorithms and use ordered intervals to solve merging and scheduling problems.
- Binary Search: 5 lessons
- Search the Answer: 5 lessons
- Build the Sorts: 5 lessons
- Sorting Applications: Intervals: 5 lessons
- Putting It Together: 5 lessons
Linked Lists
Build and traverse linked lists, then practice reversing, merging, finding cycles, and preserving node identity. Implement a doubly linked list and an OrderedDict-based LRU cache. Finish with stable list sorting and pairwise merging of multiple sorted lists.
- Build and Traverse: 5 lessons
- Pointer Surgery: 5 lessons
- Rearranging: 5 lessons
- Lists in Design: 5 lessons
- Putting It Together: 5 lessons
Trees & Binary Search Trees
Build binary trees and practice traversal, depth, balance, diameter, paths and ancestor queries. Binary search tree ordering supports O(height) search, which is O(log n) when the tree is balanced and O(n) when skewed.
- Build and Traverse: 5 lessons
- Tree Properties: 5 lessons
- Binary Search Trees: 5 lessons
- Tree Algorithms: 5 lessons
- Putting It Together: 5 lessons
Heaps, Priority Queues & Tries
Use heaps to select priorities, track ranks and medians, and merge sorted inputs. A binary heap exposes its minimum in constant time and removes it in logarithmic time. Build tries to distinguish complete words from prefixes and support wildcard searches.
- Build a Heap: 5 lessons
- Heap Applications: 5 lessons
- Build a Trie: 5 lessons
- Two Heaps & Scheduling: 5 lessons
- Putting It Together: 5 lessons
Graphs & Advanced Graphs
Represent relationships with adjacency lists, then explore them with breadth-first and depth-first search. Apply traversal to grids, order prerequisites, track connected components and find shortest paths under the appropriate weight assumptions.
- Build and Traverse: 5 lessons
- Grids as Graphs: 5 lessons
- Ordering and Cycles: 5 lessons
- Union-Find: 5 lessons
- Shortest Paths: 5 lessons
Recursion, Backtracking & Greedy
Trace recursive calls and base cases, then generate subsets, permutations and combinations. Use backtracking to explore choices and greedy rules when a local decision can be justified. Compare the assumptions that make each method correct.
- Recursion Foundations: 5 lessons
- Subsets and Permutations: 5 lessons
- Backtracking Puzzles: 5 lessons
- Greedy Choices: 5 lessons
- Putting It Together: 5 lessons
Dynamic Programming + Capstone
Learn to define a subproblem, choose its base cases, and reuse earlier answers. Start with stairs and house choices, then work through coins, sequences, grids, and strings. Compare rolling states, tables, and center expansion before combining these ideas in selection, counting, and stock-cooldown problems.
- One-Dimensional DP: 5 lessons
- Sequence DP: 5 lessons
- Grid DP: 5 lessons
- String DP: 5 lessons
- Knapsack & the Capstone: 5 lessons
C++ pathway
Programming Foundations / Practice rooms / Track curriculum and enrollment
Complexity, Arrays & Hashing
Every interview starts here. Reason about cost with Big-O, get fluent with the array techniques that show up everywhere (prefix sums, Kadane, in-place two pointers), then unlock the single most useful interview tool: the hash map. In C++ that means std::vector, std::unordered_map, and std::unordered_set. By the end you turn brute-force O(n^2) scans into clean O(n) solutions.
- Big-O Thinking: 5 lessons
- Array Techniques: 5 lessons
- Hashing: Sets & Maps: 5 lessons
- Hashing Patterns: 5 lessons
- Putting It Together: 5 lessons
Two Pointers & Sliding Window
Two of the highest-yield interview patterns, in depth. Two pointers walk an array from both ends or in the same direction to replace nested loops with a single O(n) pass. Sliding windows track a contiguous run that grows and shrinks, turning substring and subarray problems from O(n^2) into O(n). This project works through the opposite-end and in-place two-pointer moves, fixed and variable windows, windows backed by frequency maps, and a synthesis chapter of the classics.
- Opposite-End Two Pointers: 5 lessons
- In-Place Two Pointers: 5 lessons
- Fixed-Size Windows: 5 lessons
- Variable-Size Windows: 5 lessons
- Windows with Frequency Maps: 5 lessons
- Synthesis: The Classics: 5 lessons
Stacks & Queues
Two simple structures with outsized interview value. A stack (last in, first out) powers matching, parsing, and the monotonic-stack pattern that answers 'next greater' questions in O(n). A queue (first in, first out) and a deque drive streaming and sliding-window problems. Build them with std::stack, std::queue, and std::deque, and use them to solve the classics.
- Stack Fundamentals: 5 lessons
- The Monotonic Stack: 5 lessons
- Queues and Deques: 5 lessons
- More Stack Patterns: 5 lessons
- Putting It Together: 5 lessons
Binary Search & Sorting
Halving the search space is the second great interview idea after hashing. Master binary search and its boundary variants, the powerful 'binary search on the answer' pattern, search in rotated and 2D arrays, the classic sorting algorithms built from scratch, and the problems that sorting unlocks. Deepened with extra chapters on answer-search and harder variants.
- Binary Search Fundamentals: 5 lessons
- Binary Search on the Answer: 5 lessons
- Rotated and 2D Arrays: 5 lessons
- Sorting From Scratch: 5 lessons
- What Sorting Unlocks: 5 lessons
- Harder Searches: 5 lessons
Linked Lists
Pointers, made concrete. A linked list is nodes joined by next-pointers, and the interview classics live here: reversal, the fast-and-slow two-pointer trick for cycles and midpoints, merging sorted lists, and careful in-place reordering. You will build a ListNode and manipulate pointers directly, the skill that pointer-heavy interviews probe.
- Traversing a List: 5 lessons
- Reversing and Modifying: 5 lessons
- Fast and Slow Pointers: 5 lessons
- Merging and Combining: 5 lessons
- Reordering In Place: 5 lessons
- Advanced List Surgery: 5 lessons
Binary Trees
The deepest project: binary trees and binary search trees, where most recursion intuition is built. Work through the traversals, tree properties, BST operations, root-to-leaf paths and side views, structural transforms (invert, symmetry, lowest common ancestor), construction from traversals, and tree dynamic programming. Seven chapters of the recursion that interviews lean on hardest.
- Tree Traversals: 5 lessons
- Tree Properties: 5 lessons
- Binary Search Trees: 5 lessons
- Paths and Views: 5 lessons
- Structural Transforms: 5 lessons
- Construction: 5 lessons
- Tree Dynamic Programming: 5 lessons
Heaps & Tries
Two specialized structures with sharp uses. A heap (priority queue) keeps the smallest or largest element one cheap step away, the engine behind top-K, scheduling, and running-median problems. A trie stores strings as shared character paths, making prefix queries and autocomplete fast. Build both with std::priority_queue and a custom trie, and apply them to the interview classics.
- The Max-Heap: 5 lessons
- The Min-Heap and Greedy: 5 lessons
- Streaming and Two Heaps: 5 lessons
- The Trie: 5 lessons
- Trie Applications: 5 lessons
- Putting It Together: 5 lessons
Graphs
The most general structure, and the one interviews probe hardest. Represent a graph as an adjacency list, traverse it breadth-first and depth-first, detect cycles and order a directed graph with topological sort, manage connectivity with union-find, solve the grid-as-graph classics (islands, flood fill, rotting oranges), and compute shortest paths with Dijkstra. Seven chapters covering the graph patterns that show up again and again.
- Representing a Graph: 5 lessons
- Breadth-First Search: 5 lessons
- Depth-First Search: 5 lessons
- Directed Graphs: 5 lessons
- Union-Find: 5 lessons
- Grids as Graphs: 5 lessons
- Shortest Paths: 5 lessons
Backtracking & Greedy
Two opposite strategies. Backtracking explores every valid possibility by choosing, recursing, and un-choosing, the skeleton behind subsets, permutations, combinations, and constraint puzzles. Greedy makes the locally best choice and never looks back, fast and simple when local optimum leads to global optimum, as in interval scheduling and jump games. This project builds the backtracking template thoroughly, then the greedy classics.
- Subsets and Combinations: 5 lessons
- Permutations and Arrangements: 5 lessons
- Constraint Puzzles: 5 lessons
- Greedy: Reachability and Jumps: 5 lessons
- Greedy Classics: 5 lessons
- Putting It Together: 5 lessons
Dynamic Programming
The capstone of the track. Dynamic programming solves problems with overlapping subproblems by computing each one once and reusing it. Build the whole toolkit: one-dimensional DP, coin and unbounded-knapsack problems, the great subsequence problems (LIS, LCS, edit distance), grid DP, the 0/1 knapsack family, string DP, and the stock and interval classics. Seven chapters of the pattern that separates strong candidates from the rest.
- One-Dimensional DP: 5 lessons
- Coins and Unbounded Knapsack: 5 lessons
- Subsequence DP: 5 lessons
- Grid DP: 5 lessons
- The Knapsack Family: 5 lessons
- String DP: 5 lessons
- Stocks and Intervals: 5 lessons