Compute Monthly Billable Utilization per Consultant in SQL

Last updated: November 29, 2026

Quick Overview

Using timesheets, charge codes, a working-day calendar and consultant start and end dates, write a query that returns each consultant's billable hours, available hours and utilization percentage for every month they were employed, including months with no billable time.

Accenture
Data Manipulation (SQL/Python)
Data Engineer
Accenture
November 29, 2026
Data Engineer
Technical Screen
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Using timesheets, charge codes, a working-day calendar and consultant start and end dates, write a query that returns each consultant's billable hours, available hours and utilization percentage for every month they were employed, including months with no billable time.

Utilization (chargeable hours over available hours) is a headline operating metric for a consulting firm like Accenture, and the data team that reports it must get denominators and missing rows right. The interviewer checks join design, the zero-activity case and filtering of unapproved time.

What the Interviewer Expects
  • Builds the denominator from the calendar and employment dates, not from logged hours
  • Uses a LEFT JOIN so zero-billable months still appear
  • Filters to approved timesheet rows
  • Separates billable from non-billable charge codes with conditional aggregation
  • Avoids integer division and rounds only at the end
Key Topics to Cover
Conditional aggregation
LEFT JOIN
Calendar tables
Denominator design
Data quality
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you handle part-time consultants or approved leave?
  • How would you compute a rolling three-month utilization?
  • Timesheets are often resubmitted. How would you keep only the latest version of each entry?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

Tables: consultants(consultant_id, start_date, end_date) with null end for active staff, calendar(day, is_workday) with holidays marked non-working, charge_codes(charge_code, is_billable), and `...

Approach

Two CTEs. working_days joins each consultant to calendar workdays within their employment window and counts them per month: this is the denominator and guarantees one row per consultant-month even w...


Submit Your Answer
Markdown supported

Related Questions