Minimum Time Takes to Reach Destination Without Drowning
A hard-tier problem at 52% community acceptance, tagged with Array, Breadth-First Search, Matrix. Reported in interviews at Wix and 0 others.
You're at a cell on a grid and water's rising. You have to reach the destination before you drown. This is the problem Wix asks when they want to see if you can model time-dependent state space search correctly. The trap is thinking about distance when you should be thinking about timesteps and cell occupancy. If this appears on your assessment and you blank on how water spread interacts with BFS pathfinding, StealthCoder runs invisibly and surfaces the solution in seconds. Fifty-two percent of candidates solve it first try. You won't be one of them unless you know the trick.
Companies that ask "Minimum Time Takes to Reach Destination Without Drowning"
Minimum Time Takes to Reach Destination Without Drowning is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround.
Get StealthCoderThe core pattern is multi-source BFS where water doesn't spread uniformly; it spreads according to specific rules that usually aren't stated clearly. The common failure is treating this like a straight shortest-path problem. You need to model the state as (row, col, time) and simulate water spreading at each timestep, then do BFS from the starting position, only moving to cells that won't be flooded by the time you arrive. The real gotcha is that you can't just check if a cell will eventually flood; you have to check if it floods before you get there. Most candidates code a basic BFS, miss the water timing logic, and submit a wrong answer. If you hit this live and the water rules aren't clicking, StealthCoder handles the simulation and state transitions for you.
Pattern tags
You know the problem.
Make sure you actually pass it.
Minimum Time Takes to Reach Destination Without Drowning recycles across companies for a reason. It's hard-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built because the OA filter rejects engineers who'd pass the on-site. That's a broken filter. This is the workaround. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Minimum Time Takes to Reach Destination Without Drowning interview FAQ
Is this really a hard problem or does it just feel hard?+
It's genuinely hard. The 52% acceptance rate is below average for most platforms. The difficulty comes from correctly modeling time-dependent obstacles, not the BFS itself. Once you nail the water-spread simulation, the pathfinding is standard. The first attempt usually gets the state representation wrong.
How do I know when I can move to a cell?+
A cell is safe to visit at time T if the water hasn't flooded it by the time you arrive. You need to track when water reaches each cell, then compare that to your arrival time at that cell. If water time <= your arrival time, the cell is blocked. This is the core condition most people get wrong initially.
Why is this a matrix problem and not just array search?+
You're moving on a 2D grid, so you're doing BFS across rows and columns with up/down/left/right directions. The water also spreads across the matrix. If it were 1D you'd use an array, but 2D grids default to matrix representation and require directional neighbor logic.
Can I just run BFS and ignore the water until I find a path?+
No. That's the classic mistake. You have to interleave water simulation with pathfinding. At each timestep, water spreads to new cells, then you process the next layer of BFS. Ignoring timing means you'll think cells are reachable when they're actually underwater by the time you get there.
Does Wix ask this frequently or was it a one-off?+
Wix has reported it at least once in public data. It's not a household-name problem like two-sum or merge intervals, but it shows up in companies that care about simulation and state-space search. If you're targeting Wix or similar, this pattern is worth owning.
Want the actual problem statement? View "Minimum Time Takes to Reach Destination Without Drowning" on LeetCode →