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
Designing a Data Warehouse
00:00
5 left

Designing a Data Warehouse

HardSQL · PostgreSQL

Problem

What considerations would you take into account when designing a data warehouse for Binance?

For this hands-on exercise, use the provided Binance-style dimension and fact tables to produce a warehouse-ready asset summary for a UTC reporting period. Include active assets with no qualifying trades.

Output

  1. One row per active asset, including assets without qualifying trades.
  2. Return symbol, quote_asset, total_quote_volume, completed_trade_count, unique_buyers, unique_sellers, and average_execution_price.
  3. Include only completed spot trades from 2025-01-01 inclusive through 2025-01-04 exclusive.
  4. Order by symbol ascending, then asset_id ascending.

Schema

assets
ColumnTypeDescription
asset_idPKINTSurrogate identifier for the asset dimension
symbolVARCHAR(20)Asset trading symbol
quote_assetVARCHAR(20)Quote currency used for reporting volume
is_activeBOOLEANWhether the asset is currently active
spot_trades
ColumnTypeDescription
trade_idPKBIGINTUnique spot trade identifier
asset_idINTReferenced asset dimension key
buyer_idBIGINTBuyer account identifier
seller_idBIGINTSeller account identifier
quote_volumeNUMERIC(24,8)Trade value in the quote asset
execution_priceNUMERIC(24,8)Executed price in quote currency
executed_atTIMESTAMPUTC trade execution timestamp
statusVARCHAR(20)Trade lifecycle status
trade_typeVARCHAR(20)Trade market type
Tablesassetsspot_trades
Interviewer

Your question is Designing a Data Warehouse. 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.