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
Monthly Conversion Rate by Channel
00:00
5 left

Monthly Conversion Rate by Channel

MediumSQL · PostgreSQL

Problem

Business Context

ZoomInfo marketing analysts use website, campaign, and webinar engagement data to evaluate which acquisition channels generate demo requests.

Task

Write a PostgreSQL query that calculates monthly conversion performance by channel from marketing_events. Treat a visitor as converted within a month and channel when they have at least one demo_request event in that same month and channel.

Requirements

  1. Return the month in YYYY-MM format, the channel name, total distinct visitors, converted distinct visitors, and conversion rate as a percentage.
  2. Count each visitor only once per month and channel, even if the visitor has multiple events.
  3. Restrict the analysis to January and February 2025, and exclude events whose channel_id does not match the channels table.
  4. Sort results chronologically by month and alphabetically by channel name.

Schema

marketing_events
ColumnTypeDescription
event_idPKINTUnique marketing event identifier
visitor_idVARCHAR(30)Anonymous or known visitor identifier
channel_idINTMarketing channel associated with the event
occurred_atTIMESTAMPTimestamp when the event occurred
event_typeVARCHAR(30)Type of marketing event
channels
ColumnTypeDescription
channel_idPKINTUnique marketing channel identifier
channel_nameVARCHAR(80)Readable marketing channel name
Tablesmarketing_eventschannels
Interviewer

Your question is Monthly Conversion Rate by Channel. 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.