InterviewStack.io LogoInterviewStack.io

Dimensional Modeling and Schema Design Questions

Designing analytical schemas: star and snowflake schemas, fact and dimension tables, grain selection, slowly changing dimensions, and normalization vs denormalization for analytics. Covers modeling business requirements into queryable structures and schema design for large datasets. The data-modeling backbone of BI and warehouse work.

HardTechnical
31 practiced

Compute cohort retention: for each acquisition month, the percentage of users who returned in each subsequent month, using events_fact(user_key, event_date_key, event_type). Write SQL that returns a cohort table with months 0 through 6 as columns, and account for the fact that a user's dimension attributes (such as acquisition source) can change over time under Slowly Changing Dimensions, so the cohort assignment must use the attribute value that was correct at acquisition time, not the current value.

MediumTechnical
59 practiced

Explain the accumulating snapshot fact table pattern: one row per process instance, updated in place as it passes through milestones (for example order_id, created_date, shipped_date, delivered_date, status, and measures). Describe when it is appropriate, and how you would use it to report on time-to-fulfillment and funnel conversion.

MediumTechnical
32 practiced

For reporting daily account balances (an end-of-day balance per account), explain why a periodic snapshot fact table is generally preferred over deriving the balance from transactional facts at query time. Describe how you would build and store the daily snapshot table, including partitioning and load strategy.

MediumTechnical
33 practiced

A global business stores event timestamps in UTC, but stakeholders want dashboards reported in local business time (per country or per user). Describe how you would model the date/time dimension and the facts to support local-time reporting and time-zone-aware aggregation, while avoiding double-counting or dropping events across daylight-saving transitions and date boundaries.

HardTechnical
37 practiced

You need to report an SLA breach rate where the SLA is a condition evaluated over events (for example, an approval must occur within 48 hours of a request), and there is no numeric measure on the underlying events. Design a factless fact table and supporting dimensions for this, and write an example SQL query to compute the monthly SLA breach percentage.

Unlock Full Question Bank

Get access to all 48 Dimensional Modeling and Schema Design interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.