Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Top Candidates with Complex Joins

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

Your question is Top Candidates with Complex Joins. 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

Phenom's recruiting analytics team wants to identify top-performing candidates across its candidate experience and recruiting workflows. Write a PostgreSQL query that ranks eligible candidates using application outcomes and completed interview scores.

Requirements

  1. Consider applications submitted from January 1, 2025 through June 30, 2025.
  2. Include candidates with at least two completed interviews, an average completed interview score of at least 75, and at least one application with status advanced or hired.
  3. Calculate each candidate's application count, completed interview count, average interview score, and advanced application count.
  4. Rank candidates by average interview score in descending order and return the top three ranks, including ties.

Schema

candidates
ColumnTypeDescription
candidate_idPKINTUnique candidate identifier
full_nameVARCHAR(100)Candidate full name
emailVARCHAR(150)Candidate email address
current_titleVARCHAR(120)Candidate's current job title
applications
ColumnTypeDescription
application_idPKINTUnique application identifier
candidate_idINTReferences candidates.candidate_id
applied_atDATEDate the application was submitted
statusVARCHAR(30)Current application status
sourceVARCHAR(50)Application source
interviews
ColumnTypeDescription
interview_idPKINTUnique interview identifier
application_idINTReferences applications.application_id
interview_statusVARCHAR(30)Interview completion status
scoreINTInterview score from 0 to 100
interviewerVARCHAR(100)Interviewer name
Tablescandidatesapplicationsinterviews
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results