Backend Engineering
Databases & Query Optimization
6 practice questions. Free questions open a full answer guide; the rest unlock with Pro.
- What is a database index and what are the trade-offs of adding one?
- A paginated endpoint that lists records ordered by creation time is fast on page one but crawls when users page deep into the results, even though the column is indexed. Diagnose why, and how you'd redesign it.Go Pro
- You have a composite index on (tenant_id, status, created_at), but a frequent reporting query that filters on tenant_id and a created_at range while ignoring status still runs slow and the planner only partially uses the index. Explain what's happening and how you'd fix it.Go Pro
- An API endpoint that lists orders with their customer details gets slow as data grows. You see hundreds of nearly identical SQL queries per request in the logs. What's happening and how do you fix it?Go Pro
- What is the N+1 query problem, how would you spot it, and how do you fix it?Go Pro
- Explain database transactions and the ACID properties. Where do they break down at scale?Go Pro
Want questions matched to your role? Paste a job title, job description, or CV for a personalized set, or go Pro to unlock the full bank.