What is an index in databases: Answer Guide 2027
A database index is a lookup structure — typically a B-tree — that lets the database find rows without scanning the whole table, like a book's index versus reading every page. In a database index interview, lead with the tradeoff: indexes make reads dramatically faster but slow down writes and consume storage, since every index must be maintained on each insert or update.
What This Tests in a Database index interview Question
- Whether you know what an index physically is and how it speeds up lookups.
- Whether you understand the read-versus-write tradeoff that governs index design.
- Whether you can reason about when indexes help: selective WHERE clauses and joins — and when they do not.
How to Answer a Database index interview Question
- Define it with the book analogy: an ordered lookup structure (usually a B-tree) pointing to rows.
- Explain the win: indexed lookups go from full-table scans to logarithmic searches.
- State the cost: every write must update each index, so over-indexing slows inserts and bloats storage.
Example phrasing: "An index is a B-tree lookup structure that finds rows without scanning the table — like a book index. I would index columns in selective WHERE clauses and join keys, but avoid over-indexing since each index slows writes and costs storage."
Common Mistakes in a Database index interview Question
- Saying 'indexes make everything faster' without the write penalty.
- Indexing every column, or low-selectivity columns like booleans, where the index barely helps.
- Not knowing the B-tree basics when asked how the lookup actually works.
Indexing is the most practical database knowledge an engineer can show, and interviewers treat it as a proxy for real-world experience. Nail the read-versus-write tradeoff with one good example and you pass the 'has this person tuned a real database' test.
Keep Reading
- jp morgan cooling off period
- lbo interview question
- JP Morgan Video Interview Question: How Valuation Works
- JP Morgan Video Interview Question: Securities Services Fit
FAQ
What is an index in a database index interview?
A lookup data structure, usually a B-tree, that lets the database find rows without scanning the entire table.
How do indexes speed up queries?
By organizing keys in a searchable tree, turning full scans into fast logarithmic lookups on indexed columns.
What is the downside of indexes?
They slow down writes (each index must be updated) and consume extra storage.
When should you not add an index?
On tiny tables, very low-selectivity columns, or write-heavy tables where the maintenance cost outweighs the read benefit.
Preparing for JP Morgan's interview? Our 2027 JP Morgan Video Interview & Coding Challenge Exact Questions and Answers has practice questions and answers — $79 one-time, instant download.































