Skip to content

How to use this

The goal isn’t to memorise questions. It’s to be fluent in the small set of ideas that top-tier interviews keep testing. When you can recognise the shape of a problem, you can rebuild the solution under pressure, in any language.

  1. TL;DR: the idea in two sentences.
  2. The idea in plain words: an analogy and the core insight.
  3. See it: an interactive visualization. Change the input, step forward and back, and watch the invariant hold.
  4. When to reach for it: the phrases in a problem statement that should make you think of it.
  5. How it works: the template, then code in Python, TypeScript and C#. Your language choice is remembered across pages.
  6. What it costs: time and space, and why.
  7. Variations, pitfalls, and what to say in the interview.
  8. Check yourself: short quizzes that test the reasoning, not recall.
  1. Read the page and play with the visualization until you can predict the next step before pressing ▶.
  2. Close the page. Re-write the template from memory in your strongest language.
  3. Do one of the “practice on your own” exercises, then a Sandbox problem from the same stage.
  4. If you get stuck in a Sandbox round, the interviewer’s hints point you back to the right page here.