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.
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?
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.
A data pipeline writes to a warehouse where fact and dimension tables are stored in a columnar format. The team needs to support fast lookups of a small subset of rows (point selects) as well as large scans. What schema and physical design choices reduce latency for point selects without harming scan performance?
You have an orders table with product_name stored on each order row, resulting in repeated values and inconsistent product naming. Explain the normalization steps needed to bring this to 3NF or BCNF, and then describe scenarios in reporting where you might intentionally denormalize product fields back into a reporting table for performance.
Design a relational schema for a university course-enrollment system where students can enroll in many courses and courses can have many students. Each enrollment must record an enrollment_date and a grade. Describe the tables (an ERD in words) and the key columns, including a uniqueness constraint to prevent duplicate enrollments, and describe indexes you'd add for scale (assume roughly 10 million enrollments).
Unlock Full Question Bank
Get access to all Data Modeling and Schema Design interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.