
N-Queens
The board is only the output surface. The real N-Queens solution is a depth-n search over column assignments, with three constraints checked before each…
View solutionMaster the coding interview patterns behind arrays, pointers, windows, binary search, backtracking, dynamic programming, trees, graphs, stacks, heaps, and more—then learn how to recognize the clues, decompose the problem, and turn the reasoning into clean code.
True mastery
A coding problem becomes easier when you can identify the structure that makes the solution work. AlgoGrinder teaches you to recognize those patterns, break problems into smaller obligations, derive the algorithm, and carry the reasoning all the way into clean code.
Experience behind the lessons

Joe Chang brings more than 20 years of software engineering experience across startups, research, international banking and FinTech, entrepreneurship, and production systems. His career has included building software, leading engineering work, hiring and interviewing engineers, and teaching more than 1,000 students. AlgoGrinder brings that engineering and teaching perspective to the reasoning skills behind coding interviews and algorithmic problem solving.
Problem patterns
Choose a solution pattern and practice recognizing the structural signals that point toward it before reading the final algorithm.
Use arrays, hash maps, and sets for fast keyed lookup across complements, counting, grouping, membership, positions, and deduplication.
Explore patternsCoordinate two indices around a movement invariant to eliminate candidates efficiently in sorted arrays, strings, partitions, and ranges.
Explore patternsMaintain a valid moving window while expanding and shrinking to optimize contiguous subarray and substring problems.
Explore patternsReason about overlap and boundaries across insertion, containment, coverage, scheduling, gaps, and other interval relationships.
Explore patternsSort intervals and maintain a current merged range while combining overlapping or adjacent regions into a compact result.
Explore patternsPreserve pointer reachability while reversing, splicing, partitioning, rotating, reordering, and deleting linked-list nodes in place.
Explore patternsTrack one frontier candidate per sorted source to merge multiple lists, arrays, or streams efficiently with a heap.
Explore patternsMaintain a shrinking candidate interval across ordered lookup, boundaries, rotated arrays, peaks, and other monotonic structures.
Explore patternsSearch an answer space by building a monotonic feasibility test and locating the boundary between possible and impossible values.
Explore patternsBuild a combinatorial decision tree with include-or-exclude choices, iterative expansion, or bit masks to enumerate solution families.
Explore patternsMake provably safe local choices using exchange arguments, dominance rules, or invariants that lead to a globally optimal result.
Explore patternsExplore a constrained search tree by choosing, recursing, pruning invalid paths, and undoing state as possibilities are tested.
Explore patternsDefine a one-dimensional state and derive its recurrence, base cases, evaluation order, and opportunities for memory compression.
Explore patternsModel problems with two-dimensional state when the solution depends on paired positions, grid coordinates, intervals, or progress dimensions.
Explore patternsExploit a value-to-index mapping to place elements naturally and expose missing, duplicate, or displaced values in place.
Explore patternsTreat grids as indexed 2D state for rotations, spiral traversals, row-column marking, layers, and in-place transformations.
Explore patternsUse last-in, first-out state to model nesting, parsing, unresolved obligations, simulations, path simplification, and deferred work.
Explore patternsMaintain candidates in monotonic order so dominated values disappear permanently in boundary, histogram, and range-extrema problems.
Explore patternsDefine what each subtree returns upward or carries downward to solve traversal, validation, aggregation, and structural tree problems.
Explore patternsTrack the smallest sufficient state—counters, balances, positions, flags, or best-so-far values—needed to preserve a scan invariant.
Explore patternsReason directly with binary representation using XOR, masks, shifts, bit counts, and bit-level state transformations.
Explore patternsSplit a problem into independent subproblems, solve each recursively, and combine their results through a structured recurrence.
Explore patternsFeatured problems
Start with problems that teach transferable reasoning patterns rather than one-off tricks.

The board is only the output surface. The real N-Queens solution is a depth-n search over column assignments, with three constraints checked before each…
View solution
A Sudoku validator does not solve the puzzle. It tracks whether the digits already placed violate any row, column, or 3×3 box constraint.
View solution
A grid DFS can match the right letters and still be wrong. The missing piece is path-local state: mark a cell when you enter it, explore from that choice,…
View solutionLatest
New coding interview problems with explicit derivation, complexity analysis, edge cases, and implementation reasoning.

The target does not identify the winning triplet. It tells each pointer which direction is still worth exploring.
View solution
A reliable 3Sum solution comes from turning a cubic search into a sequence of sorted two-sum scans—and proving why each pointer move is safe.
View solution
Four choices suggest an O(n^4) search. Sorting changes the last two choices into a controlled walk.
View solution
You receive two binary strings, a and b, and must return their sum as another binary string. The inputs contain only '0' and '1', have lengths from 1 to…
View solution
The lists already expose digits in the order addition needs. Scan both lists together, track one carry, and keep going until there is no digit or carry…
View solution
A reliable Balanced Binary Tree solution carries two facts upward from every subtree: its height and whether it is balanced.
View solutionBuild the pattern recognition behind coding interviews with ten carefully chosen problems across hashing, two pointers, sliding windows, linked lists, binary search, combinatorial generation, backtracking, dynamic programming, stacks, and trees. Follow each problem from structural clues and a baseline approach through the invariant, optimization, dry run, complexity, and clean implementation.
You’ll receive the bundle by email. You can unsubscribe anytime.