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.

MediumTechnical
39 practiced

Describe how to model one-to-many and many-to-many relationships in a relational database and in a document-oriented NoSQL store such as MongoDB. Provide short schema sketches for both and explain how read and write access patterns influence whether you embed related data or reference it.

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
37 practiced

Given this table definition (Postgres-like):

users(user_id INT PRIMARY KEY, signup_date VARCHAR(10), last_active TIMESTAMP, is_premium CHAR(1), lifetime_value NUMERIC(10,2))

Explain the potential issues with these datatype choices for analytics, list validations you would run before analysis, and recommend datatype changes or transformations you would apply before building dashboards.

MediumTechnical
41 practiced

You have a fact table that is heavily used for aggregations by customer and product. Query profiling shows many slow GROUP BY queries. Propose schema-level and physical-design changes to speed up aggregation queries without significantly increasing write latency.

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.

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.