Implement Prefix Search and Node Removal
Company: Ansys
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
This interview included two coding tasks:
1. Implement a prefix-search data structure for strings with two operations: `insert(word)` and `count_with_prefix(prefix)`. A follow-up asks how to make matching case-insensitive and how to normalize inputs by removing trailing digits with a regular expression before storing or querying.
2. Given the head of a singly linked list and a target value `x`, remove every node whose value equals `x` and return the new head.
Quick Answer: This question evaluates proficiency in string data structures and manipulation (prefix-search concepts including case-insensitive matching and regex-based normalization) as well as linked list pointer manipulation and in-place node removal.