Reported September 2026
Abridgegraph

Clone a Connected Graph

Reported by candidates from Abridge's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Abridge OA. Under 2s to a working solution.
Founder's read

The whole problem hinges on one hash map, and Abridge's September 2026 OA reportedly dressed it up as "Clone a Connected Graph." If you've got the invite and 48 hours, this is the one to lock down. It's a disguised Clone Graph: you get an adjacency list for nodes 1..n and return a deep copy in the same format, neighbor order intact. Nothing exotic, but candidates still fumble the cycle handling. If you blank mid-assessment, StealthCoder runs invisibly as a safety net and gives you the solution in real time. Know the shape anyway.

The problem

A firsthand Abridge report describes a disguised Clone Graph problem. For this executable adapter, a connected undirected graph with nodes 1..n is supplied as an adjacency list: adjacency[i] lists the neighbors of node i + 1.
Construct a deep copy by traversing the graph and return the copied graph in the same adjacency-list representation. Preserve each neighbor list's order. Return an empty matrix for an empty graph.

Function
cloneGraph(adjacency: int[][]) → int[][]

Examples
Example 1
adjacency = [[2,4],[1,3],[2,4],[1,3]]
return = [[2,4],[1,3],[2,4],[1,3]]
The four-node cycle is traversed and copied without changing edge order.
Example 2
adjacency = [[]]
return = [[]]
The isolated start node is copied.

Constraints
0 <= n <= 100
Every neighbor is in 1..n.
The graph is undirected and connected when nonempty.
Neighbor lists contain no duplicate node.

Reported by candidates. Source: FastPrep

Pattern and pitfall

The trick is a visited map from original node to its clone. Without it, the cycle in Example 1 sends your traversal into infinite recursion. Run a DFS or BFS from node 1. When you meet a node, create its copy and store it before you walk its neighbors. When you meet a neighbor already in the map, reuse that copy instead of making a new one. Here the input is already an adjacency list, so the copy can be a fresh array of arrays. Build each neighbor list in the original order, since the problem says to preserve it. The common pitfalls are forgetting the empty graph (return an empty matrix), mishandling the isolated node case [[]], and off-by-one errors between node labels 1..n and indexes 0..n-1. With n at most 100, recursion depth is fine. StealthCoder is your hedge if the indexing gets tangled live.

StealthCoder is the hedge for the one pattern you didn't drill. It runs invisibly during the screen share.

If this hits your live OA

You can drill Clone a Connected Graph cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. If you're reading this with an OA window open, you're who this was built for.

Get StealthCoder

Related leaked OAs

⏵ Practice the LeetCode equivalent

This OA pattern shows up on LeetCode as clone graph. If you have time before the OA, drill that.

⏵ The honest play

You've seen the question. Make sure you actually pass Abridge's OA.

Abridge reuses patterns across OAs. If you're reading this with an OA window open, you're who this was built for. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Clone a Connected Graph FAQ

How hard is the Abridge clone graph question really?+

Easy to medium. The idea is short: traverse once, keep a map from original to copy, never copy a node twice. Most failures come from cycles and edge cases, not from the algorithm itself. If you've written a BFS before, you can finish this quickly.

What's the trick to avoid infinite loops?+

Mark a node as visited the moment you create its copy, before processing neighbors. A hash map from original label to clone does both jobs. In the four-node cycle, node 4 points back to node 1, and the map lets you reuse the existing copy instead of recursing again.

DFS or BFS for this problem?+

Either works. With n up to 100, recursion depth isn't a concern, so DFS is shorter to write. BFS with a queue is safer if you dislike recursion. Both run in O(n + edges) time. Pick the one you can write without thinking, since correctness matters more than style here.

What edge cases should I test?+

Test the empty input, which returns an empty matrix. Test a single isolated node, [[]], which returns [[]]. Then test a cycle like Example 1 to confirm neighbor order is preserved. Also check that your output uses 1-based labels in the values but 0-based positions in the outer array.

How do I prepare in 48 hours?+

Write Clone Graph from scratch twice, once with DFS and once with BFS, without peeking. Then trace Example 1 by hand with your visited map. Spend the rest of the time on general graph traversal and hash map patterns, since the Abridge OA may disguise the problem differently.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Abridge.

OA at Abridge?
Invisible during screen share
Get it