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.

Community Answers

1 answer from the community

Unlock Full Access

Answer any un-answered question from our database to unlock all community answers for 30 days.

Give & Take

Practice More Questions

3 answers published. Last candidate submission on Aug 29 2026, 4:22pm PDT. Interview question asked to Software Engineers interviewing at YouTube, MessageBird, Change Healthcare and other companies. Original question asked: Find the longest increasing path in a matrix.. Question last reported by a candidate interviewing at Audible for a Software Engineer interview on Sep 26 2026, 9:22pm PDT.