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
SQL and Preprocessing Practice
00:00
5 left

SQL and Preprocessing Practice

MediumSQL · PostgreSQL

Problem

Describe how you would approach a SQL and data preprocessing problem to produce a reliable dataset for analysis at Zillow.

Use the provided Zillow listing and event data to return valid listings as of January 31, 2025. Exclude records with missing or invalid core attributes, select the latest event available by the cutoff, and retain listings whose latest status is ACTIVE or PENDING.

Output

  1. One row per qualifying listing with listing_id, city, state, list_price, bedrooms, latest_status, latest_event_at, and days_on_market.
  2. Sort by city ascending, then listing_id ascending.

Schema

listings
ColumnTypeDescription
listing_idPKINTUnique Zillow listing identifier
cityVARCHAR(100)Listing city, potentially blank or padded
stateCHAR(2)Two-letter state code
list_priceDECIMAL(12,2)Current listing price
bedroomsINTNumber of bedrooms
listed_atDATEDate the listing entered the market
listing_events
ColumnTypeDescription
event_idPKINTUnique listing event identifier
listing_idINTReferenced listing identifier
event_typeVARCHAR(20)Listing status event
event_atTIMESTAMPTime the status event occurred
ingested_atTIMESTAMPTime the event was loaded into the warehouse
Tableslistingslisting_events
Interviewer

Your question is SQL and Preprocessing Practice. 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.