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 in Logistics
00:00
5 left

Handling Missing Data in Logistics

MediumSQL · PostgreSQL

Problem

Tell me about how you handle missing or inconsistent data when building a logistics model for Deloitte's client projects.

Write a SQL query that audits shipment records against carrier reference data. Identify missing values, invalid carrier references, invalid statuses, date inconsistencies, and non-positive or incomplete weight values.

Output

  1. One row per shipment from shipment_records
  2. Columns: shipment_id, client_reference, carrier_name, quality_status, issue_count, and issue_types
  3. Include all shipments, label records with issues as Needs Review, and sort by shipment_id ascending

Schema

shipment_records
ColumnTypeDescription
shipment_idPKINTUnique shipment identifier
client_referenceVARCHAR(30)Client-provided shipment reference
carrier_codeVARCHAR(10)Carrier code recorded on the shipment
planned_delivery_dateDATEPlanned delivery date
actual_delivery_dateDATERecorded delivery date
statusVARCHAR(20)Shipment lifecycle status
expected_weight_kgDECIMAL(10,2)Expected shipment weight in kilograms
actual_weight_kgDECIMAL(10,2)Measured shipment weight in kilograms
carrier_reference
ColumnTypeDescription
carrier_codePKVARCHAR(10)Unique carrier code
carrier_nameVARCHAR(80)Carrier display name
is_activeBOOLEANWhether the carrier is currently active
Tablesshipment_recordscarrier_reference
Interviewer

Whenever you're ready, walk me through your approach or go straight to the code. The requirements and the two tables are in the Question tab.

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.