FastPrepMinimum Falling Path Sum
Problems/Minimum Falling Path Sum

Minimum Falling Path Sum

Scale AI logoScale AI● MediumNEW GRADOA

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The source reports a fixed 4×4 OA matrix, with any top-row start and down-left, down, or down-right moves to the final row. The author's n×m dynamic-programming discussion is a hypothetical generalization. This practice version uses general rectangular dimensions and supplied numeric bounds. Editorial estimate: about 90% agreement with the reported core.

Given a rectangular integer matrix, choose any cell in the top row. On each next row, move down-left, straight down, or down-right.

Return the minimum sum of a path that reaches the final row.

Function

minimumFallingPathSum(matrix: int[][]) → long

Examples

Example 1

matrix = [[2,1,3],[6,5,4],[7,8,9]]return = 13
matrix
012021316542789

The path 1 → 5 → 7 has sum 13.

Example 2

matrix = [[-19,57],[-40,-5]]return = -59
matrix
010-19571-40-5

Choose -19, then move down to -40.

Example 3

matrix = [[5]]return = 5
matrix
005

The only cell is both the top and final row.

Constraints

  • 1 <= matrix.length, matrix[i].length <= 1000.
  • All rows have the same length.
  • -1000000000 <= matrix[i][j] <= 1000000000.
  • The answer fits in a signed 64-bit integer.

More Scale AI Online Assessment questions

  • Part 2: Batch Access ReviewOA · Seen Nov 2026
  • Part 1: The Narrowest KeyOA · Seen Nov 2026
  • Build Sessions from Unordered Events (Part 1)OA · Seen Oct 2026
  • Match Billing Charges to User Sessions (Part 2)OA · Seen Oct 2026
  • Four-Player Trick-Taking Card Game SimulationOA · PHONE SCREEN · Seen Aug 2026
  • Free Windows Between Busy IntervalsOA · PHONE SCREEN · Seen Apr 2026
  • Compare Labeling Worker AnnotationsOA · Seen Mar 2025
  • Count Stable Server SubsegmentsOA · Seen Nov 2024
  • Distinct OR Values of Increasing SubsequencesOA · Seen Nov 2024
  • Running Through Walls with Limited EnergyOA · Seen Sep 2024

Similar questions at other companies

  • Grid Paths with Override PassesIMC Trading · OAIMC Trading interview questions
  • Largest Square of OnesOpenAI · OAOpenAI interview questions
  • Grid Paths with Override PassesMicrosoft · OAMicrosoft interview questions
  • Minimum Moves to Spread Stones Across a GridAmerican Express · OAAmerican Express interview questions
  • Maximum Reward (Intuit India)Intuit · OAIntuit interview questions
  • Largest Plus SignxAI · OAxAI interview questions
  • Calculate the Max ValueAmazon · OA
  • Largest Square of 1'sFactSet · OAFactSet interview questions
  • Longest Border-Ending Diagonal PatternZipRecruiter · OAZipRecruiter interview questions
  • Count Grid Words with One TurnCapital One · OACapital One interview questions

Interview reports that mention this question

  • Scale AI OA: What It Tests (2026)
  • Scale AI New Grad SWE and MLE Question Bank
  • Scale AI New Grad OA: Three Coding Problems

Scale AI interview experiences

  • Scale AI Forward Deployed Engineer Debugging Round: 1 Experience
  • Scale AI ML Research Engineering Intern Interviews: 1 Experience
  • Scale AI SWE Intern Debugging Interview: 9 Experiences
All Scale AI interview questionsSee Scale AI hiring insights
Saved
class Solution {
    public long minimumFallingPathSum(int[][] matrix) {
        // write your code here
    }
}
Checking account…