Find the Nearest Target Character and Support Streaming Updates
Company: Snowflake
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Technical Screen
Quick Answer: Practice a Snowflake coding interview problem focused on find the nearest target character and support streaming updates. The prompt emphasizes edge cases, clean implementation, and verifiable test behavior without revealing the solution.
Examples
Input: {"chars":["a","b","c","b"],"target":"b"}
Expected Output: [1,0,1,0]
Explanation: Targets on both sides.
Input: {"chars":[],"target":"x"}
Expected Output: []
Explanation: Empty.