MongoDB interview question

Design and code an algorithm to randomly generate mazes for a children's book.