Lesson 12 of 15
9. Indexes

Interview questions

6 min read+10 XP

Interview questions (with the counter-questions you'll get)

Q1. What is a database index, and how does it speed up queries?

They're testing: a correct mental model.

Think about your answer first, then open it.

reveal

Q2. How does a B-tree index work?

They're testing: depth.

Think about your answer first, then open it.

reveal

Q3. B-tree vs hash index vs LSM tree?

They're testing: matching structures to workloads.

Think about your answer first, then open it.

reveal

Q4. Explain composite indexes and column order.

They're testing: the leftmost-prefix rule.

Think about your answer first, then open it.

reveal

Q5. What is a covering index?

They're testing: a common optimisation.

Think about your answer first, then open it.

reveal

Q6. A query is slow. How do you investigate?

They're testing: a methodical approach.

Think about your answer first, then open it.

reveal

Q7. Why might the database not use an index you created?

They're testing: planner awareness.

Think about your answer first, then open it.

reveal

Q8. What's the cost of indexes?

They're testing: trade-offs.

Think about your answer first, then open it.

reveal

Q9. How would you index a column for "contains" text search?

They're testing: knowing B-tree limits.

Think about your answer first, then open it.

reveal

Q10. How does indexing differ for a write-heavy table, like events?

They're testing: workload thinking.

Think about your answer first, then open it.

reveal