Home › Blog › PostgreSQL interview questions

PostgreSQL interview questions

Postgres interviews split into two halves: writing queries, which most candidates handle, and understanding what the database does with them, which far fewer do. The second half is where the loop is decided.

Indexes and query plans

MVCC, vacuum and bloat

The topic most candidates have never thought about, and the one most likely to appear in an operational role.

The question that reveals experience: "a table keeps growing even though row count is flat - why?" Bloat from dead tuples that vacuum has not reclaimed.

Transactions and locking

Schema and data types

JSONB versus a normalised schema, and the honest answer that JSONB is excellent for genuinely variable data and a trap for data you will query structurally. Then: when to partition, `text` versus `varchar(n)` (functionally identical in Postgres, which surprises people), and why `timestamptz` is almost always the right choice over `timestamp`. The query-writing half is in SQL interview questions.

How deep it goes by level

Whatever the level, say your answers out loud rather than reading them. Most of what candidates lose in a PostgreSQL interview is lost between knowing something and explaining it under observation - the method is in how to use AI for interview prep.

Where CoPilot Interview fits

Disclosure: we build an interview assistant, so treat this as a disclosed pitch. CoPilot Interview is a native Windows and macOS app that puts suggested answers on your own screen in about two seconds, across coding, system design and behavioral rounds, with a permanent free tier that needs no credit card.

Frequently asked questions

What are the most common PostgreSQL interview questions?

Reading query plans with `EXPLAIN ANALYZE`, index types and composite column order, MVCC and what autovacuum does, isolation levels, and how to add an index without locking the table. The operational questions about vacuum and bloat separate candidates most.

Why would Postgres ignore an index?

Commonly because a function or a type cast is applied to the column in the `WHERE` clause, because statistics are stale, or because the planner correctly estimates that a sequential scan is cheaper for the proportion of rows being returned.

What is MVCC in PostgreSQL?

Multi-version concurrency control - each transaction sees a consistent snapshot built from row versions rather than taking read locks, so readers never block writers. The cost is dead tuples left behind by updates and deletes, which vacuum must reclaim.

How do you add an index without downtime?

`CREATE INDEX CONCURRENTLY`, which avoids the exclusive lock a normal index build takes. It is slower, cannot run inside a transaction block, and can leave an invalid index if it fails - all points worth mentioning.

Walk into the round with a second pair of eyes

CoPilot Interview is a native Windows and macOS app that puts suggested answers on your own screen in about two seconds, across coding, system design and behavioral rounds. The free tier is permanent: 15 minutes a day, no credit card.

Try it free