InterviewStack.io LogoInterviewStack.io

Relational Database Fundamentals and Design Questions

Core concepts of relational databases and schema design including tables, relationships such as one to one one to many and many to many, primary keys and foreign keys, data integrity constraints, and the properties of atomicity consistency isolation and durability and why they matter. Understand differences between relational systems using structured query language and nonrelational databases, indexing strategies, normalization and denormalization trade offs, simple query optimization techniques, and when to choose a normalized relational design versus a document or key value store. Candidates should be able to perform basic entity identification, produce simple schema diagrams, explain persistence and durability considerations, and reason about basic performance and scaling trade offs.

MediumTechnical
22 practiced
Write a SQL query using window functions to compute each user's average session length per calendar month and then return the top 5 users per month by average session length. Given table:
sql
sessions(user_id INT, session_id UUID, start_ts TIMESTAMP, end_ts TIMESTAMP)
Use PostgreSQL syntax and explain partitioning and ordering choices.
EasyTechnical
20 practiced
For a simple messaging application, explain when you would choose a relational database versus a document store or key-value store. Consider requirements like transactional guarantees, flexible schema, query complexity (searching messages by content, by user, by time), scaling, and cost.
EasyTechnical
21 practiced
Explain normalization: 1NF, 2NF, 3NF (and mention BCNF). For each normal form give a short example of a table that violates it and show the normalized schema. Explain the practical reasons for normalizing and situations where you might stop before BCNF in production.
HardTechnical
25 practiced
Explain how Multi-Version Concurrency Control (MVCC) works internally and how snapshot isolation differs from true serializability. Describe an example of a write-skew anomaly and how you would prevent it in a DBMS that provides snapshot isolation.
MediumSystem Design
22 practiced
Design a schema for user notifications where users can have zero or many notifications. The system should support marking notifications read/unread, fetching the latest N notifications, and fast unread counts. Explain table layout, indexes, and strategies to keep unread counters efficient at scale.

Unlock Full Question Bank

Get access to hundreds of Relational Database Fundamentals and Design interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.