Minimum Path Sum
A medium-tier problem at 66% community acceptance, tagged with Array, Dynamic Programming, Matrix. Reported in interviews at Palo Alto Networks and 14 others.
Minimum Path Sum hits your OA and you've got maybe two minutes to recognize it. You're looking at a matrix, the problem asks for the lowest-cost path from top-left to bottom-right, and your first instinct is probably backtracking or BFS. Wrong move. This is a textbook Dynamic Programming problem, and companies like Microsoft, Google, Amazon, and Goldman Sachs ask it frequently. The trick is that you can only move right or down, which collapses the search space hard. If you blank on the DP setup during the live assessment, StealthCoder surfaces a working solution in seconds, invisible to the proctor.
Companies that ask "Minimum Path Sum"
Minimum Path Sum 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 approach fails because exploring all paths explodes into exponential complexity. The insight is simple: every cell's minimum cost is the cost of that cell plus the minimum of the cell above or to the left. Build a DP table row by row, left to right. Most candidates stumble on base case handling (the top row and left column have only one incoming direction) or forget to handle the 1x1 case. Space optimization matters too: you can solve this with O(1) extra space if you modify the input or O(m) if you use a single row. The problem tests whether you can recognize DP at a glance and implement it cleanly under pressure. When you're three minutes into the OA and unsure if your recurrence is right, StealthCoder gives you the confidence that you're building the right state machine.
Pattern tags
You know the problem.
Make sure you actually pass it.
Minimum Path Sum 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.
Minimum Path Sum interview FAQ
Is Minimum Path Sum harder than it looks?+
No. Once you see it's DP, the solution is mechanical. The hard part is recognizing the pattern in 90 seconds during a live OA. The 66% acceptance rate reflects that many candidates either time out or overthink it rather than miss the algorithm itself.
Do I really need to optimize space for this problem?+
Not strictly required to pass, but top companies like Google and Microsoft often ask you to optimize space after the first solution works. Master the O(m) single-row version so you can answer both approaches without hesitation.
How does Minimum Path Sum differ from other matrix DP problems?+
The movement constraint is the key. Only right and down moves mean each cell depends on at most two neighbors, not all neighbors. That's what makes DP feasible. Compare it to problems where you can move in all four directions, where constraints become much tighter.
What's the most common mistake candidates make?+
Forgetting or miscoding the base case. The top row has no cell above it, the left column has no cell to its left. If you don't handle this cleanly, your DP table breaks. Test your code on a 1x1 and 1xN matrices before submitting.
Is this problem still asked at FAANG companies?+
Yes. Microsoft, Google, Amazon, TikTok, and Uber all report asking it. The acceptance rate and company list confirm it's a stable, frequently-used assessment tool, not a one-off.
Want the actual problem statement? View "Minimum Path Sum" on LeetCode →