57 Coding Interview Patterns Worth Knowing (The Full List)

Arrays & Strings

• Two Pointers • Prefix Sums • Sliding Window • Kadane's Algorithm • Counting Subarrays • Merge Intervals • Cyclic Sort

Hashing

• Existence Checks • Frequency Counting • Duplicate Detection • Complement Lookup

Linked Lists

• Fast & Slow Pointers • In-Place Reversal • Dummy Head Nodes • Merging Lists

Stacks & Queues

• Matching Brackets • Monotonic Stack • Monotonic Queue

Binary Search

• Classic Binary Search • Leftmost & Rightmost Boundary • Search on the Answer • Rotated Arrays • 2D Matrix Search

Trees

• DFS Traversals • BFS Level Order • Iterative DFS • BST Properties • Lowest Common Ancestor

Heaps

• Top K Elements • Two Heaps • K-Way Merge • Task Scheduling

Backtracking

• Subsets • Combinations • Permutations • N-Queens • Word Search

Graphs

• Depth First Search • Breadth First Search • Multi-Source BFS • Grid Traversal • Adjacency List Traversal • Connected Components • Cycle Detection

Advanced Graphs

• Topological Sort • Union Find • Dijkstra's Algorithm • Minimum Spanning Tree

Dynamic Programming

• Memoization • Tabulation • 0/1 Knapsack • Unbounded Knapsack • Longest Common Subsequence • Longest Increasing Subsequence • Palindromic Substrings

Bit Manipulation

• XOR Tricks • Bit Masks

57 Coding Interview Patterns

Arrays & Strings

  • Two Pointers
  • Prefix Sums
  • Sliding Window
  • Kadane's Algorithm
  • Counting Subarrays
  • Merge Intervals
  • Cyclic Sort

Hashing

  • Existence Checks
  • Frequency Counting
  • Duplicate Detection
  • Complement Lookup

Linked Lists

  • Fast & Slow Pointers
  • In-Place Reversal
  • Dummy Head Nodes
  • Merging Lists

Stacks & Queues

  • Matching Brackets
  • Monotonic Stack
  • Monotonic Queue

Binary Search

  • Classic Binary Search
  • Leftmost & Rightmost Boundary
  • Search on the Answer
  • Rotated Arrays
  • 2D Matrix Search

Trees

  • DFS Traversals
  • BFS Level Order
  • Iterative DFS
  • BST Properties
  • Lowest Common Ancestor

Heaps

  • Top K Elements
  • Two Heaps
  • K-Way Merge
  • Task Scheduling

Backtracking

  • Subsets
  • Combinations
  • Permutations
  • N-Queens
  • Word Search

Graphs

  • Depth First Search
  • Breadth First Search
  • Multi-Source BFS
  • Grid Traversal
  • Adjacency List Traversal
  • Connected Components
  • Cycle Detection

Advanced Graphs

  • Topological Sort
  • Union Find
  • Dijkstra's Algorithm
  • Minimum Spanning Tree

Dynamic Programming

  • Memoization
  • Tabulation
  • 0/1 Knapsack
  • Unbounded Knapsack
  • Longest Common Subsequence
  • Longest Increasing Subsequence
  • Palindromic Substrings

Bit Manipulation

  • XOR Tricks
  • Bit Masks