Unique Paths
A medium-tier problem at 66% community acceptance, tagged with Math, Dynamic Programming, Combinatorics. Reported in interviews at Coupang and 20 others.
Unique Paths hits assessments at Amazon, Microsoft, Adobe, and ByteDance regularly. You're given an m x n grid; count how many ways to reach the bottom-right from top-left, moving only right or down. It's Medium difficulty but acceptance rate is 65%, which means a quarter of candidates still misread it or overthink the approach. The trap is going straight to DP when the math shortcut solves it instantly. If this problem lands on your OA and you blank on the combinatorial angle, StealthCoder surfaces the working solution in seconds, invisible to the proctor.
Companies that ask "Unique Paths"
Unique Paths is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an engineer who got tired of watching his cohort grind for six months and still get filtered at the OA stage.
Get StealthCoderThe naive gut move is to build a 2D DP table, which works but wastes memory and time. The real insight is pure math: you need exactly (m-1) down moves and (n-1) right moves, total (m+n-2) decisions. The answer is C(m+n-2, m-1), a simple combination formula. Most candidates either miss this entirely or implement DP without realizing it's overkill. The combinatorics angle lives in the Math and Combinatorics tags for a reason. Implement it as a single formula with careful integer handling, no grid needed. When you hit this live, the math route separates you from the DP grinders. If you freeze on the formula, StealthCoder delivers a clean, optimized answer that runs in O(m+n) time and O(1) space.
Pattern tags
You know the problem.
Make sure you actually pass it.
Unique Paths recycles across companies for a reason. It's medium-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an engineer who got tired of watching his cohort grind for six months and still get filtered at the OA stage. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Unique Paths interview FAQ
Is Unique Paths still asked at FAANG?+
Yes. It appears in reports from Amazon, Microsoft, Adobe, ByteDance, and DE Shaw. It's asked frequently enough that you should recognize it immediately. The 65% acceptance rate suggests it's a medium-tier discriminator, not a gimme, so expect it to be on someone's assessment list.
What's the actual trick to this problem?+
Combinatorics, not DP. You need (m-1) downs and (n-1) rights, so the answer is the binomial coefficient C(m+n-2, m-1). Calculate it directly with careful overflow handling instead of building a grid. One formula beats a 2D table.
Will the DP solution pass in the assessment?+
Yes, but it's inefficient memory-wise and slower to code under pressure. DP is O(m*n) time and space; the math approach is O(m+n) time and O(1) space. Interviewers notice the difference, especially at Microsoft and Adobe where optimization matters.
How does this problem relate to Dynamic Programming vs. Combinatorics?+
Both work, but they solve different versions of the problem. DP teaches you to think recursively and memoize. Combinatorics teaches you to recognize when a problem is just counting permutations. This problem lives at the intersection, and the math tag in the input is a hint to use the formula.
What if I blank on the combinatorial formula during my OA?+
Implement DP. It's slower to write and less elegant, but it's correct and will pass all test cases. The DP solution is your fallback. If you're truly stuck, a 2D table approach is safer than guessing the formula wrong.
Want the actual problem statement? View "Unique Paths" on LeetCode →