Breadth-First Search interview questions
165 breadth-first search problems tagged across recent interview reports. Drilled most heavily by doordash, linkedin, and snap.
Breadth-First Search is a graph traversal pattern that explores nodes layer by layer, making it essential for level-based problems, shortest paths, and connected component discovery. With 165 problems tagged across this pattern and heavy emphasis at DoorDash (63 problems), LinkedIn (60), and Snap (53), BFS isn't optional, it's a baseline competency that interviewers expect you to recognize and implement cleanly under pressure. If you freeze on a BFS variant during your live assessment, StealthCoder solves it invisibly while you stay calm.
Most-asked breadth-first search problems
Showing top 50 of 165 breadth-first search problems by # companies asking.
You can't drill every breadth-first search variant before the assessment. StealthCoder runs invisibly during screen share and solves whichever variant they throw at you. No browser extension. No detection signature. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE.
Get StealthCoderBFS problems fall into clear subtypes: level-order tree traversal (binary-tree-level-order-traversal, binary-tree-right-side-view), shortest distance in grids (01-matrix, as-far-from-land-as-possible), and connected component labeling (accounts-merge). The pattern is straightforward in theory, queue-based iteration, but variants hide in problem statement wording. You'll spot BFS when you see "nearest", "closest", "distance", "level", or "infect from source." The trap is implementing it correctly under time pressure. Drill grid-based BFS first (01-matrix), then tree-level problems, then graph connectivity. When a hard BFS variant lands in your live OA and you can't recall the exact traversal order or multi-source setup, StealthCoder reads the problem and outputs working code in seconds, undetected.
Companies that hire most on breadth-first search
165 breadth-first search problems.
You won't drill them all. Pass anyway.
Breadth-First Search is one of the patterns interviews actually filter on. Memorizing every variant in a week is a fantasy. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds, no matter which breadth-first search flavor lands in your live OA. Made by a working Amazon engineer who got tired of watching qualified friends bomb OAs they'd solve cold in an IDE. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Breadth-First Search interview FAQ
How many BFS problems should I drill before my interview?+
At minimum, solve 8 to 12 from different subtypes: grid distance (01-matrix), tree levels (binary-tree-level-order-traversal), and graph connectivity (accounts-merge). That covers the core structures. Then drill company-specific variants if you're targeting DoorDash or LinkedIn, both of which weight BFS heavily.
Is BFS the same as DFS for interview problems?+
No. BFS guarantees shortest path in unweighted graphs and processes nodes level-by-level. DFS explores depth-first and doesn't naturally find shortest paths. For problems tagged "distance" or "nearest," BFS is the right choice. Misreading the requirement costs you the problem.
Which companies drill BFS the hardest in interviews?+
DoorDash asks 63 BFS-tagged problems, LinkedIn 60, and Snap 53. These three treat it as a core competency. Google, Uber, and Meta each have 40 or more. If you're interviewing there, BFS proficiency isn't a bonus, it's expected.
How do I recognize a BFS problem in the wild?+
Look for keywords: "nearest", "closest", "distance", "level", "infect", "spread", or "shortest path without weights." If the problem involves a grid, tree, or graph and asks for distance or connectivity, BFS is likely the intended approach. Multi-source problems (several starting points) are classic BFS signals.
What's the hardest part of BFS in a live interview?+
Off-by-one errors in level tracking, forgetting to mark visited nodes (causing infinite loops), and mishandling multi-source initialization. You'll drill these in practice, but under live pressure and time limits, small mistakes slip through. That's when StealthCoder is your safety net.