Skip to content

LeetCode Cheatsheet

Fifty of the most commonly asked interview problems, grouped by the pattern that solves them.

  1. Pick a pattern below (or in the sidebar) and read its Overview: when to reach for it, plus a template.
  2. Open a problem. Read the statement and try it yourself first.
  3. Only then reveal the solution, in Python, TypeScript or Java.
  4. Mark the problem Done if you could have written it cold, or Needs review if not.
  5. The day before the interview, redo the Needs review pile using the filter below.

Stuck matching a problem to an approach? See the pattern cheatsheet. Need complexities fast? See the Big-O reference.

0 of 50 done0 to review

Arrays & Hashing0/5

Two Pointers0/4

Sliding Window0/3

Stack0/3

Binary Search0/2

Linked List0/5

Trees0/6

Heap0/3

Backtracking0/4

Graphs0/4

Tries0/1

1-D Dynamic Programming0/6

2-D Dynamic Programming0/2

Intervals0/2