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
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
Handling Missing Data During Ingestion
00:00
5 left

Handling Missing Data During Ingestion

MediumSQL · PostgreSQL

Problem

Tell me how you handle missing or malformed data during ingestion.

Inspect the provided raw records and allowed event types. Return one validation result for every raw record. Treat trimmed blank values as missing, accept only calendar-valid dates in YYYY-MM-DD form, accept nonnegative decimal measurements, and require a recognized event type. Do not allow malformed values to abort the query.

Output

  1. Columns: source_line, record_id, ingestion_status, rejection_reason, normalized_visit_date, normalized_measurement
  2. One row per raw record, ordered by source_line
  3. Include accepted and rejected records; rejected records must identify each applicable reason

Schema

raw_ingestion_records
ColumnTypeDescription
source_linePKINTEGERSource row number from the ingestion file
record_idVARCHAR(30)Raw record identifier
raw_visit_dateVARCHAR(30)Raw visit date text
raw_measurementVARCHAR(30)Raw numeric measurement text
event_typeVARCHAR(30)Raw event type code
subject_codeVARCHAR(30)Subject identifier
allowed_event_types
ColumnTypeDescription
event_typePKVARCHAR(30)Recognized event type code
event_descriptionVARCHAR(100)Description of the recognized event type
Tablesraw_ingestion_recordsallowed_event_types
Interviewer

Your question is Handling Missing Data During Ingestion. 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.