PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Two Sigma

Merge Two Sorted Lists

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency with linked list data structures, pointer manipulation, in-place merging of sorted sequences, and general algorithmic reasoning within the Coding & Algorithms domain.

  • hard
  • Two Sigma
  • Coding & Algorithms
  • Data Scientist

Merge Two Sorted Lists

Company: Two Sigma

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: hard

Interview Round: Technical Screen

You are given the heads of two singly linked lists, each already sorted in non-decreasing order. Merge them into one sorted linked list and return the head of the merged list. Requirements: - Reuse the existing nodes if possible. - The output must also be sorted in non-decreasing order. - Handle the case where one or both input lists are empty. Example: - List A: `1 -> 2 -> 4` - List B: `1 -> 3 -> 4` - Output: `1 -> 1 -> 2 -> 3 -> 4 -> 4`

Quick Answer: This question evaluates proficiency with linked list data structures, pointer manipulation, in-place merging of sorted sequences, and general algorithmic reasoning within the Coding & Algorithms domain.

Related Interview Questions

  • Implement Price-Time Order Matching - Two Sigma (medium)
  • Compute Piecewise Linear Interpolation - Two Sigma (medium)
  • Implement an In-Memory Database - Two Sigma (hard)
  • Merge two sorted linked lists - Two Sigma (hard)
  • Evaluate Piecewise Linear Function - Two Sigma (medium)
Two Sigma logo
Two Sigma
Mar 18, 2026, 12:00 AM
Data Scientist
Technical Screen
Coding & Algorithms
6
0
Loading...

You are given the heads of two singly linked lists, each already sorted in non-decreasing order. Merge them into one sorted linked list and return the head of the merged list.

Requirements:

  • Reuse the existing nodes if possible.
  • The output must also be sorted in non-decreasing order.
  • Handle the case where one or both input lists are empty.

Example:

  • List A: 1 -> 2 -> 4
  • List B: 1 -> 3 -> 4
  • Output: 1 -> 1 -> 2 -> 3 -> 4 -> 4

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Two Sigma•More Data Scientist•Two Sigma Data Scientist•Two Sigma Coding & Algorithms•Data Scientist Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.