Coding

Find the longest increasing path in a matrix.

Given an m x n integers matrix, return the length of the longest strictly increasing path in the matrix. From each cell, you can either move in four directions: left, right, up, or down.

Input: matrix = [[1,2],[3,4]]

Output: 3

Explanation: The longest strictly increasing path is 1 -> 3 -> 4 (or 1 -> 2 -> 4), both of which have a length of 3.

Was asked at

Practice this question with AI

First session is free - no credit card required.

Go Premium

More interviews, more skills, more success.

Practice More Questions

1 answer published. Last candidate submission on Jul 24 2026, 6:43pm PDT. Interview question asked to Software Engineers interviewing at Rubrik, Discord, Paytm and other companies. Original question asked: Find the longest increasing path in a matrix.. Question last reported by a candidate interviewing at IQVIA for a Software Engineer interview on Jul 24 2026, 3:34am PDT.