← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Build a graph structure and implement BFS with depth tracking.
Source: 1point3acres - Square 2025 Interview
This is a multi-part question where each part builds on the previous.
Part 1: Build a basic graph with adjacency list Part 2: Implement standard BFS Part 3: Implement BFS that returns nodes with their depths
The interviewer expects quick understanding and clean code.