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
Weekly Service KPI by Team
00:00
5 left

Weekly Service KPI by Team

MediumSQL · PostgreSQL

Problem

You are asked to write a PostgreSQL query to analyze service delivery performance by team from Deloitte operational reporting data. Return one row per team per week for completed service requests, showing total requests, on-time completions, average resolution hours, and a KPI status that labels each team-week as On Track, At Risk, or Needs Attention based on on-time rate and average resolution time.

Use the request creation week for grouping, include only requests created in January 2024, and exclude cancelled requests from the KPI calculations. The result should be sorted by week and team name.

Schema

ops_teams
ColumnTypeDescription
team_idPKINTPrimary key for the service delivery team
team_nameVARCHAR(100)Name of the team
regionVARCHAR(50)Region supported by the team
ops_agents
ColumnTypeDescription
agent_idPKINTPrimary key for the service agent
team_idINTTeam assignment for the agent
agent_nameVARCHAR(100)Agent full name
active_flagBOOLEANWhether the agent is currently active
ops_service_requests
ColumnTypeDescription
request_idPKINTPrimary key for the service request
agent_idINTAssigned agent for the request
created_atTIMESTAMPTimestamp when the request was created
completed_atTIMESTAMPTimestamp when the request was completed
due_atTIMESTAMPSLA due timestamp
statusVARCHAR(30)Current request status
priorityVARCHAR(20)Priority level of the request
Tablesops_teamsops_agentsops_service_requests
Interviewer

Your question is Weekly Service KPI by Team. 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.