Katkat

Remove Target Values from a Linked List

AristaSoftware Engineer · Technical Screen

Last 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.