Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL Difficulty Check

EasySQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is SQL Difficulty Check. Start with the requirements and the one table on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Netflix Open Connect telemetry records bandwidth consumed during streaming sessions. Write a PostgreSQL query that summarizes valid January 2025 usage for each subscriber.

Requirements

  1. Exclude sessions before January 1, 2025 and rows where bandwidth_mb is NULL.
  2. Return total bandwidth, average bandwidth per session rounded to two decimals, and session count for each subscriber, ordered by average bandwidth descending.

Schema

streaming_bandwidth
ColumnTypeDescription
usage_idPKINTUnique streaming usage record
subscriber_idINTNetflix subscriber identifier
usage_dateDATEDate of the streaming session
bandwidth_mbDECIMAL(10,2)Bandwidth consumed during the session in megabytes
Tablesstreaming_bandwidth
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results