The Narrow Lens
A medium Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L5
Interview Prompt
You are smoothing a stream of raw sensor readings before it feeds an alerting pipeline, replacing each reading with a trailing average that damps momentary spikes. Given the readings `values` and a `window_size`, return a list of the same length where each element is the average of the readings up to and including that position, looking back at most `window_size` readings. Near the start, before `window_size` readings exist, average only the ones seen so far.
Summary
A narrow timeframe. Everything inside matters.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your python solution with real code execution
- Get instant feedback and a hire/no-hire decision