## 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… Read More »

- Count total ways to reach destination from source in an undirected Graph
- Paranthesis Theorem
- Count nodes in the given tree whose weight is a fibonacci number
- Find a Mother vertex in a Graph using Bit Masking
- Minimum time required to visit all the special nodes of a Tree
- Minimum Cost of Simple Path between two nodes in a Directed and Weighted Graph
- Count of distinct colors in a subtree of a Colored Tree with given min frequency for Q queries
- Count of different groups using Graph
- Count of elements which form a loop in an Array according to given constraints
- Lowest Common Ancestor for a Set of Nodes in a Rooted Tree
- Minimum labelled node to be removed from undirected Graph such that there is no cycle
- Find dependencies of each Vertex in a Directed Graph
- Maximum weighted edge in path between two nodes in an N-ary tree using binary lifting
- Find GCD of each subtree of a given node in an N-ary Tree for Q queries
- Largest subarray sum of all connected components in undirected graph
- Count the nodes in the given Tree whose weight is a Perfect Number
- Largest component size in a graph formed by connecting non-co-prime nodes
- Count of unique lengths of connected components for an undirected graph using STL
- Minimum Bipartite Groups
- Count of nodes having odd divisors in the given subtree for Q queries
- Minimum value of distance of farthest node in a Graph
- Find the maximum component size after addition of each edge to the graph
- Count ways to change direction of edges such that graph becomes acyclic
- Count the number of walks of length N where cost of each walk is equal to a given number
- Minimum valued node having maximum depth in an N-ary Tree
- Size of the Largest Trees in a Forest formed by the given Graph
- Octal equivalents of connected components in Binary valued graph
- Print the nodes of the Binary Tree whose height is a Prime number
- Count of leaf nodes of the tree whose weighted string is a palindrome
- Minimum string such that every adjacent character of given string is still adjacent

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… Read More »

Given a positive integer N. Consider a matrix of N X N. No cell can be accessible from any other cell, except the given pair… Read More »

Given an undirected connected tree with N nodes (and N-1 edges), we need to find two paths in this tree such that they are non-intersecting… Read More »

Given an undirected tree which has even number of vertices, we need to remove the maximum number of edges from this tree such that each… Read More »

Given a grid which consists of 4 types of characters : ‘B’ ‘.’ ‘S’ and ‘D’. We need to reach D starting from S, at… Read More »

Given an undirected tree whose each node is associated with a weight. We need to delete an edge in such a way that difference between… Read More »

Consider a matrix with rows and columns, where each cell contains either a ‘0’ or a ‘1’ and any cell containing a 1 is called… Read More »

Problem Statement : Given a graph which represents a flow network where every edge has a capacity. Also given two vertices source ‘s’ and sink… Read More »

Given a dictionary, a method to do a lookup in the dictionary and a M x N board where every cell has one character. Find… Read More »

Given a tree of n even nodes. The task is to find the maximum number of edges to be removed from the given tree to… Read More »

Given an array of strings, find if the given strings can be chained to form a circle. A string X can be put before another… Read More »

I recently got interviewed for MakeMyTrip for the Software Engineer full time position. There were in a total of 5 rounds. First Round (Online Coding… Read More »

We are given a map of cities connected with each other via cable lines such that there is no cycle between any two cities. We… Read More »

Given two integers ‘n’ and ‘m’, find all the stepping numbers in range [n, m]. A number is called stepping number if all adjacent digits… Read More »

Direct I came for Full Time recruitment for Applications Engineer, Operations Engineer and Platform Engineer in our campus. Round 1 Online test on Codechef contains… Read More »