Question bank › Dynamic Programming
Dsa Dynamic Programming Easy

Minimum Path Sum in Grid

Given a 2D grid filled with non-negative integers, find a path from the top left to the bottom right, which minimizes the sum of the numbers along the path. You can only move either down or right. Implement a function that takes the grid as input and returns the minimum path sum. The input consists of multiple lines, each representing a row of the grid, with integer values separated by spaces. Output the minimum path sum. Example: Input: 1 3 1 1 5 1 4 2 1 Output: 7

Key concepts

dynamic_programminggrid_traversal

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.