← Amazon questions

Rearrange linked list with negative values before positive

Filed under Amazon

Given a linked list containing both positive and negative integers, rearrange the nodes such that all negative numbers appear before all positive ones while maintaining their relative order.

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 Amazon questions

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