Measure Google Workspace Support First Response Time in Business Hours
Last updated: November 29, 2026
Quick Overview
Given support tickets with creation and first response timestamps, compute each ticket's first response time counting only weekday business hours (9:00 to 17:00, excluding holidays) and the median across responded tickets.
0
0
0 solved
Given support tickets with creation and first response timestamps, compute each ticket's first response time counting only weekday business hours (9:00 to 17:00, excluding holidays) and the median across responded tickets.
Support SLAs for Google Workspace and Google Cloud customers are often measured in business hours, and wall-clock metrics punish tickets filed on Friday evening. This onsite Python question checks careful interval arithmetic across days, weekends and holidays, plus clear handling of unanswered tickets.
What the Interviewer Expects
- Clip each calendar day to the business window and sum overlaps
- Skip weekends and a holiday set
- Handle tickets created or answered outside business hours
- Exclude unanswered tickets from the median and report them separately
- State time zone assumptions and complexity
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
- Customers in different regions have different support hours. How do you generalize?
- How would you vectorize this for 10 million tickets?
- Unanswered tickets are excluded. How does that bias the median and what would you report instead?
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
Tickets are (ticket_id, created_at, first_response_at or None) as naive datetimes in the support team's time zone. Business hours are Monday to Friday, 09:00 to 17:00, minus holidays given as a set ...
Approach
Walk day by day from the creation date to the response date. For each business day, intersect [start, end] with that day's [09:00, 17:00] window and add the overlap if positive. That one rule cove...