Counting Paths on a Grid from (0,0) to (5,5)

Number of paths in a square grid is an easy quant interview question on Combinatorics.

Difficulty Easy Topic Combinatorics

This problem looks at counting the number of distinct routes on a rectangular grid from one corner to the opposite corner, when each move can only go in two allowed directions. The candidate must reason about how many different sequences of these constrained moves can be taken to reach the target point, knowing that the total number of steps in each direction is fixed. It is a canonical lattice-path counting question in introductory combinatorics, often used in screening for roles that expect comfort with basic counting arguments and clean symbolic reasoning rather than brute-force enumeration.

The solution leans on viewing each path as a sequence composed of two indistinguishable types of steps and framing the task as counting how many such sequences exist. In practice, this usually reduces to using binomial coefficients or the equivalent "choose positions" interpretation. An interviewer is watching for recognition of the underlying structure, correct translation of the story into a combinatorial object, and a clear, generalizable argument rather than ad hoc counting. Care with symmetry, total step counts, and avoiding overcounting are key signals of understanding.

What it tests

This class of problems is governed by the principle of counting permutations of indistinguishable objects, often formalized through binomial coefficients. When a path or sequence is made up of a fixed number of two types of steps (such as `east` and `north`), the total number of unique arrangements is the number of ways to choose positions for one type among all steps. This is because the order in which you interleave the two types determines the unique path, and the steps themselves are indistinguishable except for their direction. The pattern holds because each path corresponds to a unique sequence of labeled moves, and the total count is unaffected by the specific labels—only their counts matter. This is a direct application of combinatorics, where the constraints reduce the problem to a question of arrangements rather than enumeration of each path individually.

Practise this question with written feedback, or hear it in a spoken mock interview.

Get started free