The Stream Joiner
A hard Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- Python
- Difficulty
- hard
- Seniority
- L5
Interview Prompt
You're correlating two time-sorted event streams where each event is a dict carrying a `timestamp` and a `value`, given a numeric `tolerance`. Walking `stream_a` in order, pair each event with the single nearest event in `stream_b` whose timestamp lies within `tolerance` of it, emitting a dict of `a_value`, `b_value`, and the absolute `gap`; an A event with nothing inside its window contributes no row. When two B events are equally near, keep the earlier one, and remember a single B event can be the nearest match for several A events.
Summary
Events don't wait for each other. This does.
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