Netflix Interview Questions
Use a fact dimension (star schema) design on a lakehouse: Fact table : fact view events view id , user key , content key , device key , date key watch s...
Design a scalable schema for tracking real-time viewing data across millions of users.
Use a fact dimension (star schema) design on a lakehouse: Fact table : fact view events view id , user key , content key , device key , date key watch start ts , watch end ts , watch duration sec , percent completed stream quality , country code Dimension tables : dim user , dim content (title, genre, type), dim device , dim date Storage : Partition fact view events by date (daily). Use Delta Lake for ACID + time travel. For real time ingestion: Kafka → Spark Structured Streaming → Delta Lake wi
Explain the differences between star and snowflake schemas.
Star schema : fact table surrounded by denormalized dimension tables. One join hop from fact to any dimension — fast BI queries, simple SQL. Snowflake schema : dimensions are normalized into sub dimensions (e.g., dim genre split from dim content ). Fewer storage redundancies but more JOINs, slower queries. When to use : Star: BI heavy, read optimized analytical workloads (Redshift, BigQuery, Snowflake) Snowflake: large dimension tables with many updates (reduces write amplification) At Netflix s
Define a data governance framework and its importance.
Data governance is the set of policies, standards, and processes ensuring data is accurate, secure, and used appropriately. Key pillars : Data catalog : inventory with owners and descriptions (Apache Atlas, Collibra, Purview) Data quality : automated checks — null rates, schema validation, business rules Access control : RBAC — only authorized roles access PII or sensitive content data Data lineage : track data from source to dashboard; critical for debugging and compliance Compliance : GDPR, CC
Describe an ETL pipeline for ingesting and processing user viewing data at Netflix scale.
Bronze : raw events, no transformation, schema on read Silver : deduplicated, parsed timestamps, joined with dim content , filtered invalid sessions Gold : pre aggregated daily/weekly views per title, genre, region Key concerns : Idempotency : use MERGE INTO on view id to prevent duplicates on replay Late data : use watermarking (e.g., 2 hour window) in Spark Streaming Scale : millions of events/second → partition Kafka by user id % N Monitoring : Airflow SLA alerts, row count validation at each
How would you automate data quality checks in streaming data workflows?
Schema validation : use Confluent Schema Registry with Avro — rejects malformed events at the Kafka producer level In stream checks : in Spark Structured Streaming, filter or quarantine records failing rules: Post write checks : Great Expectations or dbt tests on micro batch output — null rates, row count thresholds Monitoring : CloudWatch/Datadog metrics for records processed/rejected per micro batch Alerting : PagerDuty alert if rejected rate 1% of total events
Write SQL to find the most frequently rented (or watched) items.
For top item per genre :
Write SQL to list users who joined within a specific timeframe.
With activity filter — users who joined and watched at least once:
Design a system to track movie counts per genre annually.
Schema : Query — movies added per genre per year : For trends, store results in a pre aggregated table refreshed nightly by Airflow.