Quick Overview

This question evaluates a data scientist's ability to perform SQL-based event-level data manipulation, aggregation, joins, and user-level feature derivation from call logs and user attribute tables.

Identify Users Interested in Group Video Calls

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Onsite

video_calls caller | recipient | ds | call_id | duration u1 | u2 | 2023-09-01| c100 | 320 u3 | u4 | 2023-09-01| c101 | 0 u2 | u1 | 2023-09-02| c102 | 180 ​ dim_all_users user_id | age_bucket | country | primary_os | dau_flag | ds u1 | 25-34 | US | iOS | 1 | 2023-09-01 u2 | 35-44 | IN | Android | 1 | 2023-09-01 u3 | 18-24 | US | Android | 0 | 2023-09-01 ##### Scenario Using call-level logs and user attributes, estimate user interest in group video calls. ##### Question Write SQL to identify users who appear interested in group video calls using only the tables below. ##### Hints Derive number of unique recipients per caller per day and filter callers exceeding a threshold.

Overview: This question evaluates a data scientist's ability to perform SQL-based event-level data manipulation, aggregation, joins, and user-level feature derivation from call logs and user attribute tables.

Using the call-level logs and user attributes, write SQL to identify users who appear interested in group video calls. Define an interested user as a caller who, on a given day (ds), contacted at least 2 unique recipients. Return one row per (user, ds) with the user's attributes and the number of unique recipients.

Tables

video_calls(caller VARCHAR(50), recipient VARCHAR(50), ds DATE, call_id VARCHAR(50), duration INTEGER)

dim_all_users(user_id VARCHAR(50), age_bucket VARCHAR(10), country VARCHAR(2), primary_os VARCHAR(20), dau_flag INTEGER, ds DATE)

Hints

  1. First aggregate the call logs by caller and ds to count distinct recipients.
  2. Use COUNT(DISTINCT recipient) grouped by caller and ds; filter where this count is at least 2.
MetaData ScientistmediumData Manipulation (SQL/Python)

Identify Users Interested in Group Video Calls

Using the call-level logs and user attributes, write SQL to identify users who appear interested in group video calls. Define an interested user as a caller who, on a given day (ds), contacted at least 2 unique recipients. Return one row per (user, ds) with the user's attributes and the number of unique recipients.

Expected Output

Return the list of callers (with user attributes) who, on a given day (ds), contacted at least 2 unique recipients, indicating interest in group video calls. For the provided sample data, no caller contacted 2 or more unique recipients on the same day, so the result is empty.

Tables

video_callsdim_all_users
video_calls
ColumnType
callerVARCHAR(50)
recipientVARCHAR(50)
dsDATE
call_idVARCHAR(50)
durationINTEGER
dim_all_users
ColumnType
user_idVARCHAR(50)
age_bucketVARCHAR(10)
countryVARCHAR(2)
primary_osVARCHAR(20)
dau_flagINTEGER
dsDATE

Comments (0)

No comments yet. Be the first to comment!

Submit your answer

Approved first answer today earns 30 XP
Bold⌘BItalic⌘IInline code⌘`Bullet listTab to nest (○ ■)Numbered listTab to nest (a. i.)QuoteCode block
Formatting help
Language
Run code to see results here.

Browse More Questions