Total Attendance Time From Meeting Join and Leave Events

Last updated: November 29, 2026

Quick Overview

Given an unordered list of (participant, timestamp, join|leave) events for one meeting, return each participant's total time connected, counting overlapping connections from multiple devices only once and closing open connections at the meeting end time.

Zoom
Coding & Algorithms
Software Engineer
Zoom
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Easy

0

0

0 solved


Given an unordered list of (participant, timestamp, join|leave) events for one meeting, return each participant's total time connected, counting overlapping connections from multiple devices only once and closing open connections at the meeting end time.

A warm-up in the style of a Zoom backend phone screen, framed around the attendance report hosts download after a meeting. The interviewer checks that you handle real telemetry messiness: the same person joined from laptop and phone, a reconnect at the same millisecond, and a leave event that never arrived.

What the Interviewer Expects
  • Group events by participant and sort by time
  • Count time only while at least one connection is active
  • Break ties so a leave and join at the same timestamp do not double count
  • Close dangling joins at the meeting end time
  • State O(n log n) time clearly
Key Topics to Cover
Interval union
Sweep line
Sorting with tie-breaks
Telemetry cleanup
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you also report the number of separate sessions per participant?
  • Events arrive as a stream across many meetings; how do you compute this incrementally?
  • How would you handle clock skew between the client and server timestamps?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Input is a list of (user, ts, kind) tuples, not sorted, and meeting_end. Output is a dict user -> seconds connected. A participant on two devices at once is still one attendee, so we want the le...

High-Level Design

Bucket events per user, sort each bucket, and sweep keeping a counter of active connections. When the counter goes from 0 to 1 we record a start; when it drops back to 0 we add ts - start. Encoding ...


Submit Your Answer
Markdown supported

Related Questions