# Top 10 Interview Questions on Depth First Search (DFS)

Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. One starts at the root (selecting some arbitrary node as the root in the case of a graph) and explores as far as possible along each branch before backtracking. Here are some important DFS problems asked in Technical Interviews:

- Find number of islands
- Transitive closure of a graph using DFA
- Application of DFS
- Detect cycle in an undirected graph
- Longest path between any pair of vertices
- Find a mother vertex in a graph
- Iterative Depth first traversal
- Print all path from a given source to a destination
- Stepping Number
- Maximum product of two non- intersecting paths in a tree

All articles on Depth First Search

This article is contributed by **Ayushmaan Bansal**. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.

## Recommended Posts:

- Depth First Search or DFS for a Graph
- Applications of Depth First Search
- Iterative Deepening Search(IDS) or Iterative Deepening Depth First Search(IDDFS)
- Top 25 Interview Questions
- SQL Interview Questions
- Top 10 algorithms in Interview Questions
- Facebook Interview Questions
- PHP Interview Questions and Answers
- Advanced SQL Interview Questions
- PHP Interview Questions and Answers | Set-2
- Top 10 algorithms in Interview Questions | Set 2
- Amazon Interview Questions
- Top 20 Backtracking Algorithm Interview Questions
- jQuery Interview Questions and Answers
- Interview Questions for Java Professionals
- Java Interview Questions on Constructors
- jQuery Interview Questions and Answers | Set-3
- Top 20 Greedy Algorithms Interview Questions
- Top 20 Dynamic Programming Interview Questions
- JavaScript Interview Questions and Answers