Breadth-First Search DSA Problems

245 breadth-first search problems for coding interviews and campus placements, with hints and company tags. Below are the first 100 of 245: 20 easy, 12 medium and 68 hard. Practise them free on InternHack and track what you have solved.

Breadth-First Search problems, easiest first

  1. Average of Levels in Binary Tree (Easy)
  2. Cousins in Binary Tree (Easy)
  3. Find a Corresponding Node of a Binary Tree in a Clone of That Tree (Easy)
  4. Find All The Lonely Nodes (Easy)
  5. Find if Path Exists in Graph (Easy)
  6. Flood Fill (Easy)
  7. Invert Binary Tree (Easy)
  8. Island Perimeter (Easy)
  9. Maximum Depth of Binary Tree (Easy)
  10. Maximum Depth of N-ary Tree (Easy)
  11. Merge Two Binary Trees (Easy)
  12. Minimum Absolute Difference in BST (Easy)
  13. Minimum Depth of Binary Tree (Easy)
  14. Minimum Distance Between BST Nodes (Easy)
  15. Path Sum (Easy)
  16. Same Tree (Easy)
  17. Sum of Left Leaves (Easy)
  18. Symmetric Tree (Easy)
  19. Two Sum IV - Input is a BST (Easy)
  20. Univalued Binary Tree (Easy)
  21. 01 Matrix (Medium)
  22. Accounts Merge (Medium)
  23. Add One Row to Tree (Medium)
  24. All Ancestors of a Node in a Directed Acyclic Graph (Medium)
  25. All Nodes Distance K in Binary Tree (Medium)
  26. All Paths From Source to Target (Medium)
  27. Amount of Time for Binary Tree to Be Infected (Medium)
  28. Apply Substitutions (Medium)
  29. As Far from Land as Possible (Medium)
  30. Binary Tree Level Order Traversal (Medium)
  31. Binary Tree Level Order Traversal II (Medium)
  32. Binary Tree Right Side View (Medium)
  33. Alien Dictionary (Hard)
  34. Brace Expansion II (Hard)
  35. Bus Routes (Hard)
  36. Check if the Rectangle Corner Is Reachable (Hard)
  37. Closest Node to Path in Tree (Hard)
  38. Contain Virus (Hard)
  39. Couples Holding Hands (Hard)
  40. Cut Off Trees for Golf Event (Hard)
  41. Distance to a Cycle in Undirected Graph (Hard)
  42. Divide Nodes Into the Maximum Number of Groups (Hard)
  43. Escape a Large Maze (Hard)
  44. Escape the Spreading Fire (Hard)
  45. Find All People With Secret (Hard)
  46. Find Edges in Shortest Paths (Hard)
  47. Find Minimum Diameter After Merging Two Trees (Hard)
  48. Freedom Trail (Hard)
  49. Frog Position After T Seconds (Hard)
  50. Height of Binary Tree After Subtree Removal Queries (Hard)
  51. Jump Game IV (Hard)
  52. K-Similar Strings (Hard)
  53. Kth Ancestor of a Tree Node (Hard)
  54. Last Day Where You Can Still Cross (Hard)
  55. Longest Cycle in a Graph (Hard)
  56. Longest Increasing Path in a Matrix (Hard)
  57. Making A Large Island (Hard)
  58. Maximize the Number of Target Nodes After Connecting Trees II (Hard)
  59. Maximum Candies You Can Get from Boxes (Hard)
  60. Maximum Number of Moves to Kill All Pawns (Hard)
  61. Maximum Number of Points From Grid Queries (Hard)
  62. Maximum Partition Factor (Hard)
  63. Minimize Malware Spread (Hard)
  64. Minimize Malware Spread II (Hard)
  65. Minimum Cost to Make at Least One Valid Path in a Grid (Hard)
  66. Minimum Edge Reversals So Every Node Is Reachable (Hard)
  67. Minimum Moves to Move a Box to Their Target Location (Hard)
  68. Minimum Moves to Reach Target with Rotations (Hard)
  69. Minimum Number of Days to Disconnect Island (Hard)
  70. Minimum Number of Flips to Convert Binary Matrix to Zero Matrix (Hard)
  71. Minimum Number of Visited Cells in a Grid (Hard)
  72. Minimum Obstacle Removal to Reach Corner (Hard)
  73. Minimum Operations to Equalize Binary String (Hard)
  74. Minimum Reverse Operations (Hard)
  75. Minimum Runes to Add to Cast Spell (Hard)
  76. Minimum Time Takes to Reach Destination Without Drowning (Hard)
  77. Minimum Time to Visit a Cell In a Grid (Hard)
  78. Number of Distinct Islands II (Hard)
  79. Number of Increasing Paths in a Grid (Hard)
  80. Redundant Connection II (Hard)
  81. Remove Invalid Parentheses (Hard)
  82. Second Minimum Time to Reach Destination (Hard)
  83. Serialize and Deserialize Binary Tree (Hard)
  84. Serialize and Deserialize N-ary Tree (Hard)
  85. Shortest Cycle in a Graph (Hard)
  86. Shortest Distance from All Buildings (Hard)
  87. Shortest Path in a Grid with Obstacles Elimination (Hard)
  88. Shortest Path to Get All Keys (Hard)
  89. Shortest Path Visiting All Nodes (Hard)
  90. Similar String Groups (Hard)
  91. Sliding Puzzle (Hard)
  92. Smallest Rectangle Enclosing Black Pixels (Hard)
  93. Sort Items by Groups Respecting Dependencies (Hard)
  94. Swim in Rising Water (Hard)
  95. The Maze III (Hard)
  96. Trapping Rain Water II (Hard)
  97. Vertical Order Traversal of a Binary Tree (Hard)
  98. Word Ladder (Hard)
  99. Word Ladder II (Hard)
  100. Zuma Game (Hard)

Companies that ask breadth-first search problems

Before your interview

Most resumes are filtered by software before a recruiter reads them. Check your resume ATS score free, no signup needed.

Other DSA topics