Published:
Last updated:

Database Internals and Scaling

Authors
Time yourself:
Your progress:

00:30:00

0%

Filter by difficulty

35 of 35 questions shown

Storage Layout and Access Paths

1. How does a database read and write a row on storage?

Mid-level
Flag important question
Mark as complete

2. How does a B-tree index work, and why is it effective for database queries?

Mid-level
Flag important question
Mark as complete

3. How should you order columns in a composite index?

Mid-level
Flag important question
Mark as complete

4. How do LSM trees differ from B-tree-based storage engines?

Mid-level
Flag important question
Mark as complete

5. Why can adding too many indexes make a database slower?

Junior
Flag important question
Mark as complete

Query Planning and Execution

Free preview complete

You’ve reached the end of the free preview

Get every remaining question and complete answer, plus progress tracking across the full Interview Question Library.

  • 30 more questions and complete answers in this topic
  • Full access to every interview topic
  • Progress tracking and question flags
  • New questions and improvements during your subscription

Full access from

$12/month

No long-term commitment. Cancel whenever you want.

6. How does a query planner choose an execution plan?

Mid-levelPaid Question

7. How do nested-loop, hash, and merge joins differ?

Mid-levelPaid Question

8. When is a full scan better than an index scan?

Mid-levelPaid Question

9. Why can the same query become slow even when its SQL has not changed?

Mid-levelPaid Question

Transactions, MVCC, and Recovery

10. What does a write-ahead log provide?

Mid-levelPaid Question

11. How does MVCC improve concurrency, and what costs does it create?

Mid-levelPaid Question

12. Which anomalies do transaction isolation levels prevent?

Mid-levelPaid Question

13. How do database locks and deadlocks affect production behavior?

SeniorPaid Question

Replication, Sharding, and Rebalancing

14. What is the safest order for scaling a database?

Mid-levelPaid Question

15. How do synchronous and asynchronous replication affect failover?

SeniorPaid Question

16. How do you choose a database shard or partition key?

Mid-levelPaid Question

17. How can a database rebalance or reshard with minimal downtime?

Mid-levelPaid Question

18. What causes hot partitions, and how do you mitigate them?

SeniorPaid Question

Model Selection and Performance Decisions

19. How do relational, document, key-value, wide-column, graph, and time-series databases differ?

Mid-levelPaid Question

20. How would you diagnose and scale a database-backed endpoint that is missing its latency target?

SeniorPaid Question

Database Building Blocks

21. What is a database page, and why do databases use pages?

JuniorPaid Question

22. What does a database buffer pool do?

JuniorPaid Question

23. How do primary and secondary indexes differ?

JuniorPaid Question

24. What are cardinality and selectivity in an index?

JuniorPaid Question

25. What happens when a database executes a query?

JuniorPaid Question

26. Why do applications use database connection pools?

JuniorPaid Question

27. What are primary and replica database nodes?

JuniorPaid Question

Maintenance and Query Patterns

28. What do database checkpoints do, and why can they affect latency?

Mid-levelPaid Question

29. Why do databases need vacuuming or compaction?

Mid-levelPaid Question

30. How do offset and keyset pagination compare?

Mid-levelPaid Question

31. How should an application route reads to database replicas?

Mid-levelPaid Question

Safe Growth and Recovery

32. How do you perform an online database schema migration?

SeniorPaid Question

33. How do you handle replication lag without serving incorrect data?

SeniorPaid Question

34. How would you capacity-plan a growing database?

SeniorPaid Question

35. How would you design database isolation for a multi-tenant SaaS?

SeniorPaid Question