Reported February 2024
Metabreadth first search

Search Mysterious Grid

Reported by candidates from Meta's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Meta OA. Under 2s to a working solution.
Founder's read

Meta's February OA pulled a grid search problem that looks deceptively simple on the surface. You're counting symbol occurrences in a 2D grid with specific traversal rules baked in. The trick isn't the counting. It's understanding which cells you're allowed to visit and in what order. The rules matter. StealthCoder reads the problem image and feeds you the exact traversal constraint you might miss on first glance, so you don't tank a second attempt.

The problem

\ You're exploring a mysterious grid filled with ancient symbols, and you possess a set of unique symbols that you seek within this grid. Your mission is to devise a method to search for these symbols amidst the labyrinth of characters. However, there are rules to follow:\ \ Your task is to calculate the number of times you encounter these symbols within the grid, following these strict guidelines. \ \ P.S. For original prompt, pls refer to source image 💛\

Reported by candidates. Source: FastPrep

Pattern and pitfall

This is a BFS pattern disguised as a counting problem. You're not just scanning the grid randomly. The 'strict guidelines' almost certainly define a reachable set of cells from a start point, and you count symbols only within that reachable region. BFS finds connected components or regions satisfying a constraint. The common miss: candidates ignore the traversal rules and brute-force a simple grid scan, then fail hidden test cases where the rules eliminate 90% of cells. The solution is to run BFS from your starting position, mark visited cells, then count only within that visited set. StealthCoder highlights the constraint text in the image so you don't skip it during the OA.

Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.

If this hits your live OA

You can drill Search Mysterious Grid cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as number of islands. If you have time before the OA, drill that.

⏵ The honest play

You've seen the question. Make sure you actually pass Meta's OA.

Meta reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Search Mysterious Grid FAQ

Is this just a 2D array search?+

No. The 'strict guidelines' define which cells are reachable. BFS from a start point, build your reachable set, count symbols only there. Ignore the rules and you'll fail on test cases where the grid is mostly blocked.

Do I need to implement a full graph library?+

No. Standard BFS with a queue, visited set, and four-directional movement works fine. Keep it simple. Most candidates overcomplicate the traversal logic.

What if the grid has obstacles or blocked cells?+

The rules probably define valid moves (cardinal directions, no diagonal, skip certain symbols, etc.). Read the image carefully. Your BFS respects those constraints when expanding neighbors.

Should I handle multiple starting points?+

The problem statement hints at 'a set of symbols you seek.' It's counting occurrences, not finding paths. One start point, one BFS, count matches in the reachable region.

How do I prep in 24 hours if I haven't seen BFS in a while?+

Write BFS from memory: queue, visited set, loop until empty, expand neighbors. Test on a 3x3 grid by hand. You'll remember the pattern instantly. That's enough.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Meta.

OA at Meta?
Invisible during screen share
Get it