Amazon Breadth First Search Questions

168 breadth first search problems asked at Amazon interviews

Easy (18)Medium (111)Hard (39)

Questions

TitleDifficulty
Number of IslandsMedium
Course ScheduleMedium
Rotting OrangesMedium
Word LadderHard
Course Schedule IIMedium
Coin ChangeMedium
Serialize and Deserialize Binary TreeHard
Binary Tree Right Side ViewMedium
Binary Tree Zigzag Level Order TraversalMedium
All Nodes Distance K in Binary TreeMedium
Binary Tree Level Order TraversalMedium
Flood FillEasy
Number of ProvincesMedium
Evaluate DivisionMedium
Symmetric TreeEasy
Maximum Depth of Binary TreeEasy
Same TreeEasy
Vertical Order Traversal of a Binary TreeHard
Maximum Width of Binary TreeMedium
Word Ladder IIHard
Surrounded RegionsMedium
Pacific Atlantic Water FlowMedium
Populating Next Right Pointers in Each NodeMedium
Cheapest Flights Within K StopsMedium
Invert Binary TreeEasy
Snakes and LaddersMedium
Trapping Rain Water IIHard
Open the LockMedium
Accounts MergeMedium
Making A Large IslandHard
01 MatrixMedium
Max Area of IslandMedium
Clone GraphMedium
Shortest Path in Binary MatrixMedium
Number of Distinct IslandsMedium
Amount of Time for Binary Tree to Be InfectedMedium
Alien DictionaryHard
Bus RoutesHard
Is Graph Bipartite?Medium
Number of Connected Components in an Undirected GraphMedium
Find Eventual Safe StatesMedium
Kth Largest Sum in a Binary TreeMedium
Two Sum IV - Input is a BSTEasy
Merge Two Binary TreesEasy
Path SumEasy
Shortest Path in a Grid with Obstacles EliminationHard
Shortest Path with Alternating ColorsMedium
Cousins in Binary Tree IIMedium
Perfect SquaresMedium
Minimum Number of Operations to Sort a Binary Tree by LevelMedium
Clone Binary Tree With Random PointerMedium
Count Unreachable Pairs of Nodes in an Undirected GraphMedium
Find if Path Exists in GraphEasy
Serialize and Deserialize BSTMedium
Longest Increasing Path in a MatrixHard
Keys and RoomsMedium
MinesweeperMedium
Number of Distinct Islands IIHard
Number of Operations to Make Network ConnectedMedium
Minimum Genetic MutationMedium
Network Delay TimeMedium
All Paths From Source to TargetMedium
Redundant ConnectionMedium
Binary Tree Vertical Order TraversalMedium
Path With Maximum Minimum ValueMedium
Cut Off Trees for Golf EventHard
Sum of Nodes with Even-Valued GrandparentMedium
Get Watched Videos by Your FriendsMedium
Walls and GatesMedium
Serialize and Deserialize N-ary TreeHard
Nested List Weight SumMedium
Swim in Rising WaterHard
Find Distance in a Binary TreeMedium
Reorder Routes to Make All Paths Lead to the City ZeroMedium
Shortest BridgeMedium
Count Servers that CommunicateMedium
Pseudo-Palindromic Paths in a Binary TreeMedium
Clone N-ary TreeMedium
Closest Leaf in a Binary TreeMedium
Island PerimeterEasy
Minimum Fuel Cost to Report to the CapitalMedium
Path With Minimum EffortMedium
Course Schedule IVMedium
Minimum Height TreesMedium
Minimum Depth of Binary TreeEasy
Nearest Exit from Entrance in MazeMedium
Populating Next Right Pointers in Each Node IIMedium
Detect Cycles in 2D GridMedium
Possible BipartitionMedium
Count Good Nodes in Binary TreeMedium
Detonate the Maximum BombsMedium
Sum of Left LeavesEasy
Minimum Knight MovesMedium
Find Largest Value in Each Tree RowMedium
Lexicographically Smallest String After Applying OperationsMedium
Even Odd TreeMedium
Jump Game IVHard
Maximum Level Sum of a Binary TreeMedium
As Far from Land as PossibleMedium
Binary Tree Level Order Traversal IIMedium
Remove Invalid ParenthesesHard
Regions Cut By SlashesMedium
Shortest Distance from All BuildingsHard
Water and Jug ProblemMedium
Count the Number of Complete ComponentsMedium
Cousins in Binary TreeEasy
Map of Highest PeakMedium
Tree DiameterMedium
Last Day Where You Can Still CrossHard
Kill ProcessMedium
Web CrawlerMedium
Jump Game IIIMedium
Average of Levels in Binary TreeEasy
Escape the Spreading FireHard
Check if the Rectangle Corner Is ReachableHard
Minimum Obstacle Removal to Reach CornerHard
All Ancestors of a Node in a Directed Acyclic GraphMedium
Numbers With Same Consecutive DifferencesMedium
Minimum Cost to Make at Least One Valid Path in a GridHard
Most Profitable Path in a TreeMedium
Find Bottom Left Tree ValueMedium
Shortest Path Visiting All NodesHard
N-ary Tree Level Order TraversalMedium
Minimum Operations to Equalize Binary StringHard
Minimum Jumps to Reach End via Prime TeleportationMedium
Minimum Absolute Difference in BSTEasy
Minimum Edge Reversals So Every Node Is ReachableHard
Time Needed to Inform All EmployeesMedium
Kth Ancestor of a Tree NodeHard
Minimum Number of Days to Disconnect IslandHard
Minimum Time to Visit a Cell In a GridHard
Graph Valid TreeMedium
The MazeMedium
Maximum Number of Fish in a GridMedium
Employee ImportanceMedium
Longest Cycle in a GraphHard
Divide Nodes Into the Maximum Number of GroupsHard
Sentence Similarity IIMedium
Sliding PuzzleHard
Minimum Distance Between BST NodesEasy
Power Grid MaintenanceMedium
Minimum Time to Collect All Apples in a TreeMedium
Escape a Large MazeHard
Minimize Malware SpreadHard
K-Similar StringsHard
Check Completeness of a Binary TreeMedium
Number of EnclavesMedium
Number of Closed IslandsMedium
Find Elements in a Contaminated Binary TreeMedium
Find a Corresponding Node of a Binary Tree in a Clone of That TreeEasy
Complete Binary Tree InserterMedium
Minimum Score of a Path Between Two CitiesMedium
Zuma GameHard
Maximum Depth of N-ary TreeEasy
Lowest Common Ancestor of Deepest LeavesMedium
The Maze IIMedium
Sort Items by Groups Respecting DependenciesHard
Print Binary TreeMedium
Smallest Subtree with all the Deepest NodesMedium
Shortest Distance After Road Addition Queries IMedium
Find All People With SecretHard
Operations on TreeMedium
Similar String GroupsHard
Check Knight Tour ConfigurationMedium
Maximum Number of Points From Grid QueriesHard
Grid Teleportation TraversalMedium
The Time When the Network Becomes IdleMedium
Properties GraphMedium

Showing 168 questions