98 questions in 9 topics
DBMS Basics Interview Questions
The basics: what a DBMS is, DBMS vs RDBMS, the three-schema architecture, SQL command types, views, NULL and joins.
- What is a DBMS?
- What are the disadvantages of a file system compared to a DBMS?
- What is the difference between DBMS and RDBMS?
- What is the three-schema architecture of a DBMS?
Keys and Constraints in DBMS Interview Questions
Super, candidate, primary, foreign and composite keys, and the constraints that keep data valid.
- What are the different types of keys in DBMS?
- What is the difference between a primary key and a unique key?
- What is the difference between a super key and a candidate key?
- What is a composite key, and when do you need one?
Normalization in DBMS Interview Questions
Functional dependencies, anomalies, 1NF to 5NF with examples, finding candidate keys, and when to denormalize.
- What is normalization, and why is it needed?
- What are insertion, update and deletion anomalies?
- What happens if you change a department's city in only one employee's row?
- What is 1NF? Give an example of a table that breaks it.
Transactions and ACID Properties in DBMS Interview Questions
Transactions, ACID, rollbacks and savepoints run live, transaction states, serializability and recovery logs.
- What is a transaction in DBMS?
- What are the ACID properties?
- What is left after two updates and a
ROLLBACK? - What does
ROLLBACK TOa savepoint undo before theCOMMIT?
Concurrency Control and Locking in DBMS Interview Questions
Concurrency anomalies, isolation levels, shared and exclusive locks, two-phase locking, deadlocks, optimistic locking and MVCC.
- What problems can happen when transactions run concurrently?
- What are the transaction isolation levels?
- What is the difference between shared and exclusive locks?
- What is two-phase locking (2PL)?
Indexing in DBMS Interview Questions
B+ trees, clustered and non-clustered indexes, composite column order, covering indexes, and why an index gets skipped.
- What is an index in a database, and how does it speed up queries?
- Why not index every column?
- What is the difference between a B tree and a B+ tree, and why do databases use B+ trees?
- What is the difference between a clustered and a non-clustered index?
ER Model and ER Diagram Interview Questions
Entities, attributes, relationships, weak entities, cardinality and participation, generalization, and mapping a diagram to tables.
- What is an ER model, and what does an ER diagram show?
- What are the types of attributes in an ER model?
- What are cardinality ratios and participation constraints in an ER diagram?
- What is a weak entity? Give an example and show its table.
SQL vs NoSQL Interview Questions
Relational vs NoSQL, the four NoSQL families, CAP and BASE, sharding and replication, and JSON in SQL.
- What is the difference between SQL and NoSQL databases?
- What are the types of NoSQL databases?
- What is the CAP theorem?
- What is BASE, and how does it compare to ACID?
Advanced DBMS Interview Questions
Key generation, idempotent writes, pagination, join algorithms, query tuning, replication lag, SQL injection and migrations.
- Does SQLite reuse a deleted id, with and without
AUTOINCREMENT? - What happens when a payment with the same idempotency key is retried?
- Why is OFFSET pagination slow on large tables, and what is the alternative?
- What join algorithms does a database use, and when does it pick each?
Frequently Asked Questions
How should I prepare for a DBMS interview?
Go topic by topic: keys, normalization, transactions and ACID, isolation and locking, indexing, the ER model, then SQL vs NoSQL. For each, know a definition, a small example and its trap, and run the SQL. Practise joins and GROUP BY on the SQL interview questions page.
Which DBMS topics are most important for freshers and campus placements?
Keys, normalization up to BCNF, ACID, DELETE vs TRUNCATE vs DROP, DBMS vs RDBMS, ER diagrams and basic indexing. Written tests also ask for candidate keys from functional dependencies, so practise attribute closure until it takes under a minute.
What do interviewers ask experienced candidates about databases?
Production more than theory: a slow query you fixed, isolation anomalies you hit, deadlocks and retries, index design, migrations without downtime and replication lag. Know how your engine differs from the textbook in defaults and locking.
Do I need data structures and algorithms for a DBMS interview?
Some. Indexes are B+ trees and hash tables, deadlock detection is cycle detection in a graph, and joins use nested loops, hashing and merging. Coding rounds still test DSA directly, so practise arrays, hashing, trees and graphs too.
How long does it take to prepare DBMS for interviews?
One to two weeks at an hour a day if you studied it in college. From zero, plan three to four weeks, the first two on SQL, since normalization and transactions make more sense once you can write the queries.