Uber interview question

BFS application in a grid structure.