Depth-First Search Interview Questions
223 real interview questions test Depth-First Search. Practice any of them in the code editor and get AI feedback on your solution.
- Junior14% (32)
- Mid/Senior57% (128)
- Staff28% (63)
Companies that ask Depth-First Search the most
Questionspage 2 of 3
- Sort Items by Groups Respecting Dependencies5 companiesStaff
- Number of Closed Islands5 companiesMid/Senior
- Maximum Product of Splitted Binary Tree5 companiesMid/Senior
- Linked List in Binary Tree5 companiesMid/Senior
- Maximum Sum BST in Binary Tree5 companiesStaff
- Time Needed to Inform All Employees5 companiesMid/Senior
- Balance a Binary Search Tree5 companiesMid/Senior
- Reorder Routes to Make All Paths Lead to the City Zero5 companiesMid/Senior
- Count Sub Islands5 companiesMid/Senior
- Find if Path Exists in Graph5 companiesJunior
- Maximum Employees to Be Invited to a Meeting5 companiesStaff
- Longest Path With Different Adjacent Characters5 companiesStaff
- Count Nodes Equal to Average of Subtree5 companiesMid/Senior
- Minimum Fuel Cost to Report to the Capital5 companiesMid/Senior
- Minimum Score of a Path Between Two Cities5 companiesMid/Senior
- Longest Absolute File Path4 companiesMid/Senior
- Find Mode in Binary Search Tree4 companiesJunior
- Convert BST to Greater Tree4 companiesMid/Senior
- Average of Levels in Binary Tree4 companiesJunior
- Minimum Distance Between BST Nodes4 companiesJunior
- Binary Tree Pruning4 companiesMid/Senior
- Smallest Subtree with all the Deepest Nodes4 companiesMid/Senior
- Flip Equivalent Binary Trees4 companiesMid/Senior
- Number of Enclaves4 companiesMid/Senior
- Binary Search Tree to Greater Sum Tree4 companiesMid/Senior
- Lowest Common Ancestor of Deepest Leaves4 companiesMid/Senior
- Maximum Level Sum of a Binary Tree4 companiesMid/Senior
- Deepest Leaves Sum4 companiesMid/Senior
- Sum of Nodes with Even-Valued Grandparent4 companiesMid/Senior
- Delete Leaves With a Given Value4 companiesMid/Senior
- Minimum Number of Days to Disconnect Island4 companiesStaff
- Last Day Where You Can Still Cross4 companiesStaff
- Valid Arrangement of Pairs4 companiesStaff
- All Ancestors of a Node in a Directed Acyclic Graph4 companiesMid/Senior
- Count Unreachable Pairs of Nodes in an Undirected Graph4 companiesMid/Senior
- Minimum Score After Removals on a Tree4 companiesStaff
- Find Closest Node to Given Two Nodes4 companiesMid/Senior
- Longest Cycle in a Graph4 companiesStaff
- Reverse Odd Levels of Binary Tree4 companiesMid/Senior
- Check Knight Tour Configuration4 companiesMid/Senior
- Maximum Number of Fish in a Grid4 companiesMid/Senior
- Count Paths That Can Form a Palindrome in a Tree4 companiesStaff
- Maximum Number of K-Divisible Components4 companiesStaff
- Concatenated Words3 companiesStaff
- Most Frequent Subtree Sum3 companiesMid/Senior
- Freedom Trail3 companiesStaff
- Minimum Absolute Difference in BST3 companiesJunior
- Binary Tree Tilt3 companiesJunior
- Construct String from Binary Tree3 companiesMid/Senior
- Add One Row to Tree3 companiesMid/Senior
- Contain Virus3 companiesStaff
- Univalued Binary Tree3 companiesJunior
- Coloring A Border3 companiesMid/Senior
- Escape a Large Maze3 companiesStaff
- Jump Game III3 companiesMid/Senior
- Validate Binary Tree Nodes3 companiesMid/Senior
- Check if There is a Valid Path in a Grid3 companiesMid/Senior
- Number of Good Leaf Nodes Pairs3 companiesMid/Senior
- Minimize Hamming Distance After Swap Operations3 companiesMid/Senior
- Count Nodes With the Highest Score3 companiesMid/Senior
- Find All People With Secret3 companiesStaff
- Height of Binary Tree After Subtree Removal Queries3 companiesStaff
- Count the Number of Complete Components3 companiesMid/Senior
- Find Minimum Diameter After Merging Two Trees3 companiesStaff
- Check if the Rectangle Corner Is Reachable3 companiesStaff
- Maximize Amount After Two Days of Conversions3 companiesMid/Senior
- Sum of Perfect Square Ancestors3 companiesStaff
- Array Nesting2 companiesMid/Senior
- Second Minimum Node In a Binary Tree2 companiesJunior
- Increasing Order Search Tree2 companiesJunior
- Minimize Malware Spread II2 companiesStaff
- Smallest String Starting From Leaf2 companiesMid/Senior
- Flower Planting With No Adjacent2 companiesMid/Senior
- Binary Tree Coloring Game2 companiesMid/Senior
- All Elements in Two Binary Search Trees2 companiesMid/Senior
- Longest ZigZag Path in a Binary Tree2 companiesMid/Senior
- Frog Position After T Seconds2 companiesStaff
- Pseudo-Palindromic Paths in a Binary Tree2 companiesMid/Senior
- Number of Nodes in the Sub-Tree With the Same Label2 companiesMid/Senior
- Lexicographically Smallest String After Applying Operations2 companiesMid/Senior
- Find All Groups of Farmland2 companiesMid/Senior
- Number of Increasing Paths in a Grid2 companiesStaff
- Reachable Nodes With Restrictions2 companiesMid/Senior
- Difference Between Maximum and Minimum Price Sum2 companiesStaff
- Cousins in Binary Tree II2 companiesMid/Senior
- Count Pairs of Connectable Servers in a Weighted Tree Network2 companiesMid/Senior
- Find Edges in Shortest Paths2 companiesStaff
- Maximize the Number of Target Nodes After Connecting Trees I2 companiesMid/Senior
- Maximize the Number of Target Nodes After Connecting Trees II2 companiesStaff
- Minimize the Maximum Edge Weight of Graph2 companiesMid/Senior
- Maximum Profit from Trading Stocks with Discounts2 companiesStaff
- Minimum Increments to Equalize Leaf Paths2 companiesMid/Senior
- Count Islands With Total Value Divisible by K2 companiesMid/Senior
- Maximum Partition Factor2 companiesStaff
- Bulb Switcher II1 companyMid/Senior
- Redundant Connection II1 companyStaff
- Cracking the Safe1 companyStaff
- Insufficient Nodes in Root to Leaf Paths1 companyMid/Senior
- Tree of Coprimes1 companyStaff
- Count Ways to Build Rooms in an Ant Colony1 companyStaff