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.

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.

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.

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?

MediumTechnical
38 practiced

Describe how you would model and index time series sensor data with high write throughput and queries that need both range scans and fast retrieval of the latest value per sensor. Include schema columns, primary key choices, and retention strategies.

EasyTechnical
29 practiced

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 Continue

Join thousands of developers preparing for their dream job.