Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Find Publishers With Low CTR
00:00
5 left

Find Publishers With Low CTR

MediumSQL · PostgreSQL

Problem

A digital advertising platform wants to identify publishers whose recent ad performance is substantially below the network benchmark. Write a SQL query to find publishers with low click-through rates using metric records from a fixed 24-hour reporting window ending at 2026-09-15 12:00:00+00.

Output

  1. Return one row per eligible publisher with at least 100 impressions in the reporting window.
  2. Include publisher_id, publisher_name, impressions, clicks, and ctr.
  3. Include publishers whose CTR is less than half of the overall CTR across eligible publishers.
  4. Round ctr to six decimal places.
  5. Order by ctr ascending, then publisher_id ascending.
  6. Records with NULL revenue do not affect the result because revenue is not used.

Schema

publishers
ColumnTypeDescription
publisher_idPKINTUnique publisher identifier
publisher_nameVARCHAR(120)Publisher display name
ad_metrics
ColumnTypeDescription
metric_idPKINTUnique metric record identifier
publisher_idINTPublisher associated with the metric record
observed_atTIMESTAMPTZStart time of the metric interval
impressionsINTNumber of ad impressions
clicksINTNumber of ad clicks
revenueNUMERIC(12,2)Revenue attributed to the metric interval
Tablespublishersad_metrics
Interviewer

Your question is Find Publishers With Low CTR. Start with the requirements and the two tables in the Question tab.

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.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.