Loading interview...
Overlapping User Sessions
A medium SQL mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- mid
Interview Prompt
Given a user_sessions table with session_id, user_id, start_time, and end_time, write a query to find all pairs of overlapping sessions for the same user. Two sessions overlap if one starts before the other ends and vice versa. Return user_id, both session_ids, and their start times. Do not pair a session with itself.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your sql solution with real code execution
- Get instant feedback and a hire/no-hire decision