Meta VO Interview Question: Count Users Who Started Calls With More Than 3 Different People in the Last 7 Days

14 Views
No Comments

How many users started a call with more than 3 different people in the last 7 days?

Table name: video_calls

This table has 1 row per unique call. Assume it only includes calls between 2 individuals.

Table name: dim_all_users

Question 1: How many users started a call with more than 3 different people in the last 7 days?

Table: video_calls

  • caller BIGINT — FB ID of person who made the call
  • recipient BIGINT — FB ID of person who was called
  • ds STRING — date of the call
  • call_id BIGINT — each call has a unique ID
  • duration DOUBLE — length of time of call, in seconds

Table: dim_all_users

  • user_id BIGINT — user’s FB ID
  • age_bucket STRING — user’s age category
  • country STRING — country where the user is based
  • primary_os STRING — main device operating system
  • dau_flag TINYINT — 1 for daily active users, else 0
  • ds STRING — date of the record

This problem is a user-level aggregation task over call logs. The key is to treat the caller as the user who started the call, then count how many distinct recipients each caller contacted within the last 7 days. After filtering to the required date window, group by caller, compute the distinct number of people they called, and count how many callers exceed the threshold of 3. The main pitfalls are confusing caller with recipient and forgetting to use distinct counts.

END
 0