FastPrepRemove Duplicates from Sorted List
Problems/Remove Duplicates from Sorted List

Remove Duplicates from Sorted List

Bloomberg LP logoBloomberg LP● EasyNEW GRADONSITE INTERVIEW

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Bloomberg new-grad reports name this well-known problem directly. Our version is about 100% the same as the reported question.

Given the head of a nondecreasing singly linked list, delete repeated nodes so that each value appears exactly once. Return the head of the same list after relinking its existing nodes.

Function

deleteDuplicates(head: ListNode) → ListNode

Examples

Example 1

head = [1,1,2]return = [1,2]
head
112
Removed
→
return
12
Moved or new

The second node with value one is removed.

Example 2

head = [1,1,2,3,3]return = [1,2,3]
head
11233
Removed
→
return
123
Moved or new

Each repeated run is reduced to one node.

Constraints

  • The list contains between 0 and 10^5 nodes.
  • -10^9 <= Node.val <= 10^9.
  • The list is sorted in nondecreasing order.

More Bloomberg LP Onsite Interview questions

  • Pascal's TrianglePHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
  • Valid Triangle NumberPHONE SCREEN · ONSITE INTERVIEW · Seen Dec 2026
  • Collatz Conjecture with Shared MemoizationPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Word SearchOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • N-ary Index-Path Encoder and DecoderPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Top K Frequent WordsONSITE INTERVIEW · Seen Nov 2026
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Add Two Numbers IIPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026

Similar questions at other companies

  • Reverse Linked ListByteDance · PHONE SCREEN · ONSITE INTERVIEWByteDance interview questions
  • Reverse Linked ListAutodesk · ONSITE INTERVIEWAutodesk interview questions
  • Detect a Loop in a Linked ListEPAM · ONSITE INTERVIEWEPAM interview questions
  • Delete a Doubly Linked List Node at a PositionQualys · ONSITE INTERVIEWQualys interview questions
  • Insert After a Linked-List NodeAMD · ONSITE INTERVIEWAMD interview questions
  • Reverse a Singly Linked ListGoogle · ONSITE INTERVIEWGoogle interview questions
  • Process Singly Linked List OperationsSEDEMAC · ONSITE INTERVIEW
  • Merge Two Sorted Linked ListsZS · ONSITE INTERVIEWZS interview questions
  • Middle Node Of A Linked ListNVIDIA · ONSITE INTERVIEWNVIDIA interview questions
  • Build and Check a Palindrome Linked ListOmnissa · ONSITE INTERVIEWOmnissa interview questions

Bloomberg LP interview experiences

  • Bloomberg AI-Assisted Coding Round, All Levels: 14 Experiences
  • Bloomberg SWE Intern Interview Questions: 68 Questions
  • Bloomberg Interview Questions, Level Not Reported: 65 Questions
  • Bloomberg Experienced Design & More: 126 Questions (Part 2 of 2)
  • Bloomberg Experienced SWE Interviews: 167 Questions (Part 1 of 2)
  • Bloomberg New Grad Coding Questions: 121 Questions (Part 2 of 2)
All Bloomberg LP interview questionsSee Bloomberg LP 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 deleteDuplicates(ListNode head) {
        // Write your code here.
    }

}
Checking account…