Skip to main content
CodingPrepGuide.com • Official 1-Page Reference

Top 15 LeetCode Patterns Printable Cheat Sheet

The 15 Algorithmic Patterns that Solve 85% of LeetCode Medium & Hard Questions

⚡ Quick-Decision Recognition Triggers
› If input array is sorted: Two Pointers or Binary Search (O(log n) or O(n))
› If asked for contiguous subarray/substring maximum or minimum: Sliding Window (O(n))
› If asked for Top K or Kth largest/smallest element: Heap / Priority Queue (O(n log k))
› If asked for combinations, permutations, or all paths: Backtracking (O(2^n) or O(n!))
› If asked to detect cycle or find middle of linked list: Fast & Slow Pointers (O(n) time, O(1) space)

Core Array & Pointer Patterns 1-Page Cheatsheet

Heap, Stack & Search Patterns 1-Page Cheatsheet

Graph, Tree & Dynamic Programming 1-Page Cheatsheet

CodingPrepGuide.com • Free Coding Interview Preparation • No Sign-Up Required
Buy me a coffee
Daily Practice
0/0