Meta VO Coding Interview / OA: Maze Solver – Complete the Missing Functionality

19 Views
No Comments

Background

This is a small codebase related to mazes. It has some basic utilities to parse a maze from a string representation, print out a maze, and attempt basic maze solving. However, an intern from summers past wrote the code, so there might be some bugs. They also didn’t quite finish their summer project, so let’s:

  • uncomment the tests
  • fix any bugs
  • finish any functionality they hadn’t done yet

Completing the Question

Check out the unit tests. There are four files:

  • p1_test_maze_printer
  • p2_test_maze_solver
  • p3_test_maze_solve_hard
  • p4_test_maze_solver_with_key

You can go in order, p1 to p4, to complete the question. Make sure to uncomment the tests to complete each part.

TODO: Uncomment the following code as you implement the proper logic for MazePrinter.

Uncomment to test solving the big maze

@Test
public void testCanSolveWithChutes() {
    /* Test that we can solve a maze with chutes. */
    MazeSolver solver = new MazeSolver(mazeWithChutes);
    assertTrue(solver.hasSolutionViaBFS());
}

@Test
public void testCanSolveWithImpossible() {
    /* Test that can't solve a maze with impossible chutes. */
    MazeSolver solver = new MazeSolver(mazeWithImpossibleChutes);
    assertFalse(solver.hasSolutionViaBFS());
}

This Meta VO problem is a code-completion maze solver task. You need to uncomment and satisfy the unit tests, fix bugs in the maze printer, and complete the solver logic. The key algorithmic idea is usually breadth-first search over the maze, treating special tiles such as chutes or keys as state transitions, and tracking the right visited state to determine whether the maze is solvable.

END
 0