Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Candidate Funnel Conversion by Channel

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

Your question is Candidate Funnel Conversion by Channel. 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

You are given recruiting pipeline data from Micro1 and asked to write a PostgreSQL query that calculates the conversion rate of candidates from the initial AI screening stage to the final technical assessment stage, grouped by sourcing channel. Treat a candidate as having entered the funnel if they have an ai_screening_started event, and as converted if they also have a technical_assessment_completed event. Return the sourcing channel, the number of candidates who started AI screening, the number who reached the final technical assessment, and the conversion rate as a percentage rounded to 2 decimals.

Schema

candidates
ColumnTypeDescription
candidate_idPKINTUnique candidate identifier
sourcing_channelVARCHAR(50)Channel where the candidate originated
created_atDATEDate the candidate profile was created
stage_events
ColumnTypeDescription
event_idPKINTUnique event identifier
candidate_idINTCandidate associated with the stage event
stage_nameVARCHAR(60)Name of the funnel stage event
event_timeTIMESTAMPTimestamp when the event occurred
channels
ColumnTypeDescription
channel_namePKVARCHAR(50)Canonical sourcing channel name
is_activeBOOLEANWhether the sourcing channel is active
Tablescandidatesstage_eventschannels
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results