As reported: Morgan Stanley round 1 (6+ years of experience, Oct 2026), after a HackerRank test and a walk-through of the candidate's current architecture: given an
m × ngrid, count the unique paths from the top-left cell to the bottom-right cell moving only right or down. It was solved with dynamic programming, and the interviewer cross-examined the reasoning and each decision. The round ended with Java questions.
A robot sits in the top-left cell of an m × n grid. In each step it moves either one cell right or one cell down. Return the number of distinct paths that take it to the bottom-right cell.
This is LeetCode 62 — Unique Paths.
Example 1
m = 3, n = 7 -> 28
Example 2
m = 3, n = 2 -> 3 right→down→down, down→down→right, down→right→down
Constraints: 1 ≤ m, n ≤ 100; the answer is at most 2 · 10^9.
Code runner format: one JSON value per line: m, then n (LeetCode's test-case format). Implement uniquePaths(m, n); the harness prints the count.