Interview Guides
You are given clinic-level device status events and need to identify the clinics with the worst reliability over the last 30 days. Write a PostgreSQL query that returns the top 10% of clinics by device offline rate, where offline rate is defined as offline events divided by total device status events in the 30-day window.