Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Top Failure Reasons by Region

MediumSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Top Failure Reasons by Region. Start with the requirements and the two tables on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Verizon network operations teams use drop-event data to prioritize reliability investigations across service regions. Write a PostgreSQL query to identify the three most frequent failure reasons for each region.

Requirements

  1. Join network_drop_events to verizon_regions using region_id.
  2. Count only events whose event_status is FAILED and whose failure_reason is not NULL.
  3. Rank reasons within each region by failure count descending, breaking ties alphabetically by reason, and return only ranks 1 through 3.
  4. Return results ordered by region name, rank, and failure reason.

Schema

verizon_regions
ColumnTypeDescription
region_idPKINTUnique Verizon service-region identifier
region_nameVARCHAR(50)Human-readable service-region name
network_drop_events
ColumnTypeDescription
event_idPKINTUnique network drop event identifier
region_idINTRegion associated with the event
event_timeTIMESTAMPTimestamp when the event occurred
failure_reasonVARCHAR(100)Classified reason for the network failure
event_statusVARCHAR(20)Lifecycle status of the event
Tablesverizon_regionsnetwork_drop_events
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results