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? Junior level
  • 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 Senior level
  • 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 Senior level
  • 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 Mid level
  • What is the N+1 query problem, how would you spot it, and how do you fix it?Go Pro Junior level
  • Explain database transactions and the ACID properties. Where do they break down at scale?Go Pro Mid level
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.