Compute Monthly Billable Utilization From Consultant Timesheets
Last updated: November 29, 2026
Quick Overview
Using timesheet, project and monthly capacity tables, write a SQL query that returns each consultant's billable hours, available hours and utilization percentage for every month, including consultants who logged no billable time.
Deloitte
November 29, 20260
0
0 solved
Using timesheet, project and monthly capacity tables, write a SQL query that returns each consultant's billable hours, available hours and utilization percentage for every month, including consultants who logged no billable time.
Utilization is the headline operating metric in a professional services firm, and Deloitte data engineers build the reporting that partners and staffing teams read weekly. The interviewer checks join direction, conditional aggregation and division safety more than anything fancy.
What the Interviewer Expects
- Uses conditional aggregation to separate billable from non-billable hours
- Drives the result from the capacity table so benched consultants still appear
- Guards against divide by zero with NULLIF
- Groups by month correctly
- Explains how the number would be validated against the finance system
Key Topics to Cover
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
- How would you compute a trailing three month utilization?
- Some timesheets are submitted late and revised. How do you keep history consistent?
- How do you treat approved leave in available hours?
- How would you rank practices by utilization while weighting by headcount?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice SQL ProblemsSample Answer
Clarify the Data
Tables:
timesheets(consultant_id, work_date, project_code, hours)projects(project_code, is_billable)where bench and training codes are non-billable- `capacity(consultant_id, month, availabl...
Approach
Aggregate timesheets to consultant and month with SUM(CASE WHEN is_billable ...). Then start from capacity and LEFT JOIN the aggregate, because the consultant with zero billable hours is precisely...