Early Access: 87 spots left.

Claim

Stacks

Use stacks for expression parsing, history tracking, and LIFO problems

  • Introduction to Stacks Pattern
  • Valid Parentheses
  • Remove All Adjacent Duplicates In String
  • Min Stack
  • Daily Temperatures
  • Largest Rectangle in Histogram

Two Pointers

Master the two pointers technique for array and string problems

  • Introduction to Two Pointers Pattern
  • Pair with Target Sum
  • Dutch National Flag (Sort Colors)
  • Minimum Window Sort

Fast and Slow Pointers

Use two pointers at different speeds to detect cycles and find the middle of a linked list

  • Introduction to Fast and Slow Pointers Pattern
  • LinkedList Cycle
  • Middle of the LinkedList
  • Start of LinkedList Cycle
  • Happy Number
  • Rearrange a LinkedList
  • Cycle in a Circular Array

Queues

Use queues for BFS, scheduling, and FIFO problems

  • Introduction to Queues Pattern
  • Number of Recent Calls
  • Design Circular Queue
  • Sliding Window Maximum

Sliding Window

Learn to use sliding window technique for substring and subarray problems

  • Introduction to Sliding Window Pattern
  • Maximum Sum Subarray of Size K
  • Permutation in a String
  • Longest Substring with K Distinct Characters
  • Longest Substring with Same Letters after Replacement

Merge Intervals

Solve problems involving overlapping intervals

  • Introduction to Merge Intervals Pattern
  • Merge Intervals
  • Intervals Intersection
  • Conflicting Appointments
  • Minimum Meeting Rooms

Tree Breadth First Search

Traverse trees level by level with breadth-first search

  • Introduction to Tree Breadth First Search Pattern
  • Binary Tree Level Order Traversal
  • Average of Levels in Binary Tree
  • Binary Tree Right Side View
  • Binary Tree Zigzag Level Order Traversal
  • Maximum Width of Binary Tree
  • Vertical Order Traversal of a Binary Tree

Heap

Use heaps to keep the largest or smallest elements within reach

  • Introduction to Heap Pattern
  • Kth Largest Element in a Stream
  • Last Stone Weight

Graph

Graph traversal and graph algorithms

  • Introduction to Graph Pattern
  • Flood Fill
  • Find if Path Exists in Graph
  • Number of Islands

Tree Depth-First Search

Explore tree paths down to the leaves with depth-first search

  • Introduction to Tree Depth-First Search Pattern
  • Path Sum
  • Diameter of Binary Tree
  • Path Sum II
  • Binary Tree Maximum Path Sum
Course · Best Seller·10 patterns · 40 lessons

Coding Interview Patterns,
solved by pattern.

Pattern-based lessons, in-browser practice and step-by-step solutions in five languages. Once you recognise why a technique works, dozens of seemingly different problems become straightforward.

Level
Study time
Patterns
10
Lessons
40
Languages
5

Includes: Coding Interview Patterns and Low Level Design.

valid_parentheses.py
Stacks · pattern 1
def is_valid(s: str) -> bool:
    # pattern: stacks, match openers with LIFO
    stack, pairs = [], {')': '(', ']': '[', '}': '{'}
    for c in s:
        if c in pairs:
            if not stack or stack.pop() != pairs[c]:
                return False
        else:
            stack.append(c)
    return not stack
All 18 tests passed·Runtime 32 ms·Mem 14 MB
Why patterns

Stop memorising problems.
Start recognising structure.

01

Pattern first

Two Pointers, Sliding Window, BFS, DFS, and Dynamic Programming. A small set of techniques solves most interview problems.

02

Visual walkthroughs

Every solution is annotated with a step-by-step visualisation showing how state evolves.

03

Write, run, submit

In-browser editor with five language runtimes, a test runner, and a readable console.

What you'll learn

Eight things you will walk into the
next interview with.

Covers the linear scan patterns, traversal patterns, and the dynamic programming family that appear in most FAANG-style interviews.

How to recognise which pattern applies to a problem within the first few minutes.
Two Pointers, Sliding Window, Fast and Slow Pointers, and other linear scan techniques.
Tree and graph traversal patterns: BFS, DFS, topological sort, and shortest path algorithms.
Dynamic programming patterns: 0/1 Knapsack, Fibonacci sequences, longest common subsequence, and more.
Merge Intervals, Cyclic Sort, and other array manipulation patterns that appear in nearly every interview.
How to analyse time and space complexity and communicate trade-offs to an interviewer.
Backtracking, subsets, permutations, and combinatorial search techniques.
Hands-on practice with an in-browser editor supporting Python, Java, C++, JavaScript, and Go.
Curriculum

10 patterns. 40 problems.
Click any chapter to preview.

Unlock

All 40 lessons. Five languages.
Plus the Low Level Design course.

Includes Coding Interview Patterns and Low Level Design.

Get all courses