Leetcode 490. The Maze
Given a grid maze where a ball, once rolled, continues in a direction until it hits a wall, determine whether the ball can reach and stop exactly at the destination. Core challenge: treat the cells where the ball stops as graph nodes and use graph search (BFS/DFS) over those stopping positions rather than step-by-step moves.
Asked at:
Salesforce
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late August, 2025
Meta
Senior
Early May, 2025
Salesforce
Senior
The questions involved implementing classes for a maze, understanding that we actually need a graph to represent it. Then we moved to speak about different ways to represent a graph with pros and cons. We finished by implementing a rather generic BFS algorithm and talking about the complexity.
Your account is free and you can post anonymously if you choose.