Skip to content
Coding interview problem solving

Recognize the pattern. Derive the solution.

Master 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

Turn unfamiliar problems into familiar patterns

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

AlgoGrinder Team

AlgoGrinder Team

Joe Chang

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.

  • Recognize the pattern from the clues. Learn how constraints, sortedness, contiguity, monotonicity, repeated work, graph structure, and state dependencies point toward useful algorithm families.
  • Break hard problems into smaller obligations. Decompose a large prompt into conditions, states, subproblems, invariants, and implementation responsibilities you can solve one at a time.
  • Test whether you can reproduce the reasoning. Use self-assessment questions to check pattern recognition, complexity, invariants, edge cases, and algorithm derivation after each problem.
  • See the algorithm unfold. Use clear diagrams and step-by-step states to follow pointers, windows, recursion trees, dynamic-programming tables, traversals, and structural changes.
  • Explain your solution like an interview candidate. Practice communicating the baseline, pattern, tradeoffs, correctness, complexity, and edge cases in a way an interviewer can follow.

Problem patterns

Browse coding interview patterns

Choose a solution pattern and practice recognizing the structural signals that point toward it before reading the final algorithm.

foundation
3 articles

Arrays & Hashing

Use arrays, hash maps, and sets for fast keyed lookup across complements, counting, grouping, membership, positions, and deduplication.

Explore patterns
core-pattern
16 articles

Two Pointers

Coordinate two indices around a movement invariant to eliminate candidates efficiently in sorted arrays, strings, partitions, and ranges.

Explore patterns
core-pattern
3 articles

Sliding Window

Maintain a valid moving window while expanding and shrinking to optimize contiguous subarray and substring problems.

Explore patterns
core-pattern
1 article

Intervals

Reason about overlap and boundaries across insertion, containment, coverage, scheduling, gaps, and other interval relationships.

Explore patterns
core-pattern
1 article

Merge Intervals

Sort intervals and maintain a current merged range while combining overlapping or adjacent regions into a compact result.

Explore patterns
core-pattern
9 articles

In-Place Linked List Manipulation

Preserve pointer reachability while reversing, splicing, partitioning, rotating, reordering, and deleting linked-list nodes in place.

Explore patterns
intermediate
1 article

K-Way Merge

Track one frontier candidate per sorted source to merge multiple lists, arrays, or streams efficiently with a heap.

Explore patterns
core-pattern
6 articles

Modified Binary Search

Maintain a shrinking candidate interval across ordered lookup, boundaries, rotated arrays, peaks, and other monotonic structures.

Explore patterns
intermediate
1 article

Binary Search on the Answer

Search an answer space by building a monotonic feasibility test and locating the boundary between possible and impossible values.

Explore patterns
core-pattern
1 article

Subsets & Combinatorial Generation

Build a combinatorial decision tree with include-or-exclude choices, iterative expansion, or bit masks to enumerate solution families.

Explore patterns
intermediate
3 articles

Greedy Techniques

Make provably safe local choices using exchange arguments, dominance rules, or invariants that lead to a globally optimal result.

Explore patterns
intermediate
13 articles

Backtracking

Explore a constrained search tree by choosing, recursing, pruning invalid paths, and undoing state as possibilities are tested.

Explore patterns
intermediate
5 articles

One-Dimensional Dynamic Programming

Define a one-dimensional state and derive its recurrence, base cases, evaluation order, and opportunities for memory compression.

Explore patterns
advanced
10 articles

Two-Dimensional Dynamic Programming

Model problems with two-dimensional state when the solution depends on paired positions, grid coordinates, intervals, or progress dimensions.

Explore patterns
core-pattern
1 article

Cyclic Sort & Index Placement

Exploit a value-to-index mapping to place elements naturally and expose missing, duplicate, or displaced values in place.

Explore patterns
core-pattern
4 articles

Matrices & Grid Transformations

Treat grids as indexed 2D state for rotations, spiral traversals, row-column marking, layers, and in-place transformations.

Explore patterns
core-pattern
2 articles

Stacks

Use last-in, first-out state to model nesting, parsing, unresolved obligations, simulations, path simplification, and deferred work.

Explore patterns
intermediate
2 articles

Monotonic Stacks & Queues

Maintain candidates in monotonic order so dominated values disappear permanently in boundary, histogram, and range-extrema problems.

Explore patterns
core-pattern
17 articles

Tree Depth-First Search

Define what each subtree returns upward or carries downward to solve traversal, validation, aggregation, and structural tree problems.

Explore patterns
core-pattern
18 articles

State Tracking & Invariants

Track the smallest sufficient state—counters, balances, positions, flags, or best-so-far values—needed to preserve a scan invariant.

Explore patterns
intermediate
2 articles

Bitwise Manipulation

Reason directly with binary representation using XOR, masks, shifts, bit counts, and bit-level state transformations.

Explore patterns
advanced
1 article

Divide & Conquer

Split a problem into independent subproblems, solve each recursively, and combine their results through a structured recurrence.

Explore patterns

Featured problems

Practice high-value interview patterns

Start with problems that teach transferable reasoning patterns rather than one-off tricks.

3D abstract geometric structure with gold lines and black polygons on a dark background.
advanced
13 min read

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 solution
A modern open laptop with a black screen placed on lush green grass, symbolizing technology and nature.
intermediate
8 min read

Valid Sudoku

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 child actively assembling a robotics project with electronic components, showcasing technology education.
intermediate
14 min read

Word Search

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 solution

Latest

Recently added problem solutions

New coding interview problems with explicit derivation, complexity analysis, edge cases, and implementation reasoning.

Professional team discussing analytics and brainstorming ideas in a meeting room.
intermediate
12 min read

3Sum Closest

The target does not identify the winning triplet. It tells each pointer which direction is still worth exploring.

View solution
Close-up of hands coding on a laptop, showcasing software development in action.
intermediate
10 min read

3Sum

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
Visual abstraction of neural networks in AI technology, featuring data flow and algorithms.
advanced
13 min read

4Sum

Four choices suggest an O(n^4) search. Sorting changes the last two choices into a controlled walk.

View solution
Lush green pine tree with a vibrant blue sky background, perfect for nature-themed projects.
beginner
11 min read

Add Binary

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
A person working on a laptop with a red notebook and glasses on a white table.
intermediate
10 min read

Add Two Numbers

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
Close-up of a craftsman using an angle grinder, emitting sparks in a metal workshop.
beginner
9 min read

Balanced Binary Tree

A reliable Balanced Binary Tree solution carries two facts upward from every subtree: its height and whether it is balanced.

View solution
Free coding interview bundle

Get the AlgoGrinder Coding Interview Patterns Starter Pack

Build 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.

No spam. You can unsubscribe anytime. See our Privacy policy.