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
Top Sellers From Meeting Graph
00:00
5 left

Top Sellers From Meeting Graph

HardSQL · PostgreSQL

Problem

Deliverr's analytics team wants to identify the strongest collaboration pairs from internal meetings. Write a PostgreSQL query that returns the top three pairs of people who attended completed meetings together during January 2025.

Requirements

  1. Generate each unordered pair only once, never pairing a person with themselves.
  2. Count distinct completed meetings attended by both people, ignoring cancelled, scheduled, out-of-range, and invalid attendee rows.
  3. Return each person's name, the number of shared meetings, the date of their most recent shared meeting, and the pair's rank.
  4. Return exactly three pairs. Break ties deterministically by the first person's name and then the second person's name.
  5. Use multiple CTEs, joins, aggregation, and a window function.

Schema

people
ColumnTypeDescription
person_idPKINTUnique employee identifier
full_nameVARCHAR(100)Employee display name
teamVARCHAR(80)Employee team
meetings
ColumnTypeDescription
meeting_idPKINTUnique meeting identifier
organizer_idINTEmployee who organized the meeting
meeting_dateDATECalendar date of the meeting
statusVARCHAR(20)Meeting lifecycle status
meeting_attendees
ColumnTypeDescription
meeting_idPKINTReferenced meeting identifier
person_idPKINTReferenced attendee identifier
Tablespeoplemeetingsmeeting_attendees
Interviewer

Your question is Top Sellers From Meeting Graph. Start with the requirements and the three 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.