美国PostgreSQL DBA面试真题

小布 4月前 284

以下内容均来自美国学员面试过程中雇主提出的问题。

樱桃溪学院会持续搜集、整理、分析这些问题,然后融入到日常的教学过程中。这是一项极其重要的工作,我们坚信:只要常抓不懈,樱桃溪学院的就业率可以超过80%。

 

----------------2025/02/04----

  1. What’s your day to day operations in Wells Fargo? What do you do everyday?
  2. Why do you look for this change now?
  3. In Postgres, what is the difference between the physical and logical backup?
  4. How do you inspect the wal file that we Postgres?
  5. What is the use of pg_rewind?
  6. What is streaming vs logical replication?
  7. How do you monitor the replication lag between primary database and standby database?
  8. How to convert a role to a user in Postgres?
  9. How to stop a particular database in the cluster?
  10. What are the different options and modes in pg_ctl?
  11. What is the smart option in pg_ctl?
  12. What is the difference between explain and explain analyze?
  13. Any experience in migrating Postgres to Oracle?
  14. What is the default streaming replication mode in Postgres? Is it synchronous or asynchronous?
  15. How will you handle the performance issue in Postgres?
  16. What are the different types of indexes in Postgres?
  17. Can we take an incremental backup and Postgres?
  18. How does Postgres handle crash recovery?

 

最新回复 (2)
  • davisz 1月前
    引用 2

    常见的PostgreSQL DBA面试题及答案(基础版):


    1. What is PostgreSQL? What are its key features?
    PostgreSQL is an open-source object relational database system that supports standard SQL and advanced features such as transactions, MVCC, stored procedures, integrity constraints, and extensibility.

    2. How does PostgreSQL implement transaction isolation (MVCC)?
    PostgreSQL uses Multiversion Concurrency Control (MVCC) to provide snapshot isolation for each transaction, preventing read/write blocking. Old versions are cleaned up by VACUUM

    3. What is WAL and why does PostgreSQL use it?
    WAL (Write-Ahead Logging) ensures that changes are logged before being applied to data pages, allowing PostgreSQL to recover from crashes reliably.

    4. What types of backups does PostgreSQL support?
    Logical backups via pg_dump/pg_dumpall, and physical backups via pg_basebackup or file system snapshots.

    5. What is PITR (Point-In-Time Recovery) and how is it used?
    PITR uses a physical base backup along with WAL files and the recovery_target_time parameter to restore the database to a specific time.

    6. How do you verify that a backup is valid?
    You can test restoring the backup in a separate environment, or use tools like pg_verifybackup to validate the backup’s integrity.

    7. What replication methods does PostgreSQL support?
    PostgreSQL supports Streaming Replication (physical) and Logical Replication. The former is for full database replication, while the latter allows more granular control.

    8. What is a replication slot and what is its purpose?
    A replication slot ensures that WAL files are retained until confirmed as received by the subscriber, preventing replication gaps.

    9. How do you configure primary-standby replication?
    Use pg_basebackup to initialize the standby, configure primary_conninfo and create standby.signal. On primary, set wal_level = replica and allow replication connections.

    10. How do you identify slow queries?
    Enable log_min_duration_statement, use the pg_stat_statements extension to view top SQLs, and use EXPLAIN ANALYZE for query plan analysis.


    11. What is the purpose of the work_mem parameter?
    work_mem controls how much memory is available for operations like sorting and hash joins. Too small a value can lead to disk-based operations.

    12. How do you control connection permissions in PostgreSQL?
    Control connections via pg_hba.conf by defining client address ranges and authentication methods (md5, scram-sha-256, etc.). Rules are matched top-down.


    13. How do you grant read-only access to a user?
    Grant CONNECT and USAGE on the database and schema, then GRANT SELECT on the relevant tables.

    14. How do you enable encrypted (SSL/TLS) connections in PostgreSQL?
    Set ssl = on, provide server.crt and server.key, and configure pg_hba.conf to use hostssl entries.

  • davisz 1月前
    引用 3

    Position: PostgreSQL DBA
    Technical Skills:
    ●4+ years of experience with PostgreSQL, including installation, configuration, and performance tuning.
    ●Strong Linux system administration skills.
    ●Proficient with SSH and key-based authentication.
    ●Solid understanding of systems performance and troubleshooting.
    ●Experience with automation tools (e.g., Ansible).
    ●Deep knowledge of PostgreSQL internals.
    ●Experience with high availability (streaming replication, logical replication).
    ●Strong SQL skills: query/schema optimization.
    ●Familiarity with backup and HA strategies.
    ●Understanding of connection poolers/proxies (e.g., PgBouncer).
    ●Ability to troubleshoot methodically and think creatively when necessary.



    ----------------2025/06/27 面试真题----------------
    1. Tell us about yourself and your database experience
    2. How do you contribute to the PostgreSQL community?
    3. If you are given a new server, what configuration would you tune first (OS and PG)?
    4. Have you tuned OS-level parameters for database performance?
    5. Explain the purpose of WAL files and their other uses
    6. Explain how MVCC works in PostgreSQL
    7. Have you ever inspected a core dump using GDB?
    8. Have you used `perf` before?
    9. Have you used `strace`, `ltrace`, or any other low-level debugging tools?
    10. What would you do if a PostgreSQL insert process was stuck and CPU usage was 100%?
    11. How does MVCC interact with the visibility map and affect the query planner or optimizer?
    12. What is the difference between logical and physical backups?
    13. What is your experience with High Availability (HA) in PostgreSQL?
    14. Do you have any experience with Kubernetes for managing PostgreSQL?

返回
发新帖