FastPrepRemove Linked List Elements
Problems/Remove Linked List Elements

Remove Linked List Elements

Bloomberg LP logoBloomberg LP● EasyNEW GRADPHONE SCREEN

Updated Sep 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report directly asks to delete every linked-list node with a specified value. This practice version uses the conventional singly linked-list contract and preserves all nonmatching nodes in their original order.

Given the head of a singly linked list and an integer val, remove every node whose value equals val.

Return the head of the remaining list. Reuse the nodes that are not removed.

Function

removeElements(head: ListNode, val: int) → ListNode

Examples

Example 1

head = [1,2,6,3,4,5,6]val = 6return = [1,2,3,4,5]
head
1263456
Removed
→
return
12345
Moved or new

Both nodes containing 6 are removed.

Example 2

head = []val = 1return = []
head
empty
return
empty

An empty list stays empty.

Example 3

head = [7,7,7,7]val = 7return = []
head
7777
return
empty

Removing every node yields an empty list.

Constraints

  • The list contains between 0 and 100000 nodes.
  • -1000000000 <= Node.val, val <= 1000000000.

More Bloomberg LP Phone Screen questions

  • 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
  • Trapping Rain WaterPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Fewest Coins CombinationPHONE SCREEN · Seen Nov 2026
  • Recommend Films from Viewers Who Watched Everything You DidPHONE SCREEN · Seen Nov 2026
  • Track New Values in Sorted OrderPHONE SCREEN · Seen Nov 2026
  • Design Browser HistoryPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Mutable Stock Price Top KPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Sparse Vector and Matrix OperationsPHONE 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 Linked ListApple · PHONE SCREENApple interview questions
  • Reverse a Singly Linked ListChubb · PHONE SCREENChubb interview questions
  • Reverse a Singly Linked ListAdobe · PHONE SCREENAdobe 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

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 removeElements(ListNode head, int val) {
        // Write your code here.
    }

}
Checking account…