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
Analyzing Trends with Incomplete Data
00:00
5 left

Analyzing Trends with Incomplete Data

MediumSQL · PostgreSQL

Problem

How would you approach a situation where you are given an incomplete dataset to analyze a market trend at Smbc Group?

Use the provided market universe, reporting periods, and observations to produce a monthly view that makes missing coverage visible rather than silently excluding it.

Output

  1. One row per market and reporting month from reporting_periods.
  2. Return market_name, month_start, observed_instruments, expected_instruments, coverage_pct, average_close, and monthly_change_pct.
  3. Include periods with no observations, order by market and month, and round percentages and averages to two decimals.

Schema

market_universe
ColumnTypeDescription
market_namePKVARCHAR(50)Market or exchange name
instrument_idPKVARCHAR(20)Instrument identifier
instrument_nameVARCHAR(100)Instrument display name
reporting_periods
ColumnTypeDescription
market_namePKVARCHAR(50)Market being reported
month_startPKDATEFirst day of the reporting month
expected_instrumentsINTNumber of instruments expected for the period
market_observations
ColumnTypeDescription
observation_idPKINTObservation identifier
market_nameVARCHAR(50)Market associated with the observation
instrument_idVARCHAR(20)Observed instrument identifier
observation_dateDATEDate of the market observation
close_valueDECIMAL(12,2)Observed closing value
Tablesmarket_universereporting_periodsmarket_observations
Interviewer

Whenever you're ready, walk me through your approach or go straight to the code. The requirements and the three 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.