The Firehose
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
- L4
Interview Prompt
You're rolling up a stream of metric events, each carrying a numeric `timestamp` and a numeric `value`, into fixed-width time windows of size `bucket_width`, where a window spans `[bucket_start, bucket_start + bucket_width)`. Collapse the events so every window holding at least one of them reports its event `count`, the `total` of its values, and the `bucket_start` it begins at. The events arrive in no particular order, any window that caught nothing is left out entirely, and the windows come back from earliest to latest.
Summary
A stream arrives out of order. Roll it up, one time window at a time.
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