What should I focus on for my PostgreSQL interview?

Can I explain when to choose PostgreSQL?

Start with database choices. Basics and comparisons appeared in 26 of 78 interviews. Choosing PostgreSQL over MongoDB was the most asked question, appearing in 7 of 78 interviews.

Can you explain what PostgreSQL is and how SQL relates to it? Then compare PostgreSQL with MySQL and SQLite. Explain when you would choose each, rather than just naming differences. For search, can you explain when you would choose Elasticsearch instead of PostgreSQL?

Can I explain my table design and query choices?

Use the key, constraint, and join questions to test whether you can explain both your choices and how a query behaves:

  • Can you choose between a natural key and a surrogate key such as BIGSERIAL or UUID, and explain the trade-offs?
  • Can you explain the practical difference between a primary key and a unique constraint?
  • Can you say how INNER JOIN and LEFT JOIN differ, including which rows remain when there is no match?
  • Can you explain how INSERT ... ON CONFLICT works and what constraints or indexes it requires?

Can I explain slow queries and concurrent work?

Go beyond naming index types. Can you say when you would use each type? For a slow query, can you explain what you would check about query execution, scans, and planner costs?

Application questions also cover connection pools, caching, and overload protection. Can you describe how your application uses PostgreSQL and how you would protect it from overload?

For concurrent work, can you explain how MVCC, isolation levels, and locks relate to concurrent writes? Can you describe how workers can coordinate safely?

Can I plan database changes and operations?

Start with the Oracle-to-PostgreSQL migration question. Can your plan cover both database changes and application changes? Then explain how you would approach an online schema change and validate constraints.

For administration, can you explain permissions and row-level security? Can you describe what vacuuming does? For backup and replication, can you explain the role of WAL and how you would approach failover and split-brain prevention?

Can I write the index task shown here?

A coding task appeared in 1 of 78 interviews. Can you write a partial unique index that enforces unique email only when email IS NOT NULL? Write the statement, then explain how its condition matches the requirement.

Who gets asked PostgreSQL

Backend developer33 interviews
Data engineer8 interviews
Database administrator4 interviews
DevOps engineer3 interviews
SRE2 interviews

The 20 most asked PostgreSQL questions

Counted by interview, not by mention: a question asked twice in one conversation counts once.

  1. When would you choose PostgreSQL over MongoDB?

    Asked in 7 of 78 interviews · last asked Sep 29 · Concept · Mid-level

    Show answer

    I would choose PostgreSQL when the data has clear relationships and needs joins, strong constraints, or complex SQL queries. I would consider MongoDB when data fits self-contained documents and is usually read or updated as a whole. Both support transactions, and PostgreSQL also supports flexible JSON data, so I would choose based on the data model and query needs.

    • PostgreSQL supports foreign keys and constraints that enforce data rules across related tables.
    • MongoDB suits document-based models where embedding related data matches common queries.
    • Both support transactions; transaction support alone is not the deciding factor.
    • PostgreSQL supports JSONB, so flexible fields do not automatically require MongoDB.

    What the interviewer checks: The interviewer wants to know whether you can match a database to the project's data and query needs.

    Other ways it was asked
    • “How would you explain the difference between using MongoDB and PostgreSQL for a project, and when would you choose one over the other?”
    • “Why did you choose PostgreSQL over MongoDB?”
    • “Which do you prefer, MongoDB or PostgreSQL, and why?”
  2. How do PostgreSQL, MySQL, and SQLite differ, and how does SQL relate to them?

    Asked in 4 of 78 interviews · last asked Nov 16 · Concept · Junior

    Show answer

    SQL is a language for working with relational databases; PostgreSQL, MySQL, and SQLite are database systems that use it. PostgreSQL offers rich data types and strong extensibility. MySQL is also a database server, with its own SQL features and storage engines. SQLite runs inside an application and usually stores the database in one file.

    • PostgreSQL and MySQL run as separate servers; SQLite is embedded and needs no separate server.
    • All three support SQL, but their syntax, data types, and features differ.
    • SQLite supports many readers, but only one writer at a time.
    • PostgreSQL and MySQL are generally better suited to many concurrent writers.

    What the interviewer checks: The interviewer checks whether you separate SQL from database systems and understand their main deployment differences.

    Other ways it was asked
    • “What's the difference between SQL and PostgreSQL?”
    • “How does PostgreSQL differ from MySQL, and how is SQL related to both?”
    • “What’s the basic difference between PostgreSQL and SQL?”
  3. What is PostgreSQL, when would you use it, and how does SQL fit in?

    Asked in 4 of 78 interviews · last asked Nov 16 · Concept · Junior

    Show answer

    PostgreSQL is an open-source relational database system that stores and manages data in tables. I would use it for applications that need reliable transactions, data rules, and complex queries. SQL is the language used to define tables, read and change data, and control access in PostgreSQL.

    • PostgreSQL is a database system; SQL is a language, not a database.
    • Transactions and constraints help keep application data correct.
    • It supports joins, complex queries, and JSON data alongside relational tables.

    What the interviewer checks: The interviewer wants to know whether you understand PostgreSQL’s purpose, common uses, and relationship to SQL.

    Other ways it was asked
    • “What is PostgreSQL?”
    • “When would you use PostgreSQL, and what is SQL’s role in working with it?”
    • “Why might you choose PostgreSQL for an application?”
  4. How would you plan an Oracle-to-PostgreSQL migration, including database and application changes?

    Asked in 3 of 78 interviews · last asked Oct 16 · Scenario · Mid-level

    Show answer

    I would first assess the schema, data size, Oracle features, application dependencies, and allowed downtime. Then I would convert database objects and update application SQL, drivers, and transaction handling. I would rehearse data loading and test correctness and performance. Finally, I would plan change capture if needed, a controlled cutover, validation, and rollback.

    • Review data types, sequences, PL/SQL, packages, and Oracle-specific SQL; conversion tools still need manual review.
    • Check application behavior: PostgreSQL distinguishes empty strings from NULL, unlike Oracle character values.
    • Validate row counts, data values, constraints, and business results; tune important queries and indexes.
    • Choose offline transfer or change capture based on downtime; define rollback steps, including handling new writes.

    What the interviewer checks: The interviewer checks whether you can plan a safe migration across the database, application, and deployment process.

    Other ways it was asked
    • “If I were asked to migrate from Oracle to PostgreSQL, what would I consider first?”
    • “What analysis points would you consider when migrating both the application and database from Oracle to PostgreSQL?”
    • “What first steps would you take on both the database and application sides when migrating from Oracle to PostgreSQL?”
  5. How does Elasticsearch differ from PostgreSQL, and when would you choose it for search?

    Asked in 2 of 78 interviews · last asked Jul 27 · Concept · Senior

    Show answer

    Elasticsearch is built for search, while PostgreSQL is a relational database with search features. Choose Elasticsearch for advanced text search, relevance tuning, and search across large datasets spread across servers. Choose PostgreSQL when its full-text search is enough and you need transactions, joins, and fewer systems to manage.

    • Elasticsearch offers text analysis, relevance scoring, fuzzy matching, and search aggregations.
    • PostgreSQL supports indexed full-text search; Elasticsearch is not always needed.
    • Elasticsearch search is near real time; recent writes may not appear immediately.
    • Using both adds data synchronization work; PostgreSQL can remain the source of truth.

    What the interviewer checks: The interviewer checks whether you can weigh search features against consistency needs and operational complexity.

    Other ways it was asked
    • “What advantages does Elasticsearch offer over PostgreSQL or MongoDB for search?”
    • “What is the difference between PostgreSQL and Elasticsearch?”
  6. When modeling a new table in PostgreSQL, how do you decide between a natural key and a surrogate key, such as BIGSERIAL or UUID, and what performance or operational trade-offs drive that choice?

    Asked in 2 of 78 interviews · last asked Jul 27 · Concept · Senior

    Show answer

    I use a natural key when it is small, unique, and unlikely to change. Otherwise, I use a surrogate key and enforce business uniqueness separately. BIGINT identity keys are compact and usually improve index locality; UUIDs allow independent ID generation across systems, but use more space, and random UUIDs have poorer index locality.

    • Wide or changing natural keys make foreign keys and updates more costly.
    • Surrogate keys do not prevent duplicate business data; add the appropriate UNIQUE constraint.
    • For new tables, prefer standard identity columns over BIGSERIAL; sequence-generated values can have gaps.
    • UUIDs simplify merging independently created records; UUID version affects index locality.

    What the interviewer checks: The interviewer checks whether you balance business identity, data integrity, index cost, and distributed ID generation.

    Other ways it was asked
    • “When you are designing tables in PostgreSQL, what factors make you choose a UUID primary key versus a big serial or identity key?”
  7. What's the practical difference between a primary key and a unique constraint in PostgreSQL?

    Asked in 2 of 78 interviews · last asked Nov 10 · Concept · Junior

    Show answer

    A primary key identifies each row and requires unique, non-null values. A unique constraint prevents duplicate values but allows nulls by default. A table can have one primary key and several unique constraints; either can cover multiple columns. Use the primary key for the main row identifier and unique constraints for other values that must not repeat.

    • Both automatically create a unique index.
    • By default, unique constraints treat nulls as distinct, so multiple nulls are allowed.
    • PostgreSQL 15 and later support UNIQUE NULLS NOT DISTINCT to treat nulls as equal.
    • Foreign keys can reference either a primary key or an eligible unique constraint.

    What the interviewer checks: The interviewer is checking your understanding of row identity, uniqueness, null handling, and when to use each constraint.

    Other ways it was asked
    • “In PostgreSQL, what's the difference between a primary key and a unique constraint, and when would you choose one over the other?”
  8. How does INSERT ... ON CONFLICT work in PostgreSQL, and what constraints or indexes does it require?

    Asked in 2 of 78 interviews · last asked Nov 5 · Tooling · Mid-level

    Show answer

    INSERT ... ON CONFLICT skips a conflicting row with DO NOTHING or updates the existing row with DO UPDATE. It detects conflicts through unique indexes or supported constraints, not arbitrary conditions. DO UPDATE requires a conflict target and can use EXCLUDED to read the proposed values.

    • DO UPDATE needs a matching unique index, including one created by a PRIMARY KEY or UNIQUE constraint.
    • Specify indexed columns or use ON CONSTRAINT with a constraint name.
    • Only non-deferrable constraints are supported; exclusion constraints work with DO NOTHING, not DO UPDATE.
    • DO NOTHING can omit the conflict target to handle all supported conflicts.
    SQL
    CREATE TABLE users (
      email text PRIMARY KEY,
      name text NOT NULL
    );
    
    INSERT INTO users (email, name)
    VALUES ('sam@example.com', 'Sam')
    ON CONFLICT (email) DO UPDATE
    SET name = EXCLUDED.name;

    What the interviewer checks: The interviewer checks whether you understand conflict detection, required uniqueness rules, and how to update using proposed values.

    Other ways it was asked
    • “How would you handle an insert that should update an existing row when a conflict occurs in PostgreSQL?”
    • “In PostgreSQL, what does INSERT ... ON CONFLICT use to detect a conflict, and what must exist on the table for it to work?”
  9. What are joins in PostgreSQL, and how do INNER JOIN and LEFT JOIN differ?

    Asked in 2 of 78 interviews · last asked Jul 21 · Concept · Junior

    Show answer

    Joins combine rows from tables, usually using a condition that matches related columns. INNER JOIN returns only matching row pairs. LEFT JOIN returns all rows from the left table, with matching rows from the right table or NULL values when no match exists.

    • Both joins return one row for each matching pair, so one left row can appear multiple times.
    • Other join types include RIGHT JOIN, FULL JOIN, and CROSS JOIN.
    • A WHERE condition that rejects NULLs from the right table removes unmatched rows after a LEFT JOIN.

    What the interviewer checks: The interviewer checks whether you understand matching rows and how LEFT JOIN keeps unmatched left rows.

    Other ways it was asked
    • “What is a join in PostgreSQL?”
    • “What are the types of joins in PostgreSQL?”
    • “Explain INNER JOIN and LEFT JOIN in PostgreSQL.”
  10. What types of indexes are available in PostgreSQL, and when would you use them?

    Asked in 2 of 78 interviews · last asked Nov 12 · Concept · Mid-level

    Show answer

    PostgreSQL has six built-in index methods: B-tree, Hash, GiST, SP-GiST, GIN, and BRIN. B-tree supports equality, ranges, and sorting; Hash supports equality only. GiST and SP-GiST support specialized searches, such as spatial queries; GIN supports arrays, JSONB, and full-text search. BRIN suits large tables where values correlate with physical row order.

    • Indexes speed up reads but use storage and add work to inserts, updates, and deletes.
    • B-tree is the default and the usual choice for ordinary column lookups.
    • GIN indexes values within documents or collections; supported operators determine which queries benefit.
    • BRIN stores compact summaries of block ranges, so poor physical correlation reduces its usefulness.

    What the interviewer checks: The interviewer checks whether you can match index methods to query patterns and explain their costs.

    Other ways it was asked
    • “Why do we need indexes in PostgreSQL, and what types of indexes do you know?”
  11. How would you diagnose and fix slow PostgreSQL queries as data volume grows?

    Asked in 2 of 78 interviews · last asked Nov 10 · Scenario · Senior

    Show answer

    I find the slowest, most costly queries using pg_stat_statements or slow-query logs. I inspect EXPLAIN (ANALYZE, BUFFERS) for wrong row estimates, expensive scans, joins, and disk spills, and check for lock waits. I then fix indexes, query structure, or table maintenance based on that evidence. Finally, I measure again with realistic data and load.

    • EXPLAIN ANALYZE executes the query; use care on production, especially with writes.
    • Keep planner statistics current with ANALYZE; check that autovacuum keeps up with table changes.
    • Match indexes to filters, joins, and ordering; extra indexes increase storage and write costs.
    • Consider partitioning when queries can skip partitions, not simply because a table has millions of rows.

    What the interviewer checks: The interviewer checks whether you diagnose the actual bottleneck, choose a targeted fix, and verify the result.

    Other ways it was asked
    • “How would you diagnose and mitigate slow queries in PostgreSQL, step by step?”
    • “How would you tune a slow PostgreSQL query, step by step?”
    • “How would you optimize a PostgreSQL database when queries become slow as an application grows to millions of records?”
  12. How would you use PostgreSQL constraints and transactions to make concurrent requests or event processing idempotent?

    Asked in 2 of 78 interviews · last asked Sep 3 · Design · Senior

    Show answer

    Store a client-supplied request or event key under a UNIQUE constraint. In one transaction, insert that key, apply business changes only for a new key, and save the result. Use INSERT ... ON CONFLICT DO NOTHING RETURNING to identify the winner. Duplicates return the saved result; rollback lets a retry process the key.

    • Scope keys by client or operation, and reject reuse with a different request payload.
    • The unique constraint handles races across application instances; checking before inserting is not enough.
    • Under READ COMMITTED, read the saved result in a separate statement after the conflicting insert finishes.
    • Transactions cover database changes, not external calls; use an outbox and consumer deduplication for external effects.

    What the interviewer checks: The interviewer checks whether you can prevent concurrent duplicates and make retries safe without overstating exactly-once guarantees.

    Other ways it was asked
    • “In PostgreSQL, how would you design an idempotency mechanism to process each event exactly once while still allowing safe retries?”
    • “How would you design idempotency for create-order POST requests and retries or refreshes, so flaky network connections don't create duplicate rows in PostgreSQL?”
    • “How would you enforce idempotency at the PostgreSQL level—with tables, constraints, and transactions—to prevent duplicates when concurrent requests reach multiple Node.js instances?”
  13. How do PostgreSQL REPEATABLE READ and SERIALIZABLE differ in anomalies, retries, and contention?

    Asked in 2 of 78 interviews · last asked Nov 10 · Concept · Senior

    Show answer

    PostgreSQL REPEATABLE READ uses a fixed snapshot, preventing nonrepeatable reads and phantoms, but allowing write skew. SERIALIZABLE also rejects executions that cannot match a serial order. Both levels can require whole-transaction retries; SERIALIZABLE adds tracking overhead and may cause more retries when transactions conflict.

    • Choose REPEATABLE READ for a stable snapshot when remaining anomalies are acceptable.
    • Choose SERIALIZABLE when concurrent transactions must preserve rules that span multiple rows.
    • Serializable predicate locks track dependencies without blocking writers; normal row locks can still cause waits.
    • Both levels can raise serialization_failure (SQLSTATE 40001); retry the whole transaction, not just the failed statement.

    What the interviewer checks: The interviewer checks whether you understand snapshot anomalies, retry handling, and the cost of stronger isolation.

    Other ways it was asked
    • “In PostgreSQL, what is the difference between Repeatable Read and Serializable, and what anomalies can still occur under Repeatable Read?”
    • “How do you decide between REPEATABLE READ and SERIALIZABLE in PostgreSQL, and what trade-offs do you expect, such as retries and contention?”
  14. How would you size a PostgreSQL connection pool and recognize when it is too small or too large?

    Asked in 2 of 78 interviews · last asked Oct 31 · Tooling · Senior

    Show answer

    Size the pool with load tests, based on query time, request concurrency, and database capacity; there is no fixed best number. Count connections across all app instances and leave room for administration and other clients. Too small means requests wait for connections while the database has spare capacity. Too large means more connections add contention without improving throughput.

    • Keep the total connection budget below PostgreSQL's max_connections, with spare connections for other uses.
    • Watch pool wait time, acquisition timeouts, active connections, query latency, and database CPU and memory.
    • Long transactions or leaked connections can cause pool waits; increasing the pool may hide the problem.
    • Increase the pool gradually under realistic load; stop when throughput stops improving or latency rises.

    What the interviewer checks: The interviewer is checking whether you balance application concurrency against database capacity and use measurements instead of guessing.

    Other ways it was asked
    • “In Node.js, how do you size and tune the Postgres connection pool, and what symptoms tell you it is too small versus too large?”
    • “How many connections should we usually allow in a PostgreSQL connection pool?”
  15. How do VACUUM, autovacuum, and VACUUM FULL differ, and when would you use each?

    Asked in 2 of 78 interviews · last asked Nov 10 · Concept · Mid-level

    Show answer

    VACUUM reclaims dead-row space for reuse, normally without blocking reads or writes. Autovacuum runs VACUUM and ANALYZE automatically; use it for routine maintenance. Run manual VACUUM when cleanup cannot wait. VACUUM FULL rewrites a table to return disk space, but requires extra disk space and blocks access; reserve it for severe bloat during planned downtime.

    • Regular VACUUM usually keeps disk space allocated so the table can reuse it.
    • Keep autovacuum enabled; it also helps prevent transaction ID wraparound.
    • VACUUM FULL takes an ACCESS EXCLUSIVE lock, blocking reads and writes.
    • Long-running transactions can prevent VACUUM from removing some dead rows.

    What the interviewer checks: The interviewer checks whether you can choose safe maintenance based on space reuse, disk recovery, and locking.

    Other ways it was asked
    • “What is the difference between VACUUM and VACUUM FULL in PostgreSQL?”
    • “In PostgreSQL, what are the key differences between VACUUM, autovacuum, and VACUUM FULL, and when would you use each in production?”
  16. For an application storing videos and JSON-based metadata, why might PostgreSQL not be the best choice?

    Asked once · last asked Oct 19 · Concept · Senior

    Show answer

    PostgreSQL may not be ideal for storing large video files because they increase database size, backup time, and replication traffic. Object storage with a CDN is usually better for video delivery. PostgreSQL can still handle JSON metadata well using JSONB, so JSON alone is not a reason to reject it.

    • Store video files in object storage and keep their identifiers or URLs in PostgreSQL.
    • JSONB supports indexing and queries on metadata fields.
    • Choose based on file sizes, access patterns, and scaling needs—not simply the presence of JSON.

    What the interviewer checks: The interviewer is checking whether you separate video storage needs from metadata query needs.

  17. Which database would you choose for a chat service that stores messages, photos, and other attachments: Redis, MongoDB, or PostgreSQL?

    Asked once · last asked Feb 23 · Design · Mid-level

    Show answer

    I would choose PostgreSQL as the main database for a typical chat service. It supports reliable transactions and relationships between users, conversations, and messages. I would keep photos and attachments in object storage, with their metadata and storage keys in PostgreSQL. Redis could handle caching and presence, while MongoDB is an option for flexible document structures.

    • PostgreSQL provides transactions, foreign keys, and indexes for message history queries.
    • Store large files in object storage rather than directly in the main database.
    • Redis usually complements the main database with caching, presence, or temporary data.
    • MongoDB suits document-based designs; choose based on access patterns and consistency needs.

    What the interviewer checks: The interviewer checks whether you can choose storage based on data relationships, reliability, and file storage needs.

  18. How do you view PostgreSQL compared with other databases, and which database do you prefer for real-time processing, and why?

    Asked once · last asked May 18 · Design · Senior

    Show answer

    PostgreSQL is a strong relational database with reliable transactions, rich SQL, and JSON support. I prefer it for real-time applications that need low-latency transactions and consistent data, provided workload tests confirm it meets latency targets. For continuous event-stream processing, I would choose a streaming engine such as Apache Flink instead.

    • Compare databases by data model, latency, consistency, scale, and operational needs.
    • PostgreSQL supports joins and relational constraints alongside JSON data.
    • NoSQL systems may fit specialized access patterns or distributed scaling needs better.
    • Real-time transactions and continuous stream processing are different workloads.

    What the interviewer checks: The interviewer checks whether you can justify a database choice using workload needs rather than personal preference.

  19. How does XML differ from a relational database such as MySQL or PostgreSQL?

    Asked once · last asked Jun 9 · Concept · Junior

    Show answer

    XML is a format for storing and sharing structured data, while MySQL and PostgreSQL are database systems. XML represents data as nested elements and attributes. Relational databases organize data in tables and provide SQL queries, constraints, and transactions. Both MySQL and PostgreSQL can also store XML content.

    • XML is a data format, not a database management system.
    • XML naturally represents nested data; relational databases use tables linked by keys.
    • Database systems manage queries, data integrity, transactions, and concurrent access.

    What the interviewer checks: The interviewer is checking whether you distinguish a data format from a database system and understand their data models.

  20. What factors would you consider when choosing between SQL Server and PostgreSQL for short-term and long-term rental data?

    Asked once · last asked Jun 18 · Scenario · Senior

    Show answer

    I would compare cost, team skills, existing systems, and the rental workload. Short-term rentals may need frequent availability searches and booking updates; long-term rentals may focus more on leases and recurring payments. Both databases can support either model, so I would test real queries and compare backup, security, and reporting needs.

    • Compare SQL Server edition and licensing costs with PostgreSQL hosting and support costs.
    • SQL Server fits many Microsoft environments; PostgreSQL is open source and offers many extensions.
    • Check date searches, overlapping bookings, indexing, and concurrent updates.
    • Compare reporting tools, managed hosting, backups, and recovery requirements.

    What the interviewer checks: The interviewer is checking whether you match database features and operating costs to business needs rather than rental duration alone.

PostgreSQL basics and database comparison interview questions

Start with what PostgreSQL is, how it relates to SQL, and when to choose it over other databases. 14 questions.

  1. For a star schema, would you store data in Delta tables or an external database such as PostgreSQL, and why?

    Asked once · last asked Aug 14 · Scenario · Mid-level

  2. Can you explain why ClickHouse is good for analytics, and how it differs from Postgres?

    Asked once · last asked Sep 2 · Concept · Mid-level

  3. For a simple application that may not need relational data, how would you choose between MongoDB, PostgreSQL, and Oracle?

    Asked once · last asked Sep 9 · Scenario · Mid-level

  4. What do you find are the differences between Oracle and Postgres?

    Asked once · last asked Oct 29 · Concept · Mid-level

  5. Please describe several database systems, such as PostgreSQL and Oracle.

    Asked once · last asked May 19 · Concept · Mid-level

PostgreSQL data modeling and constraints interview questions

Table design questions cover normalization, relationships, keys, data types, uniqueness, and data quality checks. 12 questions.

  1. How would you implement relationships among projects, team members, and tasks in PostgreSQL?

    Asked once · last asked Sep 30 · Concept · Mid-level

    Other ways it was asked
    • “How would you design PostgreSQL tables for a many-to-many relationship between projects and team members?”
  2. How would you implement data quality checks in PostgreSQL after the data has been loaded?

    Asked once · last asked May 19 · Tooling · Mid-level

  3. What data type do you like to use to represent money in PostgreSQL?

    Asked once · last asked Aug 12 · Concept · Mid-level

  4. In PostgreSQL specifically, how do nulls behave under a unique constraint, and what implication does that have for modeling optional fields that should be unique when present?

    Asked once · last asked Sep 21 · Concept · Mid-level

  5. How would you write a partial unique index in PostgreSQL to enforce unique email only when email IS NOT NULL?

    Asked once · last asked Sep 21 · Write code · Mid-level

  6. How would you implement a many-to-many relationship in PostgreSQL?

    Asked once · last asked Sep 30 · Concept · Mid-level

  7. What are the data type differences between PostgreSQL and Oracle, including character types and length, and what is the impact on the API side?

    Asked once · last asked Oct 16 · Concept · Mid-level

  8. How would you use PostgreSQL to determine whether tables are related and identify those relationships?

    Asked once · last asked Oct 27 · Tooling · Mid-level

  9. In PostgreSQL, what's the practical difference between timestamp and timestamptz? And when would you choose one over the other?

    Asked once · last asked Nov 5 · Concept · Mid-level

  10. What is database normalization, and how is it different from PostgreSQL?

    Asked once · last asked Nov 16 · Concept · Junior

PostgreSQL SQL query interview questions

Query questions cover joins, filtering, aggregation, pagination, upserts, triggers, and full-text search. 6 questions.

  1. How would you set up full-text search in PostgreSQL?

    Asked once · last asked Aug 12 · Tooling · Mid-level

  2. How does pagination work in PostgreSQL, and which SQL keywords would you use?

    Asked once · last asked Sep 30 · Concept · Junior

    Other ways it was asked
    • “Which PostgreSQL keywords can you use to paginate query results?”
    • “What is pagination in PostgreSQL?”
  3. In PostgreSQL, what's the difference between WHERE and HAVING when you're using GROUP BY?

    Asked once · last asked Nov 5 · Concept · Junior

  4. Why use a PostgreSQL trigger instead of creating the profile in the application?

    Asked once · last asked Nov 13 · Design · Mid-level

PostgreSQL indexing and query optimization interview questions

Explore index types, query execution, planner costs, scans, sampling, partitioning, and ways to investigate slow queries. 11 questions.

  1. In a large multi-tenant PostgreSQL schema, when would you choose partitioning by tenant versus keeping a single table with a tenant_id, and what performance or maintenance tradeoffs drive that choice?

    Asked once · last asked Jul 27 · Design · Senior

  2. How does cost estimation work in PostgreSQL query plans?

    Asked once · last asked Aug 12 · Concept · Senior

  3. If a PostgreSQL query plan shows lower execution time but higher estimated cost, how would you interpret and investigate it?

    Asked once · last asked Aug 12 · Scenario · Senior

  4. How does PostgreSQL execute a SQL query?

    Asked once · last asked Oct 7 · Concept · Mid-level

  5. What is a sequential scan, how does PostgreSQL use indexes, and why might it choose not to use an index?

    Asked once · last asked Oct 7 · Concept · Senior

  6. How do B-tree indexes support unique constraints in PostgreSQL, and how does PostgreSQL handle concurrent inserts that would violate the same UNIQUE constraint?

    Asked once · last asked Nov 10 · Concept · Senior

  7. What is the query planner in PostgreSQL?

    Asked once · last asked Oct 7 · Concept · Mid-level

  8. What does PostgreSQL call a deduplicated B-tree tuple?

    Asked once · last asked Oct 24 · Concept · Senior

  9. What sampling algorithm does PostgreSQL use?

    Asked once · last asked Nov 18 · Concept · Mid-level

PostgreSQL transactions and concurrency interview questions

Work through MVCC, isolation levels, locks, concurrent writes, idempotency, and safe coordination between workers. 11 questions.

  1. How does PostgreSQL handle concurrent reads and writes?

    Asked once · last asked Jan 28 · Concept · Senior

  2. How would you implement the conditional write or state-transition part in PostgreSQL under concurrency? What constraints or SQL pattern would you use to ensure only one worker can claim and process a given event ID?

    Asked once · last asked May 29 · Scenario · Senior

  3. For an idempotent event-processing workflow in PostgreSQL, when would you choose SERIALIZABLE isolation over READ COMMITTED with retries, and what failure mode would you expect to handle differently?

    Asked once · last asked May 29 · Concept · Senior

  4. How would you choose and validate an idempotency key for updates in PostgreSQL?

    Asked once · last asked Jun 29 · Scenario · Mid-level

  5. In a high-load Node.js service using PostgreSQL and Redis, how would you prevent race conditions, lost updates, cache inconsistencies, and deadlocks while ensuring correct results?

    Asked once · last asked Oct 7 · Scenario · Senior

  6. How would you prevent double spending in a PostgreSQL wallet when a user initiates simultaneous transactions using SELECT FOR UPDATE, and what should happen if a transaction fails midway?

    Asked once · last asked Nov 6 · Scenario · Mid-level

  7. What trade-offs would you consider when choosing PostgreSQL to coordinate workers instead of Redis or a dedicated message queue?

    Asked once · last asked Nov 10 · Design · Mid-level

    Other ways it was asked
    • “Why did you decide to use PostgreSQL to coordinate the workers instead of something like Redis or a dedicated message queue? What trade-offs did you consider?”
  8. In PostgreSQL, compare MVCC behavior under READ COMMITTED and REPEATABLE READ. What anomalies can still happen in each, and why?

    Asked once · last asked Nov 10 · Concept · Senior

  9. How does PostgreSQL handle updates to rows, and how is that different from other databases?

    Asked once · last asked Nov 16 · Concept · Senior

PostgreSQL application integration and scaling interview questions

Application topics include data flow, ORMs, connection pools, caching, overload protection, and keeping data consistent with external systems. 14 questions.

  1. How would you handle potential data consistency issues between Redis and PostgreSQL in a real-time bidding system?

    Asked once · last asked Jun 29 · Scenario · Senior

  2. How would you preserve the order of updates to Redis and PostgreSQL when using an asynchronous message queue?

    Asked once · last asked Jun 29 · Scenario · Senior

  3. How would you monitor and alert on data consistency issues between Redis and PostgreSQL?

    Asked once · last asked Jun 29 · Scenario · Mid-level

  4. When bursts hit one endpoint, for example around 1k RPS, doing Postgres writes, what Node.js and database-side strategies do you use to prevent overload while keeping latency predictable?

    Asked once · last asked Jul 27 · Scenario · Senior

  5. How would you efficiently handle an API that needs to return data from 10,000,000 student records in a Postgres database?

    Asked once · last asked Jul 27 · Design · Senior

  6. How would you approach deploying a full-stack application on Vercel with PostgreSQL for an MVP and later migrating it to a self-managed server?

    Asked once · last asked Jul 31 · Design · Mid-level

  7. In a React, Node.js, Express, and PostgreSQL app, walk me through the end-to-end data flow when a user submits a form to create a new record, including validation and error handling.

    Asked once · last asked Sep 3 · Scenario · Mid-level

  8. How would you design a scalable full-stack application using Next.js or React, Node.js, GraphQL, and PostgreSQL, including caching and database optimization?

    Asked once · last asked Sep 17 · Design · Senior

    Other ways it was asked
    • “Can you design a scalable full-stack application using Next.js or React, Node.js, GraphQL, and PostgreSQL? What would your approach be for caching and database optimization?”
  9. How would you address scaling bottlenecks when a relational database such as MySQL or PostgreSQL already has read replicas?

    Asked once · last asked Sep 21 · Scenario · Senior

  10. How would you structure an application’s connection to PostgreSQL through an ORM?

    Asked once · last asked Sep 22 · Design · Mid-level

  11. When a commerce application uses Redis and PostgreSQL, what data should be cached in Redis, and which data should remain authoritative in PostgreSQL?

    Asked once · last asked Oct 5 · Design · Mid-level

  12. Design a service that updates its own PostgreSQL database and communicates with two external enterprise systems. One downstream system can occasionally be unavailable. How would you design transaction boundaries, retry and timeout handling, and consistency?

    Asked once · last asked Oct 21 · Design · Senior

Show 1 more
  1. Do Kafka transactions guarantee exactly-once PostgreSQL writes or atomicity between database writes and offset commits?

    Asked once · last asked Nov 11 · Concept · Senior

    Other ways it was asked
    • “Does enabling Kafka exactly-once semantics guarantee exactly-once writes to PostgreSQL?”
    • “Will Kafka transactions automatically make an external PostgreSQL transaction atomic with a Kafka offset commit?”

PostgreSQL migration interview questions

Migration questions cover database conversions, online schema changes, constraint validation, CDC synchronization, and data pipeline moves. 11 questions.

  1. What would you want to understand before migrating R pipelines to dbt or PostgreSQL?

    Asked once · last asked Sep 9 · Scenario · Mid-level

    Other ways it was asked
    • “What would you assess, and what issues would you look for, when migrating R pipelines to dbt or PostgreSQL?”
    • “How would you approach migrating an R data pipeline to PostgreSQL?”
  2. How do you manage database migrations in PostgreSQL while ensuring data integrity?

    Asked once · last asked Jun 26 · Scenario · Mid-level

    Other ways it was asked
    • “How can database migrations in PostgreSQL help preserve data integrity? Can you give an example?”
  3. When migrating from Postgres to MySQL, how would you propagate CDC changes to keep the target system in sync?

    Asked once · last asked Mar 20 · Design · Senior

  4. When you add a new column to a large PostgreSQL table in production, how do you do it to minimize locks and avoid long downtime?

    Asked once · last asked Jul 16 · Scenario · Senior

  5. How would you enforce a NOT NULL constraint on a new PostgreSQL column with minimal impact, and what checks would you run before validating the constraint?

    Asked once · last asked Jul 16 · Scenario · Senior

  6. What locking and blocking risks arise during PostgreSQL constraint validation, and how would you monitor and mitigate them?

    Asked once · last asked Jul 16 · Scenario · Senior

    Other ways it was asked
    • “During PostgreSQL constraint validation, what concurrency or blocking risks remain, and how would you monitor and mitigate them in production?”
    • “What locks does PostgreSQL take during ALTER TABLE VALIDATE CONSTRAINT, and what's one concrete mitigation you'd use if it contends with production traffic?”
  7. How would you structure an end-to-end Oracle-to-PostgreSQL migration using Ora2Pg, and what pitfalls arise when converting PL/SQL to PL/pgSQL?

    Asked once · last asked Jul 16 · Scenario · Senior

  8. What challenges arise when creating a reusable AI prompt to support Oracle-to-PostgreSQL migrations across 10 to 15 applications?

    Asked once · last asked Oct 16 · Scenario · Senior

  9. How would you migrate from MySQL to PostgreSQL and synchronize user data without data loss or downtime?

    Asked once · last asked Oct 22 · Design · Senior

  10. After extracting company data, what transformations would you apply, and would you first store the raw data in a data lake or directly in PostgreSQL?

    Asked once · last asked Nov 20 · Design · Mid-level

    Other ways it was asked
    • “After extracting company data, what transformations would you apply, and would you first store the raw data in PostgreSQL?”

PostgreSQL security and administration interview questions

Administration topics include permissions, row-level security, architecture, memory settings, vacuuming, connectivity, installation, containers, and managed hosting. 15 questions.

  1. How does PostgreSQL SECURITY DEFINER work when used in a trigger?

    Asked once · last asked Nov 13 · Concept · Senior

    Other ways it was asked
    • “How can a PostgreSQL trigger using SECURITY DEFINER access the auth schema without granting the application runtime role access to it?”
  2. What does PostgreSQL's connection limit error mean, and how would you troubleshoot it?

    Asked once · last asked Nov 13 · Scenario · Mid-level

  3. How is PostgreSQL's architecture structured?

    Asked once · last asked May 29 · Concept · Junior

    Other ways it was asked
    • “What is PostgreSQL architecture?”
  4. What are the key differences between PostgreSQL on AWS RDS and a self-managed PostgreSQL database?

    Asked once · last asked Jul 18 · Concept · Mid-level

  5. How would you choose a database for a project hosted on Azure while keeping the option to self-host PostgreSQL?

    Asked once · last asked Oct 2 · Design · Senior

  6. Where would you obtain PostgreSQL binaries from, and how would you evaluate whether that source is suitable?

    Asked once · last asked Oct 12 · Scenario · Senior

  7. How would you create a workable process for your team to build PostgreSQL 16 binaries on a base operating system?

    Asked once · last asked Oct 12 · Scenario · Senior

  8. How can you persist PostgreSQL data in a Docker container so it survives container restarts?

    Asked once · last asked Oct 13 · Scenario · Mid-level

  9. What are the advantages of Amazon Aurora over traditional RDS for MySQL and PostgreSQL?

    Asked once · last asked Oct 22 · Concept · Mid-level

  10. If an application cannot connect to PostgreSQL even though the server is reachable over SSH, what could be causing the problem?

    Asked once · last asked Nov 13 · Scenario · Mid-level

  11. How do you grant a user SELECT permission on a specific PostgreSQL table and set default privileges for future tables?

    Asked once · last asked Nov 13 · Tooling · Mid-level

  12. In PostgreSQL, what is RLS?

    Asked once · last asked Jul 22 · Concept · Junior

Show 2 more
  1. What are the key memory parameters in PostgreSQL?

    Asked once · last asked Aug 30 · Concept · Mid-level

  2. What is maintenance_work_mem in PostgreSQL?

    Asked once · last asked Aug 30 · Concept · Mid-level

PostgreSQL backup and replication interview questions

Backup and replication questions cover full backups, WAL, Barman, replication, failover, consensus, and split-brain prevention. 6 questions.

  1. What is Barman, how does it work with PostgreSQL, and how does streaming WAL archiving differ from network-based archiving?

    Asked once · last asked Jul 16 · Tooling · Senior

  2. Is PostgreSQL using Raft for every transaction?

    Asked once · last asked Aug 21 · Concept · Senior

  3. How do you take a full PostgreSQL backup without pg_dump, and how does WAL support recovery?

    Asked once · last asked Aug 21 · Concept · Mid-level

    Other ways it was asked
    • “What methods can you use to create a full PostgreSQL backup besides pg_dump?”
    • “How can you create a full data backup when the PostgreSQL WAL does not store the full data?”
  4. What information is stored in PostgreSQL's write-ahead log (WAL)?

    Asked once · last asked Aug 21 · Concept · Senior

  5. How does Patroni protect PostgreSQL from split-brain during a network failure between the primary and replicas?

    Asked once · last asked Sep 1 · Concept · Senior

  6. How do you approach PostgreSQL backups and replication?

    Asked once · last asked Nov 13 · Scenario · Mid-level

How this list is made

Every question here was asked by a real interviewer in a real job interview that a candidate ran MeetAssist in. After the call, the interviewer's questions are pulled from the transcript. Practice sessions, tests, exams and anything that was not a job interview are dropped.

Questions are rewritten so they make sense on their own: names of people, employers and clients are removed, and speech-to-text mistakes are fixed. Small talk, logistics and questions about one candidate's own résumé are left out. Rephrasings of the same question are merged, and the count is the number of different interviews it came up in.

The interviews come from candidates who use MeetAssist, so they lean towards software, data and AI roles: the shares describe these interviews, not every PostgreSQL interview. Answers to the most asked questions are written and checked by an editor; a "common mistake" is shown only when reviews of real answers in these interviews show it, with the count.

78 interviews, 64 candidates, Jan 2026 to Nov 2026. Updated every month with new interviews.