DSA Crash Course
Algorithmic Paradigms

Algorithmic Paradigms — Overview

Mark when done:

Phase 2 — Algorithmic Paradigms (Days 13-22)

Goal: Master the seven strategies that solve most interview problems. Each module is a way of thinking about a problem, applied across the data structures from Phase 1.

Pre-req: Phase 1 (foundation data structures). You'll be using arrays, lists, trees, and graphs as the substrate for every paradigm here.

What You'll Cover

#ModuleDaysThe strategy
2.1Sorting & Searching13-14Binary search + binary search on the answer (Koko, Split Array). The latter is the single biggest interview unlock here.
2.2Two Pointers15Opposite-direction (sorted pair search), same-direction (in-place dedup, move zeros), fast-slow (cycle detection).
2.3Sliding Window16Fixed and variable windows. The "expand right, shrink left" template solves a huge class of substring/subarray problems.
2.4BFS & DFS17-18When to use BFS vs DFS. Multi-source BFS for "from every X simultaneously."
2.5Backtracking19Subsets, permutations, combinations, palindrome partitioning, N-Queens. The "include / exclude" template.
2.6Greedy20Jump Game, Gas Station, interval scheduling. When to not use DP.
2.7Dynamic Programming21-22The hardest module. Recursive → memoized → tabulated → space-optimised. The DAG-of-subproblems mental model.

The Mental Model

A paradigm is the answer to "what shape is the search space?":

Search space shapeParadigm
Linear, sortedBinary Search
Linear, find pair/windowTwo Pointers / Sliding Window
Tree / Graph, all reachableDFS or BFS
Tree / Graph, all combinationsBacktracking
Tree / Graph, optimal path with cumulative cost + overlapping subproblemsDynamic Programming
Sequential decisions where local-optimal = global-optimalGreedy

Read this table whenever you're stuck on "what approach should I even try?"

How DP Differs From Everything Else

Phase 2 saves DP for last for a reason: it requires you to be fluent with all of recursion, base cases, memoization, and table construction simultaneously. The Climbing Stairs solution file walks you through the recursive → memoized → tabulated → space-optimised progression in one place — re-read it before every DP problem until the four steps feel automatic.


External Resources (Hand-Picked Supplements)

For Dynamic Programming specifically

For the rest of Phase 2