← Meta Interview Insights

Meta·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Meta coding round, linked list reordering problem. Pretty standard stuff if you know the pattern, but I fumbled the implementation a bit under pressure.

Questions Asked (1)

Q1

Given the head of a singly linked list, reorder it so that nodes alternate between the front and back of the list (first, last, second, second-to-last, and so on), modifying only the pointers.

Algorithms & Data Structures
Author's notes

I knew the general idea going in but blanked on how to cleanly split the list.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Break the problem into three clear phases: find the middle of the list, reverse the second half, then merge the two halves alternately. This approach runs in O(n) time and O(1) space, which is optimal for a linked list reordering problem.

Pro tip: Explicitly state the time and space complexity upfront and mention that you're modifying pointers in-place to avoid extra memory. Also, handle edge cases like empty list, single node, and two nodes before diving into the main logic.

1. Find the middle of the linked list

Use the slow and fast pointer technique (tortoise and hare) to find the middle node. This splits the list into two halves.

2. Reverse the second half

Reverse the second half of the list in-place so that the last node becomes the first of the second half. This allows easy alternating merge.

3. Merge the two halves alternately

Merge the first half and the reversed second half by interleaving nodes: take one from the first half, then one from the second, and so on.

4. Handle edge cases and return the result

Check for edge cases such as empty list, single node, or two nodes. Ensure the final list is correctly terminated and return the head.

Key Points to Mention

  • Time complexity: O(n) where n is the number of nodes.
  • Space complexity: O(1) because we only use pointers and no extra data structures.
  • Use of slow and fast pointers to find the middle efficiently.
  • In-place reversal of the second half to avoid extra space.
  • Careful pointer manipulation to avoid cycles or losing nodes during merge.
  • Edge cases: empty list, one node, two nodes, and odd/even length lists.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.