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.
What is the grain of a fact table and why must you declare it before naming a single dimension? Give three concrete grain examples at different levels (for instance, one row per order line item, one row per order, and one row per daily account snapshot), and explain how the chosen grain drives your join logic, aggregation rules, storage volume, and which dashboards the table can support.
Compare strategies for generating surrogate keys in a distributed or parallel ingestion system where multiple workers insert into the same dimension: central database sequences, UUIDv4, deterministic hash-based keys derived from the natural key, and a centralized key-generation service. Discuss uniqueness guarantees, join performance, collision risk, and behavior under cross-region or multi-writer concurrency.
What is a junk dimension, and when would you use one? Describe how you would implement a junk dimension that consolidates several low-cardinality flags and indicators (for example is_gift, is_first_time_customer, and coupon_code_present) into a single dimension table instead of leaving them as separate columns or tiny dimensions.
How do you handle a fact row whose foreign key points to a dimension member that does not exist yet, or where the natural key resolves to NULL (a missing or late-arriving dimension)? Describe the 'unknown member' surrogate-row pattern, at least one alternative (deferred FK resolution via staging and backfill, or a placeholder row updated in place later), and the downstream effect each choice has on dashboard filtering and KPI totals.
What is a degenerate dimension? Give an example from an order-processing pipeline (such as an order number with no corresponding dimension table), and explain why you would choose to keep an attribute as a degenerate dimension on the fact table rather than moving it into its own dimension table.
Unlock Full Question Bank
Get access to all 19 Dimensional Modeling and Schema Design interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.