Main Navigation
Share your interview in your own words — our AI handles the rest. Hardly takes 2 minutes.
Practice mock interviews or book a 1:1 call for career guidance, resume reviews, and more.
AI interview prep powered by real interview data.
Connect with us on social media
Interview experiences & questions tagged Dfs
Calculate the sum of cousin nodes in a binary tree. The approach involves two traversals: the first to calculate the sum of values at each level and the second to compute the sibling sums. The new node value is the level sum minus the sibling sum.
Given a 2D grid of '1's (land) and '0's (water), return the number of islands present in the grid. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically.
Perform a Depth First Search (DFS) traversal on a binary tree. Discuss how you would implement this and handle edge cases.
Write a function that prints all shortest paths between a given source and destination node in an undirected graph. Use a suitable algorithm to ensure correct shortest path determination.
Given a 2D grid representing land (1) and water (0), you need to connect all the islands together by converting the water (0) to land (1). Count the minimum number of 0s you will need to flip to connect all islands.
Coming Soon