ByteDance OA Question 2024 February | Graphs | on-campus

ByteDance · Question · Posted Jun 2026

Question: Clone Graph Problem Statement Given a reference of a node in a connected undirected graph, return a deep copy (clone) of the graph. Each node in the graph contains a value (int) and a list of its neighbors (List[Node]). class Node { public int val; public List<Node> neighbors; } Constraints The number of nodes in the graph is in the range [0, 100]. 1 <= Node.val <= 100 Node.val is unique for each node. There are no self-loops or ...

The full answer & interview discussion are available to premium members.

Log in Create a free account