December Code

DBMS · 11 topic pages · 85 questions in the bank

DBMS for placements: interview questions by topic

DBMS questions are the theory behind the SQL you write in the same interview. Keys first — candidate, primary, foreign, and why a table can have many candidates but one primary. Then normalization, which is really a question about functional dependencies: which column determines which, and what goes wrong when a fact is stored twice. Transactions and ACID follow, with the follow-up that separates memorised from understood: what does each isolation level allow, and what does a lock actually protect?

Indexing comes up as 'why is this query slow' and 'when does an index make things worse'. The ER model and relational algebra appear in first rounds and university-style tests; SQL vs NoSQL and the CAP theorem appear when the interviewer has a system-design round in mind. Joins and views are asked here too, and they are answered on the SQL pages so nothing is said twice.

Each page below covers one topic: the questions that are asked, the answers with worked examples, and one question exactly as the diagnostic asks it. The diagnostic draws from every DBMS topic in the bank and names the ones to read first.

New to this? How to prepare for placements — the method — and what the readiness test measures.

DBMS topics, one page each

dbms/11 of 14 topics have a page · the diagnostic draws from all 14
  1. Normalization interview questionsWhat each normal form requires, the anomalies it removes, partial and transitive dependencies, 3NF vs BCNF worked out, when to denormalize — answered.
  2. Transactions and ACID interview questionsACID with examples, isolation levels and their anomalies, write-ahead logging, deadlocks, optimistic vs pessimistic locking — DBMS questions answered.
  3. Database indexing interview questionsWhat an index costs, clustered vs non-clustered, B-tree vs hash, the leftmost-prefix rule, covering indexes, why an index is ignored, selectivity.
  4. Keys in DBMS interview questionsSuper, candidate, primary, alternate and foreign keys, primary key vs UNIQUE, composite and surrogate keys, candidate keys from FDs — answered.
  5. ER model and ER diagram interview questionsEntities, attributes and relationships, weak entities, cardinality and participation, mapping 1:N and M:N to tables, ISA hierarchies, ternary.
  6. SQL vs NoSQL interview questionsRelational vs NoSQL: schema, the four NoSQL families, scaling up vs out, transactions, embed vs reference, when NoSQL is the wrong choice.
  7. CAP theorem interview questionsWhat C, A and P mean, why partition tolerance is not optional, CP vs AP with examples, eventual consistency, what CAP does not say, PACELC.
  8. Relational algebra interview questionsSelection vs projection, the six basic operators, natural and theta joins, set difference, division for "all" queries, the SQL equivalents.
  9. Functional dependencies interview questionsWhat X → Y means, trivial FDs, Armstrong's axioms, attribute closure, checking an FD against data, canonical cover, lossless-join decomposition, 4NF.
  10. Concurrency control interview questionsLost updates and dirty reads, serializability, shared vs exclusive locks, two-phase locking, deadlock prevention and detection, timestamp ordering, MVCC.
  11. Denormalization interview questionsDenormalization after normalization: when it pays, the techniques, keeping copies consistent, counters under concurrency, warehouses and documents.

One question, exactly as the diagnostic asks it

From the DBMS bank — 85 questions across 14 topics. The answer is marked because this one is public; in a sitting you choose first, then see why each option is right or wrong.

Normalization · easyDBMS-003

A relation is said to be in First Normal Form (1NF) when which condition holds?

  1. 1Every non-key attribute is fully functionally dependent on the whole primary key, so that no attribute depends on only part of a composite key
  2. 2Every determinant in the relation is a candidate key
  3. 3Every attribute contains only atomic (indivisible) values, with no repeating groups or multi-valued attributescorrect
  4. 4There are no transitive dependencies between non-key attributes

1NF requires atomic values in every cell, eliminating repeating groups or lists stored in a single field. The full-dependency option describes 2NF, the no-transitive-dependency option describes 3NF, and the determinant option describes BCNF, all of which are stronger, later normal forms.

More on this topic: Normalization interview questions

Measure it

Reading the answers tells you what’s true. A diagnostic tells you what you get wrong.

10 DBMS questions across its topics, easy to hard, about fifteen minutes. You get a readiness figure with the arithmetic shown, the topics you missed named, and a practice set sized for today. Free: a diagnostic in every subject, a retake a month and 15 problems a day. No card.

By Harshit · updated