FastPrepMatrix Path Existence
Problems/Matrix Path Existence

Matrix Path Existence

Wells Fargo logoWells Fargo● MediumINTERNOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report only says that finding a path in a matrix was requested. The binary grid, the endpoints, the movement rules, and the true or false result are our assumptions. Our version is about 45% the same as the reported question.

Given a rectangular binary matrix grid, determine whether a path exists from the top-left cell to the bottom-right cell.

  • A cell containing 1 is passable.
  • A cell containing 0 is blocked.
  • You may move one cell at a time up, down, left, or right.

Return true when such a path exists and false otherwise.

Function

pathExists(grid: int[][]) → boolean

Examples

Example 1

grid = [[1,1,0],[0,1,1],[0,0,1]]return = true
grid
012011010112001

A path follows the passable cells from the top-left cell through the center to the bottom-right cell.

Example 2

grid = [[1,0],[0,1]]return = false
grid
01010101

Diagonal movement is not allowed, so the two passable cells are disconnected.

Example 3

grid = [[1]]return = true
grid
001

The single cell is both the start and the destination.

Example 4

grid = [[0,1],[1,1]]return = false
grid
01001111

The starting cell is blocked.

Constraints

  • 1 <= grid.length <= 200.
  • 1 <= grid[i].length <= 200.
  • Every row has the same length.
  • grid[i][j] is 0 or 1.

More Wells Fargo Online Assessment questions

  • Server Upgrade PlanningOA · Seen Nov 2026
  • Student and Course EnrollmentOA · Seen Nov 2026
  • Bond Interest Summary Above 3%OA · Seen Oct 2026
  • Count Phrases Formed by Anagram ReplacementOA · Seen Oct 2026
  • Event Statistics AggregatorOA · Seen Sep 2026
  • Ordered Deployment Configuration ValidatorOA · Seen Sep 2026
  • Longest Subsequence That Is a SubstringOA · Seen Jul 2026
  • Overloaded Game Account InventoriesOA · Seen Jul 2026
  • Count Server ReplacementsOA · PHONE SCREEN · Seen Feb 2026
  • Minimum Remaining LengthOA · PHONE SCREEN · Seen Feb 2026

Similar questions at other companies

  • Minimize CommuteDatabricks · OA · PHONE SCREENDatabricks interview questions
  • Shortest Atom Action PathOpenAI · OAOpenAI interview questions
  • Minimum Cleaning Robot RunsHSBC · OAHSBC interview questions
  • Count Islands with DFS and BFSVisa · OAVisa interview questions
  • Number of IslandsGoldman Sachs · OA · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions
  • Count One Groups by SizeAgoda · OAAgoda interview questions
  • Ascend Vertical Wall (For off-campus 2025 batch hiring :)Uber · OAUber interview questions
  • Grid ExplorationIMC Trading · OAIMC Trading interview questions
  • Maximum Damage PatchGecko Robotics · OA · PHONE SCREEN
  • Nearest Different Maze Exit for a SnakeIntuit · OAIntuit interview questions

Interview reports that mention this question

  • Wells Fargo OA: What It Tests (2026)

Wells Fargo interview experiences

  • Wells Fargo SWE Intern OA and Interview Questions: 18 Experiences
All Wells Fargo interview questionsSee Wells Fargo hiring insights
Saved
class Solution {
    public boolean pathExists(int[][] grid) {
      // write your code here
    }
}
Checking account…