InterviewStack.io LogoInterviewStack.io

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

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.

MediumTechnical
51 practiced

A 'created_at' column is currently stored as TIMESTAMP WITHOUT TIME ZONE. Describe the risks when analyzing data across multiple regions, how you'd normalize timestamps for analysis, and whether you would change the schema or enforce UTC at ingestion. Include a brief SQL example for the Postgres conversion.

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.

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?

EasyTechnical
32 practiced

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.

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.