Career Hub/Interview questions/Platform Split
Netflix logo

Platform Split

Netflix·medium·SQL

Two tables log actions taken on mobile and on web. Return the percentage of users who used only mobile, only web, or both platforms. The three percentages must sum to 100. Round each to 2 decimal places, ordered by platform_group.

Schema

mobile_actions
user_idINTEGER
action_typeVARCHAR
action_timestampTIMESTAMP
web_actions
user_idINTEGER
action_typeVARCHAR
action_timestampTIMESTAMP

Target output

Target output
platform_groupuser_pct
both40
mobile_only20
web_only40

What this question tests

Tests set logic across two event tables: classifying users into only-mobile, only-web or both, with percentages that must reconcile to exactly 100. It rewards candidates who build one combined user universe first instead of juggling three separate counts that drift apart.

More SQL interview questions

  • Viewership Drop Alert · Netflix · hard
  • Premium Artist Diversity · Spotify · medium
  • 7-Day Rolling Listen Average · Spotify · medium
  • Currently Active Pages · Meta · medium
Querymobile_actions, web_actions
Cmd+Enterto runLoading...
Output

Loading sample data...