When the Hours Touch
A medium Python mock interview question on DataDriven, with an AI interviewer who asks follow-up questions and a hire or no-hire decision at the end.
- Domain
- Python
- Difficulty
- medium
- Seniority
- mid
Interview Prompt
Online stretches in this status export arrive unsorted, and a flaky app reconnecting mid-session leaves many of them overlapping, each a `[start, end]` pair of timestamps in seconds with sub-second fractions. Collapse a driver's `sessions` into the distinct windows of time the driver was actually online, earliest window first.
Summary
Two sessions that overlap are really one. Find the windows a driver was actually online.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write and run your Python against test cases
- Answer the interviewer's follow-up questions, then get a hire or no-hire decision