LinkedIn SWE Interview Question 2024 October | Graph DFS | off-campus

Linkedin · Question · Posted Jun 2026

Question 1: 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 (List[Node]) of its neighbors. class Node { public int val; public List<Node> neighbors; } Constraints The number of nodes in the graph is between 0 and 100. 1 <= Node.val <= 100 Node.val is unique for each node. There are no repeated edges ...

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

Log in Create a free account