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 the currency exchange problem using a directed graph approach and Breadth-First Search (BFS) to effectively manage conversions between different currencies.
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.
You have a grid of oranges where some are rotten and some are fresh. Every minute, any fresh orange that is adjacent to a rotten orange becomes rotten. Given the grid, return the minimum number of minutes that must elapse until no cell has a fresh orange. If it is impossible, return -1. Example: Input: grid = [[2,1,1],[1,1,0],[0,1,1]] Output: 4.
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.
Solve the 'Cut Off Trees for Golf Event' problem as described in LeetCode, implementing the BFS technique. Discuss your approach.
Coming Soon