All articles

Interview prep, 7 min, October 24, 2026

The handful of patterns behind most interview questions

You do not need to memorise hundreds of problems. Most reduce to a small set of patterns. Learn to recognise them and the problems stop looking random.

Repeating geometric shapes, representing recurring patterns

The secret that makes strong candidates look fast is not that they have seen every problem. It is that they recognise which pattern a new problem fits, and they already know how that pattern works.

The core set

  • Two pointers — walk a sorted array from both ends or at two speeds.
  • Sliding window — a moving range over a sequence for subarray and substring problems.
  • Fast and slow pointers — cycle detection in linked lists.
  • Binary search — not just on arrays, but on answers.
  • Breadth-first search — shortest paths and level-by-level traversal.
  • Depth-first search and backtracking — explore all options, undo, try the next.
  • Dynamic programming — break a problem into overlapping subproblems and cache them.
  • Heaps — the “top k” and “merge k” family.

How to learn a pattern

Take one pattern and solve three or four problems that use it back to back. The repetition is the point: you are training recognition, not just getting answers. By the fourth, you will spot the shape before you finish reading the prompt.

“Stop asking “have I seen this problem?” Start asking “which pattern is this?””

Reviewing with intent

After you attempt a problem, label it with its pattern and note what tipped you off. When you later check the solution and the reasoning, confirm your label. That habit turns a pile of problems into a map you can navigate.

Try it on your next question

Reptor reads a question on your screen and answers it with the model you choose — plus a short explanation so it sticks.

Download Reptor