FastPrepReverse a Singly Linked List
Problems/Reverse a Singly Linked List

Reverse a Singly Linked List

Chubb logoChubb● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A report asks to reverse a linked list. We chose the rest. The list is singly linked and has no cycle. The nodes are reused, and an empty input has a set answer. We also chose the function types, the examples, and the limits.

Given the head of a finite, acyclic singly linked list, reverse every next pointer and return the new head.

Reuse the original nodes and preserve every value. Return null for an empty list.

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 tail becomes the new head and every link points backward.

Example 2

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

An empty list remains empty.

Constraints

  • 0 <= number of nodes <= 100000.
  • -1000000000 <= node.val <= 1000000000.
  • The input list is finite and acyclic.

More Chubb interview questions

  • Find the Unique Element Among PairsPHONE SCREEN · Seen Oct 2026
  • Second-Highest Distinct SalaryPHONE SCREEN · Seen Oct 2026
  • Count Pairs with K Divisible Values in the IntervalOA · Seen Oct 2026
  • Index of the Maximum After Left RotationsOA · Seen Oct 2026
  • Maximize Revenue from Decreasing InventoryOA · Seen Oct 2026
  • Minimize the Maximum Array ElementOA · Seen Oct 2026
  • Minimum Distinct Prefix CostOA · Seen Oct 2026
  • Flat JSON Value DifferencesOA · Seen Sep 2026
  • Maximum Student-Teacher DistanceOA · Seen Sep 2026
  • Minimum Cost to Reach a Target WeightOA · Seen Sep 2026

Similar questions at other companies

  • Reverse Linked ListByteDance · PHONE SCREEN · ONSITE INTERVIEWByteDance interview questions
  • Merge Two Sorted ListsLinkedIn · PHONE SCREENLinkedIn interview questions
  • Reverse a Linked ListCisco · PHONE SCREENCisco interview questions
  • Reverse a Linked ListApple · PHONE SCREENApple 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
All Chubb interview questionsSee Chubb 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…