← Meta Interview Insights

Meta·Software Engineer·Online Assessment (OA)·Intermediate

Intermediate
Jun 2026

Summary

Meta SWE online assessment with a maze solver problem split into multiple stages. The first part was debugging broken output code, then building out a full BFS-based solver on top of it. Read the source files carefully or you will waste a lot of time.

Questions Asked (1)

Q1

Given a maze represented as a 2D grid, first fix the existing buggy code that incorrectly draws the maze output, then implement a maze solver using BFS across subsequent test stages.

Algorithms & Data StructuresRoot Cause Analysis
Author's notes

The bug fix part tripped me up more than I expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, reproduce the bug by tracing the drawing logic with a small example, then fix it by correcting the coordinate mapping or loop bounds. Next, implement BFS for maze solving, ensuring you handle edge cases like unreachable exits and multiple paths. Finally, test incrementally and optimize if needed.

Pro tip: Verbalize your debugging process: explain how you isolate the bug, form a hypothesis, and verify the fix. This shows structured problem-solving, which Meta values highly.

1. Understand the problem and reproduce the bug

Clarify the maze representation, expected output, and the buggy drawing code. Run a small example to observe the incorrect output.

2. Debug and fix the drawing code

Trace the drawing logic, identify the root cause (e.g., off-by-one, wrong coordinate order), and apply a minimal fix. Verify with the example.

3. Design BFS for maze solving

Define states (cells), transitions (4-directional moves), and goal condition. Use a queue and visited set to avoid cycles.

4. Implement and test BFS

Code the BFS, handling edge cases like start=end, no path, and multiple paths. Test with various mazes, including the fixed drawing.

5. Analyze complexity and optimize

Discuss time and space complexity (O(R*C)). Mention potential optimizations like bidirectional BFS if needed.

Key Points to Mention

  • Root cause analysis: identify the exact line causing the drawing bug (e.g., swapped row/col indices).
  • BFS algorithm: queue, visited set, level-order traversal to find shortest path.
  • Edge cases: start equals end, no path, multiple paths, large mazes.
  • Complexity: O(R*C) time and space for BFS on a grid.
  • Testing strategy: unit tests for drawing and solving, incremental testing.
  • Code clarity: modular functions for drawing and solving, meaningful variable names.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.