Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
SQL Joins and DNS Working
00:00
5 left

SQL Joins and DNS Working

MediumSQL · PostgreSQL

Problem

Tell me about a time you debugged DNS-related issues and fixed SQL join queries to get correct results.

For the supplied records, write a PostgreSQL query that returns resolved DNS debugging records with at least one verified SQL join fix. Match fixes to their corresponding debugging record and exclude unverified fixes.

Output

  1. One row per qualifying debugging record, with incident_id, hostname, resolved_at, verified_join_fixes, and latest_fix_at
  2. Include only resolved records having at least one verified fix
  3. Order by latest_fix_at descending, then incident_id ascending

Schema

dns_incidents
ColumnTypeDescription
incident_idPKINTUnique debugging incident identifier
hostnameVARCHAR(255)Hostname involved in the DNS issue
resolution_statusVARCHAR(30)Current resolution state
resolved_atTIMESTAMPTime the incident was resolved
sql_join_fixes
ColumnTypeDescription
fix_idPKINTUnique SQL fix identifier
incident_idINTIncident associated with the fix
join_typeVARCHAR(30)Join type involved in the corrected query
validation_statusVARCHAR(30)Validation state of the SQL fix
fixed_atTIMESTAMPTime the fix was recorded
Tablesdns_incidentssql_join_fixes
Interviewer

Your question is SQL Joins and DNS Working. Start with the requirements and the two tables in the Question tab.

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.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.