Data Modeling and Schema Design Questions

Designing relational schemas end to end: entity-relationship modeling, normal forms and deliberate denormalization, primary/foreign keys, data types, and integrity constraints, together with applied schema design driven by real business requirements and query access patterns. Covers modeling a domain from ambiguous requirements, choosing structures that serve the queries a system must run, trading normalization for correctness against denormalization for read performance, and evolving schemas as needs change. Foundational data-modeling judgment for building and reviewing databases, tested through open-ended domain-modeling prompts.

EasyTechnical
30 practiced

Discuss foreign-key ON DELETE / ON UPDATE actions (CASCADE, SET NULL, RESTRICT / NO ACTION). Give example scenarios (for example users to orders) for when each action is appropriate, and the operational considerations (performance, accidental deletions, cascading deletes across large trees). How do you prevent accidental mass deletes caused by cascading rules?

HardSystem Design
62 practiced

Design an audit/change-log schema that lets you reconstruct any customer record's exact state as of a past point in time, for compliance investigations and debugging. Decide what each change-log entry needs to capture to make that reconstruction possible, propose the indexing needed to support lookups by entity and time range efficiently, and write an example query that reconstructs the state as of a given timestamp.

MediumSystem Design
31 practiced

Design an event table schema suitable for session analysis, funnels, and attribution for a website or product analytics team. List the columns with suggested types, indicate the primary key, suggest a partitioning strategy, and name any indexes or clustering you'd recommend for the common queries.

HardTechnical
32 practiced

You inherit a reporting system where two seemingly identical dashboards show different total revenue: one query multiplies quantity by price after joining product tables, while the other sums a precomputed line_total. Given the two queries and schemas, identify the likely root causes (wrong grain, join duplication, a late filter) and propose schema and ETL fixes to make the metrics consistent across dashboards.

EasyTechnical
36 practiced

Define grain in dimensional modeling. Provide three examples of different fact table grains for an online retail business and explain one practical consequence of choosing a too-coarse or too-fine grain.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.