Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

SQL Screening Assessment

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

Your question is SQL Screening Assessment. Start with the requirements and the three tables 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

Meta’s Product Growth team is reviewing an A/B test on Instagram Reels. Write a SQL query that calculates funnel metrics by experiment variant for users who were exposed during the test window.

Requirements

  1. Join the exposure, event, and variant tables to keep only users exposed to the Reels experiment.
  2. For each variant_name, compute: exposed users, users who viewed a Reel, users who saved a Reel, and users who completed the funnel from view to save.
  3. Use the test window 2024-06-01 through 2024-06-07 inclusive.
  4. Return the save rate as saved_users / viewed_users and the funnel completion rate as saved_users / exposed_users.
  5. Sort by variant_name ascending.

Schema

reels_exposures
ColumnTypeDescription
user_idINTMeta user identifier
experiment_idVARCHAR(50)Experiment name, such as reels_save_button_test
variant_idINTAssigned experiment variant
exposed_atDATEDate the user was exposed
reels_events
ColumnTypeDescription
event_idPKINTEvent identifier
user_idINTMeta user identifier
event_nameVARCHAR(50)Event type, such as reel_view or reel_save
event_dateDATEDate the event occurred
experiment_variants
ColumnTypeDescription
variant_idPKINTVariant identifier
variant_nameVARCHAR(50)Variant label, such as control or treatment
Tablesreels_exposuresreels_eventsexperiment_variants
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results