Remove Target Values from a Linked List
AristaSoftware Engineer · Technical ScreenLast updated
This question evaluates proficiency with singly linked list manipulation, specifically in-place node removal and correct pointer/reference management. It is commonly asked to assess practical coding ability with data structures, handling of edge cases and resource implications; category: Coding & Algorithms (Data Structures), level of abstraction: practical implementation-focused.
Given the head of a singly linked list and an integer target, remove every node whose value equals target and return the new head of the list.
The target value may appear zero, one, or multiple times. Modify the list in place rather than creating a separate list.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.