DSA Mastery · 5 ordered phases
Learn DSA in the order the ideas depend on.
Build one mental model at a time, trace a concrete example, use a lab when state changes matter, and then apply the idea in interview practice.
- Curriculum
- 5 phases
- Modules
- 19 modules
- Total lessons
- 123 lessons
- Interview sprint
- 9 checkpoints
Your Course Track
Start Your DSA Journey
Begin with Phase 1: Foundations & Core Structures to master array memory models, pointer techniques, and time complexity.
Ready to begin5 Phases · 14 Modules · 123 Lessons
Full course path
Five phases, with prerequisites made visible
Phase 1 is open by default. Expand any later phase when you need its module map; use the searchable curriculum when you already know the exact topic.
01Phase 17 modules · 38 lessonsReason about arrays and stateBuild the cost model and learn the highest-frequency array patterns.
Phase outcome: Choose between lookup, pointer, window, prefix-state, and binary-search strategies.
1Complexity & Problem Solving6 lessons · Foundation
1Big O, Ω, and ΘUpper, lower, and tight asymptotic bounds.2Best, average, and worst caseHow the same algorithm behaves across different inputs.3Space complexityInput space, auxiliary space, and recursion stacks.4Amortized analysisAverage cost across a sequence of operations.5Recurrences & Master TheoremAnalyze divide-and-conquer algorithms.6Problem-solving workflowExamples, constraints, brute force, invariants, and optimization.
3Arrays, Strings & Matrices6 lessons · Foundation
1Array memory modelLabContiguous storage, indexes, resizing, and shifting.2In-place manipulationReverse, rotate, partition, and remove values.3Subarrays vs subsequencesContiguous ranges and order-preserving choices.4String fundamentalsCharacters, immutability, building, and comparison.5Matrix traversalRows, columns, diagonals, spiral, and boundary walks.6Matrix transformationTranspose, rotate, and mark rows or columns.
5Hashing & Frequency Maps5 lessons · Foundation
1Hash-table internalsBuckets, hash functions, collisions, load factor, and resizing.2Sets & mapsPresence checks, key-value lookup, and uniqueness.3Frequency countingHistograms for strings, arrays, and multisets.4Prefix sum + hash mapTrack prior states to count subarrays.5Rolling hashIncrementally hash windows and substrings.
6Two-Pointer Patterns5 lessons · Foundation
1Opposite-direction pointersLabNarrow a sorted search space from both ends.2Same-direction pointersRead/write indexes for in-place compaction.3Merge pointersWalk two sorted sequences in linear time.4Three-sum reductionFix one value, then solve a two-pointer subproblem.5Palindrome & partitioningCompare ends or maintain regions.
7Sliding Window5 lessons · Intermediate
1Fixed-size windowLabAdd the incoming value and remove the outgoing value.2Variable-size windowExpand and shrink while maintaining a condition.3Frequency windowsTrack characters or values inside the active range.4Monotonic deque windowMaintain range minima or maxima in linear time.5When windows failNegative values and non-monotonic constraints.
8Prefix Sums & Kadane5 lessons · Intermediate
9Binary Search6 lessons · Intermediate
1Exact target searchLabDiscard half after comparing with the middle.2Lower & upper boundFind the first or last position satisfying a predicate.3Rotated sorted arraysIdentify the sorted half before eliminating.4Peak & mountain searchUse slope direction as the monotonic clue.5Binary search on answerFind the first feasible or last valid candidate.6Matrix binary searchMap flat indexes into rows and columns.
Complete modules in the displayed orderStart phase 1
02Phase 24 modules · 25 lessonsControl order and referencesUnderstand pointer safety, mutation, recursion, and constrained processing order.
Phase outcome: Trace reference changes and explain why stack, queue, or sorting order is useful.
10Linked Lists5 lessons · Foundation
1Singly linked listNodes, head/tail references, traversal, insertion, and deletion.2Doubly & circular listsBidirectional and wrap-around links.3In-place reversalReverse links while preserving the remaining chain.4Fast & slow pointersMiddle node, cycles, and cycle entry.5Merge & reorderSplit, interleave, merge, and partition lists.
11Stacks, Queues & Deques6 lessons · Foundation
1StackLabLIFO operations, call stacks, parsing, and undo.2Queue & circular queueFIFO processing, ring buffers, and scheduling.3DequeEfficient updates at both ends.4Monotonic stackNext greater/smaller and contribution ranges.5Monotonic queueSliding extrema and constrained DP.6Stack/queue conversionsImplement one access discipline with another.
12Recursion & Backtracking6 lessons · Intermediate
1Recursion fundamentalsBase cases, recursive contracts, and stack frames.2Divide and conquerSplit independent subproblems and combine results.3Subsets & combinationsBranch on choices while controlling duplicates.4PermutationsTrack used choices or swap positions.5Constraint searchLabN-Queens, Sudoku, word search, and pruning.6Memoized recursionCache repeated states before moving to tabulation.
4Sorting Algorithms8 lessons · Foundation
1Bubble SortLabAdjacent swaps and a growing sorted suffix.2Selection SortLabSelect the next minimum and grow a sorted prefix.3Insertion SortLabInsert each value into an already sorted prefix.4Merge SortLabDivide, recursively sort, and merge stable runs.5Quick Sort & QuickselectLabPartition around a pivot and recurse selectively.6Heap SortBuild a heap and repeatedly extract the extreme.7Counting, Radix & Bucket SortExploit key structure to avoid comparisons.8Stability & in-place trade-offsChoose a sort using more than runtime alone.
Complete modules in the displayed orderStart phase 2
03Phase 33 modules · 19 lessonsNavigate hierarchies and priorityMove from linear state into recursive structures, frontiers, prefixes, and ranges.
Phase outcome: Select tree, heap, trie, or interval techniques from the problem constraints.
13Trees & Binary Search Trees7 lessons · Intermediate
1Binary-tree modelNodes, edges, depth, height, leaves, and subtrees.2DFS traversalsPreorder, inorder, and postorder recursive contracts.3Level-order BFSProcess tree nodes one depth at a time.4BST operationsSearch, insert, delete, predecessor, and successor.5Balanced BSTsAVL and red-black invariants keep logarithmic height.6Tree constructionRebuild trees from traversal orders.7Path & ancestor patternsLCA, diameter, path sums, and subtree results.
14Heaps & Priority Queues6 lessons · Intermediate
1Binary heapLabComplete-tree layout, heap property, and array indexes.2HeapifySift values up or down and build a heap in linear time.3Top KKeep only the most relevant k values.4Two heapsBalance lower and upper halves for streaming medians.5K-way mergeMerge multiple sorted sources with a frontier heap.6SchedulingSelect the next job by priority or availability.
15Tries & Intervals6 lessons · Intermediate
1Trie / prefix treeLabCharacter edges, terminal markers, and prefix lookup.2Wildcard trie searchBranch when a pattern can match multiple edges.3Merge intervalsSort ranges and maintain the current merged end.4Insert intervalPreserve sorted non-overlapping ranges.5Meeting roomsCount simultaneous intervals with heaps or events.6Line sweepTurn interval boundaries into ordered events.
Complete modules in the displayed orderStart phase 3
04Phase 43 modules · 26 lessonsSearch, connect, and optimizeReason about choices, reachability, connectivity, and reusable optimal substructure.
Phase outcome: Distinguish greedy, graph, and dynamic-programming formulations.
16Greedy Algorithms6 lessons · Intermediate
1Greedy-choice propertyKnow when a local decision is safe.2Exchange argumentsProve an optimal solution can use the greedy choice.3Interval schedulingSelect compatible events using ordered endpoints.4Jump & reachabilityTrack the farthest achievable frontier.5Resource assignmentSort demands and resources before matching.6Huffman codingMerge the two least frequent nodes repeatedly.
17Graphs10 lessons · Intermediate
1Graph representationAdjacency lists, matrices, edge lists, and direction.2Depth-first searchLabExplore a branch fully; detect structure recursively.3Breadth-first searchLabExplore layers and shortest unweighted paths.4Grid graphsTreat matrix cells and neighbor moves as a graph.5Cycle & bipartite detectionUse colors, parents, or recursion state.6Topological sortLabOrder DAG nodes using indegrees or DFS finish times.7Union FindLabMaintain components with path compression and union by rank.8Minimum spanning treeKruskal and Prim for cheapest connectivity.9Shortest pathsLabBFS, Dijkstra, Bellman-Ford, and Floyd-Warshall.10Strongly connected componentsKosaraju and Tarjan decompositions.
18Dynamic Programming10 lessons · Advanced
1DP thinkingLabState, transition, base case, answer, and computation order.21D DPFibonacci, climbing stairs, robber, and state compression.30/1 knapsackChoose each item at most once.4Unbounded knapsackReuse choices for coin change and related problems.5Grid DPPaths, costs, obstacles, and multidirectional transitions.6String DPLCS, edit distance, palindromes, and word breaks.7LIS familySequence DP and patience-sorting optimization.8Interval DPSolve ranges by selecting split points.9Tree & DAG DPCombine child states or process topological order.10Bitmask & digit DPEncode subsets or prefix constraints in state.
Complete modules in the displayed orderStart phase 4
05Phase 52 modules · 15 lessonsAdd the specialist toolkitStudy less-frequent mathematical, string, pathfinding, and range-query techniques.
Phase outcome: Recognize specialist problems without treating every advanced topic as mandatory.
2Math, Number Theory & Bits6 lessons · Foundation
1GCD & LCMEuclidean algorithm and divisibility.2Prime numbers & sievePrimality testing and Sieve of Eratosthenes.3Modular arithmeticOverflow-safe arithmetic and cyclic values.4CombinatoricsPermutations, combinations, and counting choices.5Bit operationsSet, clear, toggle, test, and count bits.6XOR patternsCancellation, missing values, and unique elements.
19Advanced Algorithms & Structures9 lessons · Advanced
1KMP & prefix functionReuse matched-prefix information after mismatch.2Rabin–KarpUse rolling hashes for substring matching.3Z algorithmMeasure prefix matches from every position.4Fenwick treeLabPrefix aggregates with logarithmic updates.5Segment treeLabGeneral range queries, point/range updates, and lazy propagation.6Sparse tableStatic idempotent range queries.7Sweep lineProcess geometric or interval events in coordinate order.8A* searchGuide shortest-path exploration with an admissible heuristic.9Network flowResidual graphs, augmenting paths, and min-cut duality.
Complete modules in the displayed orderStart phase 5
Interview sprint
Nine high-frequency checkpoints
Use this as a revision track after Phase 1—not as a substitute for the prerequisite path.
- 01Complexity & Problem SolvingProblem-solving workflowExamples, constraints, brute force, invariants, and optimization.
- 02Arrays, Strings & MatricesIn-place manipulationReverse, rotate, partition, and remove values.
- 03Hashing & Frequency MapsSets & mapsPresence checks, key-value lookup, and uniqueness.
- 04Two-Pointer PatternsOpposite-direction pointersNarrow a sorted search space from both ends.
- 05Sliding WindowVariable-size windowExpand and shrink while maintaining a condition.
- 06Binary SearchExact target searchDiscard half after comparing with the middle.
- 07Trees & Binary Search TreesDFS traversalsPreorder, inorder, and postorder recursive contracts.
- 08GraphsBreadth-first searchExplore layers and shortest unweighted paths.
- 09Dynamic ProgrammingDP thinkingState, transition, base case, answer, and computation order.
Apply the idea
Pair lessons with practice
Use the practice sheets after each lesson to turn the mental model into a repeatable problem-solving pattern.