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
Given two sorted lists of event dicts (each with 'timestamp' and 'value') and a numeric tolerance, for each event in stream_a find the nearest event in stream_b whose |timestamp_a - timestamp_b| <= tolerance. If such a match exists, output {'a_value', 'b_value', 'gap'}. Events without a match are skipped. Return the output list in input-order of stream_a. If multiple stream_b events tie for nearest, choose the earliest.
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