Deep Copy of a Linked List with Random Links
Asked at Snowflake · Coding Questions · Difficulty: Medium · Last asked Dec 14, 2025
A linked list node holds an integer `val`, a `next` pointer to the following node, and a `random` pointer that may point to any node of the same list (including the node itself) or to nothing. Build a deep copy of such a list: a completely independent clone in which no node is shared with the original, the `next` order is the same, and every `random` pointer connects the same positions as in the original.
Loading the problem…
More Snowflake interview questions
- Design a Distributed Job Scheduler with Cron, Pause, Resume
- SET Card Game: Validate a Triple and List All Sets on the Table
- Design an ACL Authorization Service
- Design an S3-Style Blob Store with Deduplication
- Anti-Clockwise Outline of a Binary Tree
- SQL: Project Duration & Budget per Employee