Lyft SWE Interview Question 2023 August | Graphs | on-campus

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 of its neighbors (List[Node]). class Node { public int val; public List<Node> neighbors; } The graph is represented in the test case using an adjacency list. Node values are unique and equal to the node's index (1-indexed). Constraints The number of nodes in ...

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

Log in Create a free account