InterviewStack.io LogoInterviewStack.io

Indexing Strategy and Selection Questions

Covers index design principles and practical selection of indexes to accelerate queries while managing storage and write cost. Topics include index types such as B tree hash and bitmap indexes and full text and functional indexes; single column composite and covering indexes; clustered versus nonclustered index architectures and partial or filtered indexes. Candidates should reason about index selectivity and cardinality and how statistics and histograms influence optimizer choices. Also assess index maintenance overhead fragmentation and rebuild strategies and the trade off between faster reads and slower inserts updates and deletes. Practical skills include reading execution plans to identify missing or inefficient indexes proposing index consolidation or covering index designs testing and benchmarking index changes and understanding interactions between indexing partitioning and denormalization.

HardTechnical
53 practiced
For a PostGIS-enabled table storing geospatial points, write the SQL to create an index to support nearest-neighbor (KNN) queries and spatial joins. Include SRID considerations and the appropriate GiST / SP-GiST operator class and explain why it improves performance.
EasyTechnical
43 practiced
Define index selectivity and cardinality. As a data engineer, how do these concepts affect index choice for OLTP vs OLAP workloads? Give an example of a low-cardinality column and explain why an index on it might be ineffective.
MediumTechnical
36 practiced
In big-data engines (Spark, Hive) there isn't a B-tree index like RDBMS. Explain practical approaches to accelerate selective queries: partitioning, bucketing, Z-ordering (databricks), Bloom filters, and file-format choices (Parquet/ORC). When would you still benefit from RDBMS-style indexes?
EasyTechnical
53 practiced
Write PostgreSQL SQL to create a partial (filtered) index that speeds up queries selecting active users only. Table: users(id, email, active boolean, updated_at). Provide index DDL and explain when a partial index is preferable to a full index.
EasyTechnical
48 practiced
You run analytics `GROUP BY status` on a table with status having only 4 possible values and millions of rows. Would a bitmap index help here? Explain what a bitmap index is, when it shines (warehousing/OLAP), and any trade-offs.

Unlock Full Question Bank

Get access to hundreds of Indexing Strategy and Selection interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.