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.

HardTechnical
30 practiced

Propose schema patterns to add auditing and change-tracking to tables for traceability. What columns and structures would you add to capture who changed a row and when, and what approach would you use for row-level history: a separate audit table, database-level change data capture, or an append-only pattern? Discuss the queryability and performance trade-offs of each history-tracking approach.

MediumTechnical
35 practiced

Discuss schema-first (normalized) versus query-driven, denormalized modeling for a microservice that must support ad-hoc queries from downstream analytics teams. Recommend an approach and explain how you would balance developer productivity, query performance, and maintainability.

HardSystem Design
39 practiced

Design an events table for event-sourcing in PostgreSQL with columns such as event_id, aggregate_id, sequence_num, event_type, payload, and created_at. Explain how you would enforce event ordering per aggregate, implement snapshotting to speed up reads, handle event-schema evolution, and compact or archive old events while preserving auditability.

EasyTechnical
33 practiced

Consider this order_items table definition:

order_items(order_id INT, product_id INT, quantity INT, price NUMERIC)

where the combination (order_id, product_id) forms the logical primary key. Explain how composite primary keys work, demonstrate how you'd join this table to orders and products, and describe when you might prefer adding a surrogate key (order_item_id) instead.

EasyTechnical
36 practiced

What are the primary components of an entity-relationship (ER) model? Describe entities, attributes, relationships, cardinality, and weak entities, and explain how an ER diagram maps to a normalized relational schema.

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.