gitGood.dev

Database Interview Questions

Test your knowledge of relational and NoSQL databases. Practice questions on SQL, indexing, normalization, transactions, and database design.

49
Total Questions
10
Easy
29
Medium
10
Hard
Showing 1-20 of 49 questionsPage 1 of 3
Sign up to start practicing these questionsSign up free →
ACID Properties
QuizEasy
Database Indexing
QuizMedium
NoSQL Database Selection
QuizMedium
Transaction Isolation Levels
QuizHard
Database Normalization
QuizMedium
Database Replication
QuizHard
SQL Join Types
QuizEasy
Query Optimization
QuizHard
SQL Injection Prevention
QuizEasy
Password Storage
QuizMedium
MVCC in Databases
QuizHard
Database Connection Pooling
QuizMedium
Eventual Consistency
QuizMedium
What is a Primary Key?
QuizEasy
What is a Foreign Key?
QuizEasy
SQL vs NoSQL Overview
QuizEasy
What is an Index?
QuizEasy
Query Optimization
QuizMedium
Database Normalization
QuizMedium
Connection Pooling
QuizMedium

Frequently Asked Questions

Should I learn SQL or NoSQL for interviews?

Both. SQL databases (PostgreSQL, MySQL) are essential for understanding relational data, joins, and ACID transactions. NoSQL databases (DynamoDB, MongoDB, Redis) are important for system design questions involving scale, caching, and flexible schemas.

What database concepts are tested in interviews?

Common topics include SQL queries and joins, indexing strategies (B-tree, hash), normalization forms, ACID properties, transaction isolation levels, database sharding, replication, and choosing between SQL vs NoSQL for different use cases.

What is database indexing and why does it matter?

Indexes are data structures (usually B-trees) that speed up queries by avoiding full table scans. They trade write performance and storage for faster reads. Knowing when to add indexes, composite indexes, and covering indexes is a common interview topic.

What are the ACID properties?

ACID stands for Atomicity (transactions are all-or-nothing), Consistency (data stays valid), Isolation (concurrent transactions don't interfere), and Durability (committed data survives crashes). Understanding ACID is fundamental for database interview questions.

How does database sharding work?

Sharding splits data across multiple database instances based on a shard key (e.g., user ID). It enables horizontal scaling but introduces complexity around cross-shard queries, rebalancing, and maintaining consistency. This is a frequent system design interview topic.

What is the difference between horizontal and vertical scaling for databases?

Vertical scaling (scaling up) adds more CPU/RAM to a single server. Horizontal scaling (scaling out) adds more servers. Vertical has limits and a single point of failure. Horizontal is more complex but offers better fault tolerance and capacity. Most large-scale systems use horizontal scaling.

Explore Other Categories