Zoom Data engineer - Phone Screen

Anonymous User
2395
Oct 30, 2020
Nov 01, 2020

Problem #1:

Table: User

+---------------+--------------+
| Column Name   | Type         |
+---------------+--------------+
| user_id       | bigint       |
| user_email    | varchar(100) |
| account_id    | bigint       |
+---------------+--------------+
Table: Meeting
+---------------+------------+
| Column Name   | Type       |
+---------------+------------+
| meeting_id    | bigint     |
| start_time    | datetime   |
| end_time      | datetime   |
+---------------+------------+
Table: Activity
+---------------+---------+
| Column Name   | Type    |
+---------------+---------+
| meeting_id    | int     |
| user_id       | int     |
| activity_type | int     |
| timestamp     | int     |
+---------------+---------+

activity_type can be only one of 2 values: “join_meeting”, “leave_meeting”.

Example of Activity table:

+------------+------------+-----------------+----------------------+
| meeting_id | user_id    | activity_type   | timestamp            |
+------------+------------+-----------------+----------------------+
| 1          | 100        | join_meeting    | 2020-01-01 10:00:01  |
| 1          | 200        | join_meeting    | 2020-01-01 10:01:01  |
| 1          | 300        | join_meeting    | 2020-01-01 10:02:01  |
| 1          | 100        | leave_meeting   | 2020-01-01 10:15:01  |
| 1          | 100        | join_meeting    | 2020-01-01 10:16:01  |
| 1          | 200        | leave_meeting   | 2020-01-01 11:00:01  |
| 1          | 300        | leave_meeting   | 2020-01-01 11:01:01  |
| 1          | 100        | leave_meeting   | 2020-01-01 11:01:01  |
| 2          | 100        | join_meeting    | 2020-01-01 15:00:01  |
| 2          | 500        | join_meeting    | 2020-01-01 15:01:01  |
| 2          | 100        | leave_meeting   | 2020-01-01 15:31:01  |
| 2          | 500        | leave_meeting   | 2020-01-01 15:32:01  |

a)Write a SQL query to compute the Daily Active Users (DAU) for every day in the past 1 month. DAU is the number of unique active users on a particular day and a user is considered active on day X if he/she has an account with Zoom and he/she ever joins a meeting with that account whose start time is on day X. The result table should be something like:

+-------------+---------+
| Date        | DAU     |
+-------------+---------+
| 2020-10-05  | 10000   |
| 2020-10-04  | 30000   |
| 2020-10-03  | 20000   |

b)
Write a SQL query to compute the average number of meetings attended per day across all users in the past one month. The result table should be something like:

+-------------+-- ------------------------------+
| Date        |  Average Number of Meetings     |
+-------------+----- ---------------------------+
| 2020-10-05  | 3.50                            |
| 2020-10-04  | 2.66                            |
| 2020-10-03  | 3.66                            |

Problem #2:

Given a string, find the length of the longest palindrome substring.

Comments (3)