BACKEND & DATA30 questions • 3 levels • ~12 min

Database Indexing Interview Quiz

Select level:

30 technical questions on B-Tree index internals, composite indexes, covering indexes, scans, and optimization in PostgreSQL and MySQL.

B-Tree StructureSequential Scan vs Index ScanUnique IndexesWrite OverheadLeftmost Prefix RuleCovering Indexes

What the Database Indexing interview quiz covers

This quiz takes a deep look at database indexing mechanics: B-Tree internals, leaf node traversal, write vs read performance trade-offs, and column cardinality.

It also tests your mastery of composite indexes (leftmost prefix rule), covering indexes, partial indexes, expression indexes, and reading EXPLAIN ANALYZE execution plans.

Difficulty levels

Beginner focuses on B-Tree fundamentals, write amplification on indexed tables, selectivity, and primary vs secondary index types.

Intermediate covers composite indexes, leftmost prefix matching, covering indexes using INCLUDE clauses, and partial indexing.

Advanced tests index-backed sorting, index bloat remediation, cost-based optimizer heuristics, and interpreting EXPLAIN ANALYZE execution nodes.

Question topics covered

  • B-Tree internals: branching factor, root, internal, and leaf pages
  • The leftmost prefix rule for composite indexes
  • Covering indexes and eliminating heap fetches
  • Partial indexes for skewed or status-flag columns
  • Expression indexes on computed values (LOWER, DATE_TRUNC)
  • Query execution plan analysis with EXPLAIN and EXPLAIN ANALYZE

How to use the Database Indexing quiz

  1. Select your difficulty level or tackle all 30 questions.
  2. Carefully analyze the query plan snippets before picking your answer.
  3. Read the comprehensive explanations to prevent anti-patterns in production.

Frequently asked questions about the Database Indexing quiz

There are 30 questions in total: 10 Beginner, 10 Intermediate, and 10 Advanced, randomized every run.

Deepen your interview prep with other essential topics tested in engineering interviews.