Find Zoho Desk Tickets Breaching First Response SLA
Last updated: November 29, 2026
Quick Overview
Given a tickets table and a per-organization SLA policy table keyed by priority, write SQL that lists every ticket that breached its first-response target, including tickets still waiting for a first reply, and then the breach rate per organization for the last 30 days.
Zoho
November 29, 20260
0
0 solved
Given a tickets table and a per-organization SLA policy table keyed by priority, write SQL that lists every ticket that breached its first-response target, including tickets still waiting for a first reply, and then the breach rate per organization for the last 30 days.
SLA tracking is central to Zoho Desk, where support managers see breach counts on dashboards and escalations fire off them. The interviewer checks join correctness, handling of NULL first responses and interval arithmetic.
What the Interviewer Expects
- Join each ticket to the SLA row for its org and priority
- Treat a NULL first response as breached once the deadline has passed
- Compute the deadline with interval arithmetic, not string math
- Aggregate a breach rate with a correct denominator
- Call out business-hours SLAs as a complication
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 handle SLAs that count only business hours?
- What if a ticket's priority changes after creation?
- How would you make this incremental for a dashboard that refreshes every minute?
- How would you handle tickets with no matching policy?
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(ticket_id, org_id, priority, created_at, first_response_at) where first_response_at is NULL until an agent replies. sla_policies(org_id, priority, first_response_minutes). Times are UTC....
Approach
Deadline = created_at + first_response_minutes * interval '1 minute'. A ticket breaches if it replied after the deadline, or has not replied and now is past the deadline. Tickets not yet due and not...