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 Bfs
Solve a matrix traversal problem similar to the Rat in a Maze using Breadth-First Search (BFS). Elaborate on the BFS approach and its complexity.
Given edges between countries and a list of banned countries, find the shortest path from the source to the destination while minimizing visits to banned countries.
Given a list of edges representing connections between countries (0 to n-1) and a list of banned countries that cannot be visited, find the shortest path from a specified source to a destination. Use BFS and keep track of previous countries.
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