Question bank › Recursion
Dsa Recursion Easy

Count All Paths in a Grid

You are given a grid of size m x n (1-indexed). You can only move right or down from a cell. Write a program to count all the unique paths from the top-left corner to the bottom-right corner of the grid. Input the dimensions m and n, and output the total number of unique paths. Example: Input: 3 7 Output: 28

Key concepts

recursionbacktrackinggrids

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of InterviewLab's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.