Indexing Strategy and Design Questions

Choosing and designing indexes: B-tree, hash, composite, covering, partial, and full-text/inverted indexes, and the trade-offs between read acceleration and write/storage overhead. Covers selecting index columns from query patterns, cardinality and selectivity reasoning, diagnosing why an index is or is not used, and index maintenance: rebuilding or reorganizing a fragmented index, finding and dropping redundant or unused indexes, and rolling out a new index to production safely. Also covers indexing in analytical (bitmap, columnar), partitioned, and distributed/NoSQL systems. Central to database performance interviews.

MediumTechnical
45 practiced

Explain how database statistics and histograms influence the optimizer's choice of index or join order. How would you diagnose and fix a query that does a full table scan due to stale or absent statistics?

MediumTechnical
33 practiced

Many single-column indexes exist on a high-write table causing heavy write amplification. Propose a methodology to decide which indexes to consolidate into composite or covering indexes and which to drop. Include metrics and safety checks for a non-production rollout.

MediumTechnical
31 practiced

You observe index-only scans are not occurring even though a covering index exists on the table. What could cause this, and what would you check or change to get index-only scans happening in Postgres?

EasyTechnical
43 practiced

Explain the difference between an index scan (index seek) and a sequential scan. Given an example query that filters on a non-indexed column and takes 30s, how would you explain to a non-technical stakeholder why adding an index might reduce report latency?

HardSystem Design
40 practiced

You need to support substring search over a product description column for user-entered queries (contains). For a large dataset, design an indexing strategy (trigram, full-text, inverted index) and explain how you'd maintain indexes during frequent writes. Include trade-offs.

Unlock Full Question Bank

Get access to all Indexing Strategy and Design interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.