Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Advanced Data Modeling for Performance
00:00
5 left

Advanced Data Modeling for Performance

HardSQL · PostgreSQL

Problem

Describe a time you utilized advanced data modeling techniques to solve a specific business performance issue at Citi.

For this hands-on version, use the supplied Citi performance tables to calculate monthly actuals against targets and identify performance gaps.

Output

  1. Return one row per business unit for January 2025.
  2. Include unit_name, actual_value, target_value, variance, performance_status, and shortfall_rank.
  3. Include business units without actual activity or a target, sort by largest shortfall first, and place units without targets last. Break ties alphabetically by unit_name.

Schema

business_units
ColumnTypeDescription
unit_idPKINTUnique business-unit identifier
unit_nameVARCHAR(100)Business-unit name
business_lineVARCHAR(80)Citi business line
performance_results
ColumnTypeDescription
result_idPKINTUnique performance result identifier
unit_idINTBusiness unit associated with the result
performance_monthDATEFirst day of the reporting month
metric_nameVARCHAR(80)Performance metric name
actual_valueNUMERIC(12,2)Observed performance value
performance_targets
ColumnTypeDescription
target_idPKINTUnique target identifier
unit_idINTBusiness unit associated with the target
performance_monthDATEFirst day of the target month
target_valueNUMERIC(12,2)Target performance value
Tablesbusiness_unitsperformance_resultsperformance_targets
Interviewer

Your question is Advanced Data Modeling for Performance. 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.