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
Data Cleaning for Large Datasets
00:00
5 left

Data Cleaning for Large Datasets

HardSQL · PostgreSQL

Problem

Describe how you clean and validate large datasets before conducting analysis, and how you ensure data quality for Gartner's analyses.

Write a PostgreSQL query that normalizes raw analysis records and produces a data-quality result for every record. Identify missing fields, invalid dates, nonnumeric metrics, unknown source systems, and duplicate business keys.

Output

  1. One row per raw record with the record ID, normalized fields, source name, parsed date, metric value, duplicate count, issue count, and validation status.
  2. Retain records with null input fields so they can be reviewed.
  3. Order by record_id ascending.

Schema

raw_analysis_data
ColumnTypeDescription
record_idPKINTUnique raw analysis record identifier
source_codeVARCHAR(20)Source system code as received
record_keyVARCHAR(40)Business key for the analysis record
event_date_textVARCHAR(10)Event date supplied as text
metric_textVARCHAR(30)Analysis metric supplied as text
source_systems
ColumnTypeDescription
source_codePKVARCHAR(20)Registered source system code
source_nameVARCHAR(100)Registered source system name
Tablesraw_analysis_datasource_systems
Interviewer

Your question is Data Cleaning for Large Datasets. 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.