Google: Meet Calls Where Guests Waited for a Late Host
The Google Meet team is testing a nudge for hosts who keep people waiting.
- Difficulty: Medium
- Topics: Joins, Aggregation, Dates
- Dialect: MySQL
- Problem: #690
Problem statement
The Google Meet team is testing a nudge for hosts who keep people waiting. A participant's arrival is their first join to a call (people often drop and rejoin).
A call qualifies when its host arrived more than 5 minutes (300 seconds) after scheduled_start and at least one guest (anyone other than the host) arrived strictly before the host. Calls the host never joined are left out. Return meeting_id, host_email, host_late_minutes (whole minutes from scheduled_start to the host's arrival) and guests_waiting (guests who arrived before the host). Order by host_late_minutes descending, then meeting_id ascending.
A practice scenario set at Google: the tables and data are invented, and this is not a question from, or endorsed by, Google.
Tables
Table: MeetCall
| Column | Type |
|---|---|
| meeting_id | int |
| host_email | varchar |
| scheduled_start | datetime |
Primary key: meeting_id.
One scheduled Meet call and its host.
Table: MeetJoin
| Column | Type |
|---|---|
| join_id | int |
| meeting_id | int |
| participant_email | varchar |
| joined_at | datetime |
Primary key: join_id.
One time a participant entered a call; the same person can have several rows for one call.
Examples
Example 1
MeetCall
| meeting_id | host_email | scheduled_start |
|---|---|---|
| 1 | asha@zentrix.io | 2025-06-02 10:00:00 |
| 2 | ravi@zentrix.io | 2025-06-02 11:00:00 |
| 3 | meera@zentrix.io | 2025-06-02 12:00:00 |
| 4 | kabir@zentrix.io | 2025-06-02 15:00:00 |
| 5 | zara@zentrix.io | 2025-06-02 16:00:00 |
MeetJoin
| join_id | meeting_id | participant_email | joined_at |
|---|---|---|---|
| 1 | 1 | neha@zentrix.io | 2025-06-02 09:59:00 |
| 2 | 1 | dev@zentrix.io | 2025-06-02 10:03:00 |
| 3 | 1 | asha@zentrix.io | 2025-06-02 10:12:30 |
| 4 | 1 | dev@zentrix.io | 2025-06-02 10:20:00 |
| 5 | 2 | neha@zentrix.io | 2025-06-02 11:01:00 |
| 6 | 2 | ravi@zentrix.io | 2025-06-02 11:05:00 |
| 7 | 3 | meera@zentrix.io | 2025-06-02 12:09:00 |
| 8 | 3 | dev@zentrix.io | 2025-06-02 12:10:00 |
| 9 | 4 | neha@zentrix.io | 2025-06-02 15:00:00 |
| 10 | 5 | dev@zentrix.io | 2025-06-02 16:06:00 |
| 11 | 5 | zara@zentrix.io | 2025-06-02 16:08:00 |
| 12 | 5 | zara@zentrix.io | 2025-06-02 16:30:00 |
Output
| meeting_id | host_email | host_late_minutes | guests_waiting |
|---|---|---|---|
| 1 | asha@zentrix.io | 12 | 2 |
| 5 | zara@zentrix.io | 8 | 1 |
How to solve Google: Meet Calls Where Guests Waited for a Late Host
Rejoins are the trap: a guest who arrived early, dropped and came back late is still someone who waited, and a host who rejoined later did not arrive late a second time. So the log is first reduced to arrivals — MIN(joined_at) per call and participant.
The host's arrival is the arrival row whose participant is the call's host_email; an inner join drops calls the host never entered. Lateness is measured exactly in seconds so that a host at 5:00 is on time and one at 5:01 is late, then reported in whole minutes with TIMESTAMPDIFF(MINUTE, …).
Joining the late hosts back to the arrivals of everyone else with arrived_at < host_at leaves the guests who were already waiting; a guest who arrived at the same second as the host did not wait. Calls with no such guest produce no row, which is the "at least one guest" rule. Because arrivals are unique per person, COUNT(*) counts people.
The alternative finds the host's arrival with conditional aggregation — MIN(CASE WHEN participant = host …) — and counts waiting guests straight from the raw log with COUNT(DISTINCT …), since a person with any join before the host's arrival has an arrival before it too.
Reference solution (MySQL)
WITH arrivals AS (
SELECT meeting_id, participant_email, MIN(joined_at) AS arrived_at
FROM MeetJoin
GROUP BY meeting_id, participant_email
), hosts AS (
SELECT c.meeting_id, c.host_email, c.scheduled_start, a.arrived_at AS host_at
FROM MeetCall c
JOIN arrivals a ON a.meeting_id = c.meeting_id AND a.participant_email = c.host_email
WHERE TIMESTAMPDIFF(SECOND, c.scheduled_start, a.arrived_at) > 300
)
SELECT h.meeting_id, h.host_email,
TIMESTAMPDIFF(MINUTE, h.scheduled_start, h.host_at) AS host_late_minutes,
COUNT(*) AS guests_waiting
FROM hosts h
JOIN arrivals g
ON g.meeting_id = h.meeting_id
AND g.participant_email <> h.host_email
AND g.arrived_at < h.host_at
GROUP BY h.meeting_id, h.host_email, h.scheduled_start, h.host_at
ORDER BY host_late_minutes DESC, h.meeting_idAnother way
SELECT x.meeting_id, x.host_email, TIMESTAMPDIFF(MINUTE, x.scheduled_start, x.host_at) AS host_late_minutes, COUNT(DISTINCT j.participant_email) AS guests_waiting FROM (SELECT c.meeting_id, c.host_email, c.scheduled_start, MIN(CASE WHEN j.participant_email = c.host_email THEN j.joined_at END) AS host_at FROM MeetCall c JOIN MeetJoin j ON j.meeting_id = c.meeting_id GROUP BY c.meeting_id, c.host_email, c.scheduled_start) x JOIN MeetJoin j ON j.meeting_id = x.meeting_id AND j.participant_email <> x.host_email AND j.joined_at < x.host_at WHERE x.host_at > DATE_ADD(x.scheduled_start, INTERVAL 300 SECOND) GROUP BY x.meeting_id, x.host_email, x.scheduled_start, x.host_at ORDER BY host_late_minutes DESC, x.meeting_id← Google: Cloud Cost Spikes Against the Trailing Week · Google: YouTube Channels Eligible for the Partner Programme →