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
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
SQL for Overdue Work by Owner
00:00
5 left

SQL for Overdue Work by Owner

MediumSQL · PostgreSQL

Problem

Given tables for tasks, owners, and status updates, how would you find overdue work and summarize it by owner using SQL at Attentive?

Use 2025-02-01 as the reporting date. A task is overdue when its due date is before that date and its latest status is not Completed. Include tasks without status updates and tasks without an assigned owner.

Output

  1. One row per owner, including Unassigned when applicable.
  2. Columns: owner_id, owner_name, overdue_count, and overdue_task_ids.
  3. Sort by overdue count descending, then owner name ascending.

Schema

owners
ColumnTypeDescription
owner_idPKINTUnique owner identifier
owner_nameVARCHAR(100)Owner's display name
team_nameVARCHAR(100)Attentive team assigned to the owner
tasks
ColumnTypeDescription
task_idPKINTUnique task identifier
task_nameVARCHAR(200)Task title
owner_idINTAssigned owner, when one exists
due_dateDATETask due date
created_atDATETask creation date
status_updates
ColumnTypeDescription
status_update_idPKINTUnique status update identifier
task_idINTTask associated with the update
statusVARCHAR(50)Status recorded by the update
updated_atTIMESTAMPTimestamp when the status was recorded
Tablestasksownersstatus_updates
Interviewer

Your question is SQL for Overdue Work by Owner. 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.