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
Clean and Transform Unstructured Datasets
00:00
5 left

Clean and Transform Unstructured Datasets

MediumSQL · PostgreSQL

Problem

Tell me about how you would clean and transform a set of unstructured datasets using SQL or Pandas within a strict time limit.

Use the provided raw trade reports and instrument reference data. Return only valid, completed trades after normalizing dates, symbols, sides, quantities, and prices. Rows with an invalid or NULL date, blank or unknown symbol, non-positive quantity, negative price, or unsupported status must be ignored.

Output

  1. One row per retained trade with report_id, trade_date, symbol, instrument_name, side, quantity, and price
  2. Sort by trade_date ascending, then report_id ascending

Schema

raw_trade_reports
ColumnTypeDescription
report_idPKINTEGERUnique raw trade report identifier
reported_at_textVARCHAR(40)Trade date in an inconsistent text format
symbol_textVARCHAR(40)Raw instrument symbol
quantity_textVARCHAR(40)Raw quantity with possible punctuation or units
price_textVARCHAR(40)Raw price with possible currency text
side_textVARCHAR(20)Raw buy or sell designation
status_textVARCHAR(20)Raw execution status
instrument_reference
ColumnTypeDescription
symbolPKVARCHAR(20)Canonical instrument symbol
instrument_nameVARCHAR(80)Canonical instrument name
Tablesraw_trade_reportsinstrument_reference
Interviewer

Your question is Clean and Transform Unstructured 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.