← Goldman Sachs questions
CodingReported in a candidate post, Feb 2022

Flatten binary tree to linked list

Filed under Goldman Sachs

Given the root of a binary tree, flatten the tree into a linked list using the same TreeNode class where the right child points to the next node in the pre-order traversal and the left child is null.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Goldman Sachs questions

Collected from public candidate posts and coding forums. Updated Nov 2026.