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

Given this simple schema for product reviews:

reviews(review_id, product_id, user_id, rating, comment, created_at)

A customer asks for a leaderboard of top 10 products by average rating in the last 30 days. Propose schema-level changes or indexes to make this query fast under heavy write load, explaining your choices.

MediumSystem Design
52 practiced

Design a schema to store customer addresses that supports: a current-address lookup, a historical audit of changes with timestamps, queries like 'what was the address at time T', and efficient deletion and retention. Propose the table(s), primary keys, and indexing strategy, and explain the trade-offs related to storage and query cost.

HardTechnical
43 practiced

A BI team reports that joins between a large fact table and a high-cardinality dimension table are causing memory pressure on the analytic cluster. Propose schema-level and engine-level mitigations to reduce memory usage for large joins.

EasyTechnical
37 practiced

Given this table definition (Postgres-like):

users(user_id INT PRIMARY KEY, signup_date VARCHAR(10), last_active TIMESTAMP, is_premium CHAR(1), lifetime_value NUMERIC(10,2))

Explain the potential issues with these datatype choices for analytics, list validations you would run before analysis, and recommend datatype changes or transformations you would apply before building dashboards.

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.