As reported: LinkedIn Staff Software Engineer (Bengaluru, Aug 2025), the Applications coding round: a problem similar to LeetCode's The Maze, solved with DFS.
A maze is a grid of 0 (empty) and 1 (wall). A ball starts at start = [row, col] and can roll up, down, left or right; once it starts rolling it does not stop until it hits a wall (or the maze border). When it stops, it can choose the next direction. Return true if the ball can stop at destination.
This is LeetCode 490 — The Maze.
Example 1
maze = [[0,0,1,0,0],
[0,0,0,0,0],
[0,0,0,1,0],
[1,1,0,1,1],
[0,0,0,0,0]]
start = [0,4], destination = [4,4]
Output: true (left → down → left → down → right → down → right)
Example 2
same maze, start = [0,4], destination = [3,2]
Output: false (the ball can pass through [3,2] but never stop there)
Constraints: 1 ≤ m, n ≤ 100; the start and destination are empty cells and differ.
Code runner format: LeetCode's test-case format, one JSON value per line (one line per argument). Implement hasPath(maze, start, destination); the harness prints the result.