AO
Back

Flatten a Multilevel Linked List (LC 430)

Also reported as Flatten a Multilevel Doubly Linked List · LeetCode 430

Phone ScreenPhone ScreenLast reported March 2026Medium Frequency

Problem Overview

The round: four reports, February to March 2026, three of them phone screens and one a coding round whose stage the report does not name. One names LeetCode 430, Flatten a Multilevel Doubly Linked List, and another gives its number. One describes a list with a down pointer: expand the down list first, then reconnect next. One says the hard part was explaining how the tail of the flattened child list connects back to the original next node; that candidate used recursion, got working code, and was still rejected after the round. One graded part.

The node (given)

class Node:
    def __init__(self, val, prev=None, next=None, down=None): ...

Part 1 — flatten the list

def flatten(head: Node | None) -> Node | None: ...
  • Each node has next and prev along its own level, and an optional down pointer to the head of another list one level lower. A lower list can have down lists of its own.
  • Flatten in place into one level: a node's down list, already flattened, comes right after the node and before the node's old next.
  • Afterwards every down is None, prev mirrors next all the way along, and head.prev is None.
  • Return the head. Use the same node objects; do not create new ones. An empty list returns None.

Notes: LeetCode 430 calls the extra pointer child; one report calls it down, which this page uses. One report says the list is doubly linked; the others do not say. If the interviewer's list is singly linked, there is no prev to fix; here the tests check it. The Node constructor and all examples are ours. One report suggests mentioning an iterative version to avoid deep recursion. One candidate says they answered the interviewer's follow-ups, but the report does not say what they were.

What Reports Emphasize

What the reports say: LeetCode 430, mostly in phone screens, with a down pointer in one report. The point two reports stress is reconnecting the flattened child list's tail to the original next. Explain the pointer changes clearly before you code, and do a dry run; one candidate lost time there. Mentioning an iterative version to avoid deep recursion is suggested.

Common mistakes (ours, not reported): Losing the old next by overwriting it first; fixing next but not prev; leaving down set; walking each child list twice to find its tail.

Edge cases to test (ours): A down list on the last node; a down list on the head; nesting several levels deep; an empty list.

Practice

Write your own against 6 test cases, or read the worked solution — approach, complexity, and code that runs.
Did this match your interview?

If you have had this round, tell us how close this page was. It is how we keep the pages accurate.

Prepping for Bloomberg with friends?

Send them this page. It is free to read, no account needed.

More Bloomberg Questions

Free preview

Every question in the Bloomberg catalog gets this depth

What you just read — canonical solution, follow-up arc, what passing candidates actually did — exists for all 65 Bloomberg questions, refreshed monthly from new candidate reports.

$59/mo — or $50/mo with the 3-month pass · cancel anytime
Bloomberg · Phone Screen · Reported 4× across candidate reports
Is this helpful?