Meta VO 面试真题解析:过去 7 天内与超过 3 位不同对象发起通话的用户数

19次阅读
没有评论

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

这道题考察的是基于通话明细做用户去重统计。需要从 video_calls 表里找出“发起通话”的用户,也就是 caller,并按用户聚合,统计他们在最近 7 天内曾经通话过的不同 recipient 数量。如果某个用户对应的不同通话对象数量超过 3,就把这个用户计入答案。核心思路通常是先按 ds 限定最近 7 天,再对 caller 和 recipient 做去重计数,最后统计满足阈值的用户数。这个题重点在于理解“started a call”对应 caller 角色,以及“more than 3 different people”意味着要对通话对象做 distinct 去重。

正文完
 0