unemployed.dev☕ Support

Interview prep

LeetCode Pattern Guide

Skip the random grind. These 7 patterns cover the vast majority of what shows up in real interviews. Learn to recognize them fast — that's the actual skill.

Universal guide

The Cheat Sheet

Use this to identify patterns fast and survive any coding screen.

Recognize the pattern
  • array + pair sum / compare endsTwo Pointers
  • substring / subarray / longest / shortestSliding Window
  • cycle / middle / linked listFast & Slow Pointers
  • sorted / monotonic / minimum viable valueBinary Search
  • tree / graph / visit nodes / islandsDFS or BFS
  • overlapping subproblems / count ways / min costDynamic Programming
  • generate all combinations / paths / permutationsBacktracking
What to do in an interview
  1. 1.Say the brute force first — always
  2. 2.Identify the repeated work or exploitable structure
  3. 3.Name the pattern out loud before you code
  4. 4.Explain why the pattern fits this problem
  5. 5.Code the simplest correct version
  6. 6.Test with a small example manually before submitting
Common mistakes
  • Jumping into coding before understanding the problem
  • Not clarifying input size, edge cases, or output format
  • Off-by-one errors in binary search boundaries
  • Forgetting the visited set in graph problems
  • Messing up the window shrink condition in sliding window
  • Panicking on DP because the state wasn't defined first
  • Going silent when stuck instead of narrating your thinking

Interview rule: If you can identify the pattern in the first 2 minutes, the problem becomes dramatically easier. The real skill is pattern recognition — not memorizing 500 solutions.