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

Sales Reporting Star Schema Design

MediumSQL & Data Manipulation00:00
Practice interviewer
In session
5 left
00:00

Your question is Sales Reporting Star Schema Design. Take a moment with it on the right.

Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).

You need to log in / sign up to chat or submit.

Problem

Context

You’re joining the data platform team at a global e-commerce marketplace processing 10M+ orders/day across web and mobile. Finance and Sales Ops rely on a curated sales reporting layer for daily revenue, discounts, returns, and margin reporting by product category, region, and sales channel. The current operational schema is highly normalized and optimized for writes, but analysts are struggling with slow queries and inconsistent definitions (e.g., “net sales” vs “gross sales”).

Core Question

Design a data model (tables + keys + relationships) for a sales reporting system that supports common analytics queries such as:

  • Daily/weekly/monthly revenue and units sold
  • Revenue by product category, brand, and region
  • Sales by channel (web/app/partner), campaign, and sales rep
  • Net sales after discounts, refunds, and returns

In your answer, explain:

  1. Which tables you would create (fact vs dimension) and what each table represents.
  2. Primary keys and foreign keys for each table, including whether you’d use surrogate keys vs natural keys.
  3. The grain of your fact table(s) (e.g., order-level vs line-item-level) and why.
  4. How you would model slowly changing attributes (e.g., customer region changes, product category reclassification).
  5. How you would handle returns/refunds and discount allocation (line-level vs order-level) so that finance metrics reconcile.

Scope Guidance (what a strong answer includes)

  • A clear statement of the grain and how it prevents double counting in joins/aggregations.
  • A star schema (or snowflake where justified) with explicit 1-to-many and many-to-1 relationships.
  • Concrete key choices (surrogate integer keys, unique constraints on natural identifiers, composite keys where appropriate).
  • Practical considerations: late-arriving dimensions, deduplication, and how the model supports performant joins for BI tools.