NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content

Quiz: DBA / Database

DBA / Database questions from real interviews as a quiz, with an explanation for every option.

Try it: 5 questions

Loading…

Sample questions

  1. A primary uses asynchronous WAL replication. What can happen if it fails before some WAL records reach the replicas?

    • Acknowledged transactions may be lost when a replica is promoted.
    • Only transactions the primary did not acknowledge to the client can be lost.
    • Replicas will automatically recover the missing WAL after the primary fails.
    • No data can be lost because WAL is first written to the primary.
    Full answer
  2. Which statements about heap and append-optimized (AO) tables in Greenplum are correct? Select three.

    • Heap stores rows in physical key order and maintains that order as rows are inserted.
    • AO is generally preferable to heap for frequent random updates and deletes.
    • Heap is generally more suitable for frequent small inserts, updates, and deletes.
    • AO can use either a row-oriented or column-oriented format, and can use compression.
    • AO is optimized for sequential loading and analytical reads over large data volumes.
    Full answer
  3. How are operators and tasks related in Airflow?

    • An operator describes a type of work, while a task is its configured instance in a DAG, with parameters and dependencies.
    • An operator is one execution of a task, while a task is a reusable template that can be run repeatedly.
    • A task describes a type of work, while an operator is its configured instance in a DAG, with parameters and dependencies.
    • An operator schedules the DAG, while a task specifies the order in which operators run.
    Full answer
  4. What is the main difference between Always On Availability Groups and transactional replication in SQL Server?

    • AGs provide database availability and failover between replicas, while transactional replication distributes data changes.
    • Both technologies work the same way and differ only in whether transfer is synchronous or asynchronous.
    • AGs replicate only selected tables, while transactional replication copies an entire SQL Server instance.
    • AGs distribute changes to selected tables for integration, while transactional replication switches an entire database after a failure.
    Full answer
  5. What is the main difference between system-defined and user-defined exceptions in PL/SQL?

    • System exceptions are declared in DECLARE, while user-defined ones are declared only in EXCEPTION.
    • System exceptions usually arise automatically from runtime errors, while user-defined exceptions are declared and raised in code.
    • System exceptions are handled before the block runs, while user-defined ones are handled after it finishes.
    • System exceptions can only be caught with WHEN OTHERS, while user-defined ones are caught by name.
    Full answer
  6. In SQL, how can you roll back only the changes made after a specific point in a transaction while keeping earlier changes?

    • Run ROLLBACK without any additional commands
    • Run COMMIT after each operation
    • Create a SAVEPOINT, then run ROLLBACK TO SAVEPOINT
    • Use BEGIN inside the current transaction
    Full answer
  7. Which descriptions of Python libraries are accurate? Select three options.

    • NumPy provides multidimensional arrays and mathematical functions for computation.
    • PySpark lets Python applications use Apache Spark for distributed data processing.
    • pandas provides DataFrame and Series for working with tabular data.
    • SQLAlchemy is an HTTP client for sending GET and POST requests.
    • requests parses YAML, while PyYAML sends HTTP requests.
    Full answer
  8. Which description of operators, hooks, and XCom in Airflow is correct?

    • An operator connects to an external system, a hook defines a task type in a DAG, and XCom stores files between runs.
    • An operator passes data between tasks, a hook stores DAG state, and XCom manages database connections.
    • Both operators and hooks define DAG tasks, while XCom replaces a shared database for storing results.
    • An operator defines a task type in a DAG, a hook connects to an external system, and XCom passes small values between tasks.
    Full answer
  9. Which statement correctly describes table partitioning in Greenplum?

    • It places a copy of every row on every segment to improve availability.
    • It splits rows across segments by hash and thereby defines the table’s logical partitions.
    • It divides a table logically by a key; distribution across segments is configured separately.
    • It creates an index for every column and replaces the distribution of rows across segments.
    Full answer
  10. Which statement correctly describes the difference between a primary key and a foreign key?

    • Both keys uniquely identify rows, but a primary key can contain NULL.
    • A primary key uniquely identifies a row in its table; a foreign key refers to a key in another table.
    • A primary key refers to another table; a foreign key uniquely identifies a row in its own table.
    • A primary key links tables; a foreign key ensures rows are unique within a table.
    Full answer