FastPrepNavigate a Binary Grid with Obstacle Jumps
Problems/Navigate a Binary Grid with Obstacle Jumps

Navigate a Binary Grid with Obstacle Jumps

Roblox logoRoblox● MediumNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in a Roblox new grad onsite interview. The report allows steps up, down, left, and right on cells with 1, and jumps over one 0 to land on a 1, from the top-left to the bottom-right. We chose that jumps can repeat, what happens when an end cell is blocked, and the limits. Our version is about 95% the same as the reported question.

A rectangular binary grid contains walkable cells 1 and blocked cells 0. Determine whether you can travel from the top-left cell to the bottom-right cell.

You may move up, down, left, or right in either of these ways:

  • Step one cell onto a 1.
  • Jump two cells over a 0 and land on a 1.

Both the intermediate and landing cells must lie inside the grid. Diagonal moves and jumps over a 1 are not allowed.

For this exercise, assume jumps may be repeated any number of times and do not change the grid. There is no obstacle-removal budget. If either endpoint is blocked, return false. A single walkable cell is already reachable. Return true exactly when some sequence of legal moves reaches the bottom-right cell.

Function

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

Examples

Example 1

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

Jump right over the top-middle obstacle, then down over the middle-right obstacle.

Example 2

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

Two consecutive blocked cells cannot be crossed by a jump over exactly one obstacle.

Example 3

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

The start is already the destination.

Constraints

  • 1 <= grid.length, grid[0].length <= 30.
  • Every row has the same length and every entry is 0 or 1.

More Roblox Onsite Interview questions

  • Most Frequent Call Path From Function Trace LogsPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Design Search Autocomplete SystemPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Candy Crush Grid Matching and GravityPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Topological Sort with Secondary OrderingPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Most Frequent Call Stack Per ThreadPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Count and Score Distinct Hat AssignmentsONSITE INTERVIEW · Seen Sep 2026
  • Rate Limiter Sliding Window With Per-Entity LimitsPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
  • Most Frequent Call Path in Interleaved LogsONSITE INTERVIEW · Seen Aug 2026
  • Grid Pathfinding with Obstacles (DFS)PHONE SCREEN · ONSITE INTERVIEW · Seen Jun 2026
  • Maximize Distance to Closest Person — Return the SeatONSITE INTERVIEW · Seen Jun 2026

Similar questions at other companies

  • Number of IslandsAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Explore an Unknown Grid and Find a PathLinkedIn · ONSITE INTERVIEWLinkedIn interview questions
  • Nearest Charging Station on a GridSpotify · ONSITE INTERVIEW
  • Number of Islands with Diagonal ConnectivityGoogle · ONSITE INTERVIEWGoogle interview questions
  • Island Count and Maximum AreaOracle · ONSITE INTERVIEWOracle interview questions
  • Shortest Increasing Path to a TargetUber · ONSITE INTERVIEWUber interview questions
  • Mouse and Cheese ReachabilityMeta · ONSITE INTERVIEWMeta interview questions
  • Number of IslandsTripjack · ONSITE INTERVIEWTripjack interview questions
  • Number of IslandsTekion · ONSITE INTERVIEWTekion interview questions
  • Number of IslandsGoldman Sachs · OA · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions

Interview reports that mention this question

  • Roblox New Grad HackerRank OA: 18 Experiences (Part 5 of 7)

Roblox interview experiences

  • Roblox OA: What It Tests (2026)
  • Roblox New Grad Early OA Tasks: 10 Experiences (Part 7 of 7)
  • Roblox New Grad Engineer Rounds: 13 Experiences (Part 6 of 7)
  • Roblox New Grad CodeSignal Finals: 23 Experiences (Part 4 of 7)
  • Roblox New Grad Games and BQ: 25 Experiences (Part 3 of 7)
All Roblox interview questionsSee Roblox hiring insights
Saved
class Solution {
    public boolean canNavigateGrid(int[][] grid) {
        // write your code here
    }

}
Checking account…