Back to Questions

Clone Graph

71K viewsAsked at Salesforce
Medium

Question Explain

Given a reference of a node in a connected undirected graph, return a deep copy (clone) of the graph. Use a HashMap to track visited nodes and their clones (BFS or DFS).

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question
Clone Graph - Interview Question