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.

HardSystem Design
34 practiced

Design an indexing strategy for a star-schema data warehouse: a 1 billion-row fact table (sales) joined to dimension tables (product, store, date). Typical queries compute time-range totals by product category and store. What would you index, and what alternatives to a traditional B-tree index would you consider at this scale?

HardTechnical
39 practiced

Discuss when you would use a clustered columnstore index versus a nonclustered columnstore index in SQL Server for a large analytical fact table that receives frequent micro-batch loads. Explain how the delta store and tuple-mover affect query and load performance, and how you would structure data loads to minimize fragmentation.

HardTechnical
41 practiced

Discuss how secondary indexes are implemented in distributed NewSQL systems like CockroachDB or Spanner. Explain transaction implications, read/write amplification, how index-maintenance is coordinated across nodes, and the effect on latency for multi-region writes.

HardTechnical
43 practiced

Explain the different index types relevant to analytical systems: B-tree, bitmap, inverted, and zone map indexes. For each index type, describe how it works at a high level, what query patterns it accelerates, and which storage engines (row or columnar) make best use of it.

HardSystem Design
67 practiced

You're building on a NoSQL key-value store that has no native secondary-index feature, and the application needs to look up records efficiently by an attribute other than the primary key. Design an indexing approach that supports this at scale, and explain the consistency, write-amplification, and hot-key risks your design introduces as write volume grows.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.