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 Sites by Unresolved Tickets
00:00
5 left

Top Sites by Unresolved Tickets

MediumSQL · PostgreSQL

Problem

A facilities team wants to identify sites with the most unresolved work orders. Write a SQL query to return the top 10 sites by unresolved tickets created during the 30-day period ending on September 4, 2026.

Output

  1. One row per site with columns site_id, site_name, client_name, and unresolved_ticket_count.
  2. Include only work orders with status open, in_progress, or pending, created from August 5, 2026 through September 4, 2026, inclusive.
  3. Exclude work orders without a matching site or client.
  4. Sort by unresolved ticket count descending, then site_id ascending for ties, and return at most 10 rows.
  5. Rows with statuses or dates outside the specified scope are excluded.

Schema

work_orders
ColumnTypeDescription
work_order_idPKINTUnique work order identifier
site_idINTSite associated with the work order
client_idINTClient associated with the work order
statusVARCHAR(30)Current work order status
created_atTIMESTAMPTimestamp when the work order was created
sites
ColumnTypeDescription
site_idPKINTUnique site identifier
site_nameVARCHAR(150)Site display name
client_idINTClient responsible for the site
clients
ColumnTypeDescription
client_idPKINTUnique client identifier
client_nameVARCHAR(150)Client display name
Tableswork_orderssitesclients
Interviewer

Your question is Top Sites by Unresolved Tickets. 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.