FastPrepReverse a Linked List
Problems/Reverse a Linked List

Reverse a Linked List

Apple logoApple● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported in an Apple new grad phone screen. An earlier report says only that the interviewer asked to reverse a list. A later new-grad phone screen report says the coding task was to reverse a linked list.

Neither report gives an interface. Here, the list is singly linked, you reverse the links in place and reuse the nodes, and an empty list returns null. We chose the size limits.

Our version is about 80% the same as the reported questions.

Given the head of an acyclic singly linked list, reverse all of its next pointers and return the new head. Reuse the original data nodes. An empty list returns null.

Input and output lists are shown as arrays of node values.

Function

reverseList(head: ListNode) → ListNode

Examples

Example 1

head = [1,2,3,4]return = [4,3,2,1]
head
1234
→
return
4321
Moved or new

The original final node becomes the new head.

Example 2

head = []return = []
head
empty
return
empty

Reversing an empty list still produces null.

Constraints

  • The list contains between 0 and 10000 nodes.
  • -10^9 <= node.val <= 10^9.

More Apple Phone Screen questions

  • Topological OrderingPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • LRU CachePHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Merge IntervalsOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Subarray Product Less Than KPHONE SCREEN · Seen Nov 2026
  • Evaluate DivisionPHONE SCREEN · Seen Nov 2026
  • Validate a BST with a Custom ComparisonPHONE SCREEN · Seen Nov 2026
  • Design a Food Rating SystemPHONE SCREEN · Seen Oct 2026
  • Days Until Poisoned Plants StabilizePHONE SCREEN · Seen Oct 2026
  • Capture Surrounded Regions with Union-FindPHONE SCREEN · Seen Oct 2026
  • Maintain a Consistent-Hashing RingPHONE SCREEN · Seen Oct 2026

Similar questions at other companies

  • Merge Two Sorted ListsLinkedIn · PHONE SCREENLinkedIn interview questions
  • Reverse a Linked ListCisco · PHONE SCREENCisco interview questions
  • Reverse a Singly Linked ListChubb · PHONE SCREENChubb interview questions
  • Reverse a Singly Linked ListAdobe · PHONE SCREENAdobe interview questions
  • Remove Linked List ElementsBloomberg LP · PHONE SCREENBloomberg LP interview questions
  • Reverse a Singly Linked ListExpedia · PHONE SCREEN · ONSITE INTERVIEWExpedia interview questions
  • Merge Two Sorted Linked ListsNutanix · PHONE SCREENNutanix interview questions
  • Reverse a Singly Linked ListSuperhuman · PHONE SCREENSuperhuman interview questions
  • Convert a Sorted Linked List to a Balanced BSTMeta · PHONE SCREENMeta interview questions
  • Merge K Sorted Linked ListsBharatPe · PHONE SCREEN

Interview reports that mention this question

  • Apple New Grad SWE Java, Coding and Manager Rounds: 1 Experience
  • Apple New Grad SWE Phone Screens: 12 Experiences (Part 3 of 3)
  • Apple New Grad SWE Interviews: 37 Experiences (Part 1 of 3)

Apple interview experiences

  • Apple SWE Phone Screen: Subarray Products: 1 Experience
  • Apple AI Coding and Related Interviews: 17 Experiences
  • Apple India SWE New Grad Interviews: 5 Experiences
All Apple interview questionsSee Apple hiring insights
Saved
/**
 * Definition for singly-linked list.
 * public class ListNode {
 *     int val;
 *     ListNode next;
 *     ListNode() {}
 *     ListNode(int val) { this.val = val; }
 *     ListNode(int val, ListNode next) { this.val = val; this.next = next; }
 * }
 */
class Solution {
    public ListNode reverseList(ListNode head) {
        // Write your solution here.
    }

}
Checking account…