Remove Target Values from a Linked List
Company: Arista
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: easy
Interview Round: Technical Screen
Quick Answer: 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.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ([1,2,6,3,4,5,6], 6)
Expected Output: [1, 2, 3, 4, 5]
Explanation: Remove multiple target nodes.
Input: ([7,7,7], 7)
Expected Output: []
Explanation: All nodes removed.
Input: ([], 1)
Expected Output: []
Explanation: Empty list.
Hints
- Model object-style prompts as operation streams when needed.
- Handle empty and boundary cases before the main logic.