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.
What is a star schema and how does it differ from a snowflake schema? List one advantage and one disadvantage of each.
For an on-demand food-delivery platform, list the primary entities and relationships for a conceptual data model that supports ordering and delivery. Include entities such as Orders, Customers, Restaurants, Menus, MenuItems, Drivers, Deliveries, Payments, Addresses, Promotions, and Logs. For each entity, list 5-8 core attributes and specify the cardinalities (one-to-many, many-to-many) between key entities. State your assumptions about timestamps, soft deletes, and versioning needed for the business logic.
Explain primary keys, surrogate keys, and natural keys. When designing schemas for customers and orders in a large OLTP system, when would you choose a surrogate key (auto-increment bigint or UUID) versus a natural key (email, national ID)? Discuss trade-offs: uniqueness guarantees, join performance, index size, replication/merge complexity, human-readability, and give examples where each is appropriate.
You're storing semi-structured product metadata. Discuss the pros and cons of using a JSON column in PostgreSQL versus fully normalizing the attributes into relational columns and tables. Address queryability, indexing, schema evolution, and storage.
You must design a backup/recovery-friendly schema for a large transactional service where some tables must be restorable to a point in time independently (e.g., payments). What schema patterns and DB features help enable per-domain point-in-time recovery with minimal restore time?
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.