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
Diagnose Holiday Latency Spikes
00:00
5 left

Diagnose Holiday Latency Spikes

HardSQL · PostgreSQL

Problem

You are given database telemetry for a customer’s Blue Yonder environment during a holiday peak window. Write a PostgreSQL query that returns the hourly periods where database latency spiked sharply, along with the workload and infrastructure signals most likely associated with the spike. Your result should compare each hour to the previous hour, flag the spike hours, and include the database, hour, latency, query volume, CPU, and active connections.

Schema

db_latency_metrics
ColumnTypeDescription
metric_idPKINTPrimary key for the hourly metric row
database_nameVARCHAR(100)Name of the customer database
metric_hourTIMESTAMPHourly timestamp for the metric snapshot
avg_latency_msNUMERIC(10,2)Average database latency in milliseconds
query_countINTNumber of queries processed in the hour
active_connectionsINTActive database connections during the hour
cpu_utilization_pctNUMERIC(5,2)CPU utilization percentage for the hour
holiday_calendar
ColumnTypeDescription
calendar_datePKDATEHoliday date
holiday_nameVARCHAR(100)Holiday or peak-period label
is_peak_hourBOOLEANWhether the date belongs to the peak holiday window
Tablesdb_latency_metricsholiday_calendar
Interviewer

Your question is Diagnose Holiday Latency Spikes. 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.