Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Handling Missing Data in Dashboards

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

Your question is Handling Missing Data in Dashboards. 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

How would you handle missing or corrupted data fields when preparing an executive-level dashboard?

Write a SQL query that classifies each metric snapshot as usable, missing, or corrupted. Do not silently substitute values for missing or corrupted metrics. Preserve the record for auditability while returning a NULL dashboard value when the metric is not usable.

Output

  1. One row per metric snapshot.
  2. Columns: metric_date, metric_name, dashboard_value, data_status, and quality_issue.
  3. Include all snapshots, order by metric_date ascending and metric_name ascending.

Schema

dashboard_metric_snapshots
ColumnTypeDescription
snapshot_idPKINTUnique metric snapshot identifier
metric_dateDATEReporting date for the metric
metric_nameVARCHAR(100)Name of the dashboard metric
metric_valueNUMERIC(14,4)Reported numeric value, which may be missing
source_systemVARCHAR(100)System that supplied the metric
data_quality_flags
ColumnTypeDescription
quality_flag_idPKINTUnique quality flag identifier
snapshot_idINTMetric snapshot associated with the flag
field_nameVARCHAR(100)Field that was reviewed
issue_typeVARCHAR(50)Quality finding classification
issue_detailVARCHAR(255)Additional explanation of the finding
Tablesdashboard_metric_snapshotsdata_quality_flags
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results