Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Get started
Validate Dashboard Metrics Against Source Events
00:00
5 left

Validate Dashboard Metrics Against Source Events

MediumSQL · PostgreSQL

Problem

How do you ensure the accuracy of your dashboards when reporting to senior leadership?

Translate this question into a SQL validation check for a T-Mobile US leadership dashboard. Compare dashboard metrics with independently aggregated source events and identify discrepancies.

Output

  1. One row per reporting date and market.
  2. Columns: metric_date, market, source_subscribers, source_data_gb, dashboard_subscribers, dashboard_data_gb, and validation_status.
  3. Include matching, mismatched, dashboard-missing, and source-missing records. Order by metric_date, then market.

Output details

  • Count distinct subscriber_id values for source_subscribers per date and market.
  • Sum data_gb without rounding for source_data_gb.
  • Preserve NULL metric values; do not treat NULL as zero or equal to NULL during comparisons.
  • Use exactly MATCH, MISMATCH, MISSING_DASHBOARD, and MISSING_SOURCE as status values.
  • Sort metric_date ascending, then market ascending.

Schema

network_usage_events
ColumnTypeDescription
event_idPKINTUnique network usage event identifier
event_dateDATEDate on which the usage event occurred
marketVARCHAR(50)T-Mobile US market associated with the event
subscriber_idVARCHAR(20)Subscriber associated with the usage event
data_gbDECIMAL(10,2)Data usage in gigabytes
tmobile_us_dashboard_metrics
ColumnTypeDescription
metric_datePKDATEDashboard reporting date
marketPKVARCHAR(50)Dashboard market
dashboard_subscribersINTSubscriber count displayed on the dashboard
dashboard_data_gbDECIMAL(10,2)Data usage displayed on the dashboard in gigabytes
Tablesnetwork_usage_eventstmobile_us_dashboard_metrics
Interviewer

Your question is Validate Dashboard Metrics Against Source Events. 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
Sign up free to run your codeLog inLn 1
Run your query to see results here.