Skip to content

Matrix problems,
and the tell.

The input is a grid and the answer is about cells, regions, or a walk across them. 140 problems in the catalogue carry this tag, from first-week easy to interview hard.

Free to start. Running and submitting a solution never costs credits.

How the pattern actually works.

One mechanism, and the mistake that costs people the problem.

The tell. The input is a grid and the answer is about cells, regions, or a walk across them.

The mechanism. A grid is a graph where each cell has up to four neighbours. Most grid problems are BFS, DFS or DP with the neighbour list written out as four direction offsets.

What goes wrong. Bounds. Every neighbour needs a check on all four sides before you read it, and it is the one check people skip.

The ones asked most often.

By how often the catalogue records them being set, not by our opinion.

  1. Spiral MatrixMediumasked at 45 companies
  2. Rotate ImageMediumasked at 33 companies
  3. Walls and GatesMediumasked at 7 companies
  4. Shortest Path in a Grid with Obstacles EliminationHardasked at 6 companies
  5. Rotating the BoxMediumasked at 5 companies
  6. Diagonal TraverseMediumasked at 5 companies
  7. Largest Submatrix With RearrangementsMediumasked at 2 companies
  8. Find the Safest Path in a GridMediumasked at 2 companies
  9. As Far from Land as PossibleMediumasked at 2 companies
  10. Design a 3D Binary Matrix with Efficient Layer TrackingMediumasked at 1 companies

Read it, watch it, then solve it.

The order that makes a pattern stick.

Everything in the app, in one place.

Practice, interviews and the tools, all free to start. Swipe to see the rest.

Free to start: 100 AI credits when you sign up and 100 every month. Start free in the app

About matrix problems.

Free to start, no card.

Start practising
How do I know a problem is a matrix problem?

The input is a grid and the answer is about cells, regions, or a walk across them.

How many matrix problems should I solve?

Enough to stop needing the hint, which is usually ten to fifteen across the levels, not the whole list. The catalogue tags 140, split roughly 15 easy, 86 medium and 39 hard in the sample we show, so work up rather than across.

What goes wrong most often in matrix problems?

Bounds. Every neighbour needs a check on all four sides before you read it, and it is the one check people skip.

Is practising by pattern better than a problem sheet?

A sheet tells you what to solve. A pattern tells you why those problems sit together, which is the part that carries over to the problem you have not seen. That is why the app files every problem under its pattern.