Database Interview Practice
Backend interview questions on schema design, SQL, indexing, transactions, scaling and migrations
Database Interview Practice is a Bertopia flashcard pack of 58 cards: backend interview questions on schema design, SQL, indexing, transactions, scaling and migrations. It covers contention and lost updates; idempotency and retries; indexing and pagination; isolation anomalies; replication and lag; sharding and hot keys; choosing and modelling a datastore; durability and operations.
Worked answers by topic
- Database contention and isolation interview questions (16 questions)
- Idempotency and retries interview questions (7 questions)
- Database indexing and data modelling interview questions (17 questions)
- Database sharding and replication interview questions (11 questions)
- Database durability and operations interview questions (7 questions)
Sources
41 sources
- A Critique of ANSI SQL Isolation Levels, Berenson et al., 1995, arXiv
- Amazon DynamoDB Developer Guide: Best practices for designing and architecting with DynamoDB, Amazon Web Services
- Amazon DynamoDB Developer Guide: Designing partition keys to distribute your workload, Amazon Web Services
- Amazon DynamoDB Developer Guide: Using write sharding to distribute workloads evenly, Amazon Web Services
- Designing Data-Intensive Applications, Martin Kleppmann, O'Reilly, 2017, O'Reilly Media
- Debezium Documentation: PostgreSQL connector, Debezium
- Dynamo: Amazon's Highly Available Key-value Store, DeCandia et al., 2007, ACM SOSP 2007
- Linux man page: fsync(2), man7.org
- Hello Interview: Dealing with Contention, Hello Interview
- Hello Interview: Core Concepts for System Design, Hello Interview
- Hello Interview: Design Ticketmaster, Hello Interview
- HikariCP: About Pool Sizing, HikariCP
- MySQL Reference Manual: Clustered and Secondary Indexes, Oracle
- Consistent Hashing and Random Trees, Karger et al., 1997, ACM
- How to do distributed locking, Martin Kleppmann, 2016, Martin Kleppmann
- Use The Index, Luke: SQL Indexing and Tuning, Markus Winand, Markus Winand
- Use The Index, Luke: Paging Through Results, Markus Winand
- MySQL Reference Manual: Transaction Isolation Levels, Oracle
- Pattern: Transactional outbox, Chris Richardson, microservices.io, microservices.io
- PostgreSQL Documentation: Client Connection Defaults (statement and lock timeouts), PostgreSQL Global Development Group
- PostgreSQL Documentation: Constraints (including exclusion constraints), PostgreSQL Global Development Group
- PostgreSQL Documentation: Using EXPLAIN, PostgreSQL Global Development Group
- PostgreSQL Documentation: Indexes on Expressions, PostgreSQL Global Development Group
- PostgreSQL Documentation: High Availability, Load Balancing, and Replication, PostgreSQL Global Development Group
- PostgreSQL Documentation: Index Types, PostgreSQL Global Development Group
- PostgreSQL Documentation: INSERT (ON CONFLICT), PostgreSQL Global Development Group
- PostgreSQL Documentation: Index-Only Scans and Covering Indexes, PostgreSQL Global Development Group
- PostgreSQL Documentation: Transaction Isolation, PostgreSQL Global Development Group
- PostgreSQL Documentation: Multicolumn Indexes, PostgreSQL Global Development Group
- PostgreSQL Documentation: Partial Indexes, PostgreSQL Global Development Group
- PostgreSQL Documentation: SELECT (including FOR UPDATE and SKIP LOCKED), PostgreSQL Global Development Group
- Serializable Snapshot Isolation in PostgreSQL, D. Ports and K. Grittner, 2012, arXiv
- PostgreSQL Documentation: Synchronous Replication, PostgreSQL Global Development Group
- PostgreSQL Documentation: Reliability and the Write-Ahead Log, PostgreSQL Global Development Group
- PostgreSQL Documentation: Write Ahead Log settings (synchronous_commit, fsync), PostgreSQL Global Development Group
- PracHub: Design a crash resilient LRU cache, PracHub
- Redis Documentation: Distributed locks with Redis, Redis
- StackScholar: Database replication and sharding interview questions, StackScholar
- Designing robust and predictable APIs with idempotency, Brandur Leach, Stripe
- Stripe API Reference: Idempotent requests, Stripe
- Every question I was asked in Stripe's system design interview, Medium