Database Interviews in the AI Era: The Ticket Format

Today's database interviews hand you a codebase, an AI assistant and a vague ticket. How to debug aloud, steer the AI and price a fix in CPU, memory and…

In this chapter

The ticket interview: you have AI, so they test judgement

More on Ticket interviews

Keep learning

Overview

0–5 min Read the ticket A vague bug in plain English. Say it back in one sentence. Explore the code Think aloud Exists? Built right? Used right? Holds under load and failure? Guardrail the AI Write the fix as a precise comment. Let the AI type. Review the diff. “How does the engine do that?” “What does it cost?” What if it fails? Scale it out. Kill a dependency. Defend your trade-off. Does it exist? A unique index? A limiter? A transaction at all? Is it implemented right? Fixed or sliding window? Lock order? Column order? Is it used right? On every route? Inside the transaction? Does it hold under pressure? Two requests at once, 10× traffic, a node down. How many rows are read, sorted, hashed? filesort, full scan, JSON parsing Does the hot data fit in RAM? index size, temp tables, cache hit ratio Disk I/O How many pages hit disk, random or in order? index lookups, page splits, fsync What is locked, by whom, for how long? FOR UPDATE, long transactions How many round trips? Any HTTP inside a transaction? N+1 queries, calls holding locks Blast radius If this fails, what else goes down? shared DB, retry storms The same job runs twice races · UNIQUE index · gap locks Mid → Senior Checkout fails with “Deadlock found” lock order · isolation · retries One keyword made the page 40× slower EXPLAIN · filesort · covering Rate limit is 2/min, 30 requests get through sliding window · Redis down · cascade Senior → Staff “Just add an index” slowed ingestion write amplification · memory · UUID keys Refresh shows the old name binlog · semi-sync · read-your-writes Importing 10M rows takes six hours redo / WAL · fsync · crash recovery Slow everywhere, disk keeps growing MVCC · undo · purge · read views Wallet balance wrong under load isolation levels · lost update · write skew API p99 jumps every night buffer pool · midpoint LRU · memory Profile lookups got 40× slower LSM · tombstones · bloom filters Inserts stall on one hot page B-tree splits · rightmost leaf The write succeeded, the cart is empty quorum · hinted handoff · repair Inventory locked after a restart 2PC · prepared locks · decision log Both regions took orders failure detection · Raft term · fencing Shoes show a 0% discount integer division · NULLIF · COUNT March changed after the deploy timestamptz · AT TIME ZONE · BETWEEN The new branch takes 38 seconds cardinality · ANALYZE · autovacuum Make Postgres use the index selectivity · seq scan · plan hints Two services write one order row ownership · schema coupling · one writer The join left the database bulk read · snapshot column · no cross-db FK An analyst query locked checkout published schema · hide internal tables Two local commits, one business step atomicity · reorder · don’t split yet One shard is hot, the other is idle partition key · partial failure · scatter query Event sourcing for a slow SELECT read replica · CQRS · projection lag Four dashboards disagree about “slow” execution time · latency · throughput · CPU Checkout got slow when the job started write · read · delete · competing work Fast in staging, slow in production row width · working set · geography · spikes Login scans the customers table secondary index · pointer · covering Split one database into three shards shard key · scatter query · local transaction The order page joins four tables snapshot column · stale name · fan-out Every read hits the leader followers · replication stream · read-your-writes Two debits, one version, one of them vanishes optimistic lock · version · retry Should we move Postgres to MySQL? migration decision · heap vs clustered · vacuum vs purge B-tree or LSM, per table read/write/space amplification · RUM · compaction · Bloom filters Both regions take writes multi-leader · LWW · version vectors · CRDT Search by color on a table sharded by id local vs global index · scatter-gather · write fan-out · stale index We added a node, most data moved hash mod N · fixed partitions · consistent hashing · cutover Two bookings for one room write skew · phantom · SELECT FOR UPDATE · SSI · serial execution Where do we need linearizability? linearizability · CAP · quorum limits · session guarantees Saved order, lost event dual write · outbox · CDC · 2PC · idempotent consumer Zero-downtime schema change compatibility · rolling deploy · expand-migrate-contract · backfill Pick the order id Snowflake · UUIDv7 · clock skew · Lamport/HLC Celebrity feed fan-out fan-out on write · fan-out on read · hybrid · celebrity One tenant slows 5,000 others pooled vs silo · noisy neighbour · per-tenant restore · tenant directory

The ticket interview: you have AI, so they test judgement

60 min cloud IDE + AI think aloud no-AI theory follow-ups one round stage where AI types practice tickets Find the cause Read code, ask questions, prove it. Steer the AI You decide the fix. The AI types it. Price the fix CPU, memory, disk, locks, network, blast radius.

Ask four questions about anything the ticket mentions

Say them out loud. Each is a place a bug hides.

Price every change in six resources

Asked “what does it cost?” Walk these six.

Your prompt shows whether you know the domain

Names the algorithm, data structure and exact commands. You pick the failure policy, not the model. A test proves the boundary bug is gone.

Pick your first ticket

Start with the same job runs twice. The full list is just below.

More courses

  • Jobs, linked to lessons — Browse jobs where every requirement links to the chapter that teaches it. See how ready you are, how long the gap takes to close, and which listings look stale.
  • Match a job post to courses — Paste a job post. Each skill is matched to a track here and put in learning order, foundations first.
  • React patterns from open source — Patterns extracted from Material UI, Radix, React Aria, React Hook Form, Redux Toolkit, TanStack, and Next.js — not slides about hooks.
  • System Design — Core concepts first (SQL vs NoSQL, CAP, indexing, replication, sharding), then designs grouped by what carries them: the database, Redis, Kafka, or many services.
  • NestJS: build a real API — One ticket-booking API, built in order: a plain Node server first, then NestJS modules, validation, a real database, and the features real clients lean on.
  • Microservices — Microservice patterns one diagram at a time: how to split a monolith, how services talk, and how data stays consistent without distributed transactions.
  • Kafka — A beginner-to-senior path through event logs, reliable delivery, production operations, and disaster recovery.
  • AI engineering for software engineers — Eight free reads, in order, for software engineers moving into AI: when to build an agent, how to build one, how to test it, and how the model works underneath.
  • Frontend system design — How a UI is sliced when it is a product, not a page: ownership of state, cache, routes, and what happens when the network lies.
  • TypeScript in depth — The type system as a design tool. Inference, narrowing, generics, and the errors that mean the model is wrong — not a catalog of utility types.
  • CSS in depth — See the box, then the page. Visual chapters from the box model through Flexbox surprises, Grid, selectors, and units, then backgrounds, shapes, and visual effects, each with a playground.
  • Accessibility — Foundations first (WCAG in plain words, semantic HTML, lists, alt text), then hands-on HTML labs, a full pass of WAI-ARIA 1.3, and a final fix-the-page challenge.
  • Docker — What an image is, why layers cache, and how containers find each other on a network.
  • Redis — Fifteen Redis patterns, one picture each: cache, session, lock, counter, rate limiter, queue, and when Redis is the wrong tool.
  • Kubernetes — Kubernetes from zero to operators: why it exists, Pods, Deployments and Services, then configuration, networking, storage, scheduling, scaling and security.
  • AWS — AWS networking in plain English. A VPC is a gated housing society: streets are subnets, the Internet Gateway is the main gate, and a route table is the signboard.
  • Networking: the NetRoute game — NetRoute is a packet logistics game. You wire up computers, switches, routers, firewalls and gateways, set each device, and watch glowing packets travel. If a packet gets dropped, the game shows you which header field was wrong.