Top 50 bfs Interview Questions
The most frequently asked bfs questions across all roles and companies, ranked by real interview frequency. Updated daily.
Use BFS to compute shortest path distances from a source node to every node in an unweighted graph.
Unity
NTT DATA
Telus DigitalPrint the bottom view of a binary tree using breadth-first traversal and horizontal distance tracking.
Siemens
MakeMyTripCount four-directionally connected islands in a 2D grid using BFS or DFS.
Use iterative DFS coloring to detect circular dependencies in an Applied Intuition simulation module graph.
Applied Intuition
KLA
NextdoorUse topological sorting to detect course dependency cycles and return a valid completion order.
Snap
GooglePPiramal FinanceSign up to see every question
Create a free account to unlock this list and practice real interview questions.
Use multi-source BFS to find the minimum time for all reachable fresh oranges to rot.
Autodesk
Amazon Web ServicesKKotakPrint a binary tree's top view from left to right using breadth-first traversal and horizontal distances.
PayU
NVIDIATraverse a binary tree level by level, alternating left-to-right and right-to-left order with BFS.
Compass
Warner Bros. Discovery