PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Google

Find minimum threshold enabling grid path

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's understanding of grid pathfinding, reachability under constraints, and algorithmic optimization, focusing on skills such as graph traversal and handling threshold-based feasibility.

  • hard
  • Google
  • Coding & Algorithms
  • Software Engineer

Find minimum threshold enabling grid path

Company: Google

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Technical Screen

## Problem You are given an `m x n` integer grid `grid`. You start at the top-left cell `(0, 0)` and want to reach the bottom-right cell `(m-1, n-1)`. You may move **one step** at a time in **4 directions**: up, down, left, right (no diagonals). You may not go outside the grid. Define a threshold value `T`. A path is **valid under threshold `T`** if **every cell value on the path is `<= T`**. ### Task Return the **minimum integer `T`** such that there exists **at least one** valid path from `(0,0)` to `(m-1,n-1)` under threshold `T`. ### Input - `grid`: a 2D array of integers with dimensions `m x n`. ### Output - An integer: the minimum `T` that makes the destination reachable. ### Notes / Constraints (assume) - `1 <= m, n <= 200` - Cell values are integers (may be large; e.g., up to `10^9` in absolute value). - Movement is 4-directional. ### Example If `grid = [[0,2],[1,3]]`, the answer is `3` because you cannot reach the bottom-right without allowing the cell value `3`.

Quick Answer: This question evaluates a candidate's understanding of grid pathfinding, reachability under constraints, and algorithmic optimization, focusing on skills such as graph traversal and handling threshold-based feasibility.

Related Interview Questions

  • Compute Turnstile Crossing Times - Google (hard)
  • Simulate In-Place Cellular State Updates - Google (hard)
  • Determine Whether a Word Exists in a Graph - Google (medium)
  • Solve Shortest Paths and Rental Allocation - Google (medium)
  • Solve Two Array Optimization Problems - Google (medium)
Google logo
Google
Feb 11, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
5
0
Loading...

Problem

You are given an m x n integer grid grid.

You start at the top-left cell (0, 0) and want to reach the bottom-right cell (m-1, n-1).

You may move one step at a time in 4 directions: up, down, left, right (no diagonals). You may not go outside the grid.

Define a threshold value T. A path is valid under threshold T if every cell value on the path is <= T.

Task

Return the minimum integer T such that there exists at least one valid path from (0,0) to (m-1,n-1) under threshold T.

Input

  • grid : a 2D array of integers with dimensions m x n .

Output

  • An integer: the minimum T that makes the destination reachable.

Notes / Constraints (assume)

  • 1 <= m, n <= 200
  • Cell values are integers (may be large; e.g., up to 10^9 in absolute value).
  • Movement is 4-directional.

Example

If grid = [[0,2],[1,3]], the answer is 3 because you cannot reach the bottom-right without allowing the cell value 3.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Google•More Software Engineer•Google Software Engineer•Google Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.