Pregunta de entrevista de Microsoft

Build a 3D maze solver.

Respuesta de la entrevista

Anónimo

10 de may de 2015

I think we can look at the maze as a 2 dimensional binary tree. first dimension is horizontal. you can either turn left or right. second dimension is up or down. If that is the case, then can use some sort of DFS to find our way. start at entrance (root node). when you reach an intersection, always choose first right, then left, then up, then down. if you encounter a block, turn back and go to the next option. and keep doing that. if needs, revert back more levels. basically, its traversing a tree. One of the leaf nodes is the exit.