Remove all occurrences of a target value from a linked list
Asked at Arista Networks · Coding Questions · Difficulty: Easy · Last asked Jul 15, 2026
Given the head of a singly linked list `head` and an integer `target`, remove **all** nodes whose value equals `target`, and return the new head.
Loading the problem…
More Arista Networks interview questions
- Remove All Nodes With Duplicate Values From a Sorted Linked List
- Missing Number (Not Starting From 0, Binary Search Variant)
- Palindrome String Check (Handle Empty and Null)
- Generate Matrix B (2D Prefix Sum)
- Find Missing Number in a Sorted Array
- Find Missing Number in a Sorted Array (or None)