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
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess 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
Get started
Calculate Monthly Provider Completion Rates
00:00
5 left

Calculate Monthly Provider Completion Rates

MediumSQL · PostgreSQL

Problem

Tell me about your experience with SQL and Python, and how you use them to analyze business problems.

Use the provided Zocdoc provider and appointment data to demonstrate this with a query covering January and February 2025. Include only active providers with at least two appointment requests in a month.

Output

  1. One row per qualifying provider and month
  2. Columns: provider_name, appointment_month, appointment_requests, completed_appointments, and completion_rate
  3. Sort by appointment_month, then provider_name

Output details

  • Use appointment timestamps from 2025-01-01 inclusive through 2025-03-01 exclusive.
  • Represent appointment_month as the first day of each month.
  • Sort appointment_month ascending, then provider_name ascending.
  • Calculate completion_rate as completed requests divided by total requests, multiplied by 100, rounded to 2 decimal places.

Schema

zocdoc_providers
ColumnTypeDescription
provider_idPKINTUnique provider identifier
provider_nameVARCHAR(100)Provider display name
specialtyVARCHAR(100)Provider medical specialty
is_activeBOOLEANWhether the provider is currently active
zocdoc_appointments
ColumnTypeDescription
appointment_idPKINTUnique appointment identifier
provider_idINTReferenced provider identifier
requested_atTIMESTAMPTimestamp when the appointment was requested
statusVARCHAR(30)Appointment outcome status
Tableszocdoc_providerszocdoc_appointments
Interviewer

Your question is Calculate Monthly Provider Completion Rates. 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.