Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
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
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess 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
Build my plan
Web Metrics vs Downstream Records
00:00
5 left

Web Metrics vs Downstream Records

MediumSQL · PostgreSQL

Problem

Describe how you verify that web metrics align with downstream database records through test cases you would build.

Use the provided web_metrics and database_records tables to produce a test result for every metric and date appearing in either source. Treat multiple downstream records for the same metric and date as one combined value, and identify missing values or discrepancies.

Output

  1. One row per metric and date from either source
  2. Columns: metric_date, metric_name, web_value, database_value, variance, and test_status
  3. Include matching, mismatched, missing-web, and missing-database cases
  4. Sort by metric_date, then metric_name

Schema

web_metrics
ColumnTypeDescription
metric_idPKINTUnique web metric row identifier
metric_dateDATEDate represented by the web metric
metric_nameVARCHAR(50)Name of the tracked web metric
web_valueDECIMAL(12,2)Metric value reported by the web measurement system
database_records
ColumnTypeDescription
record_idPKINTUnique downstream record identifier
record_dateDATEDate represented by the downstream record
metric_nameVARCHAR(50)Name of the downstream metric
record_valueDECIMAL(12,2)Value contributed by the downstream record
Tablesweb_metricsdatabase_records
Interviewer

Your question is Web Metrics vs Downstream Records. 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.