Professional Cloud Database Engineer Free Practice Questions
This is the free Google Professional Cloud Database Engineer practice question bank —
90 of 167 total questions, each with a full explanation, free to
read with no signup required. Updated 2026-04-24.
Every answer is verified against official Google documentation —
see our methodology.
Question 1
Your e-learning platform runs on a Cloud SQL for PostgreSQL instance (16 VCPUs, 60 GB memory and 1TB SSD) serving users in North America. Your analytics team runs complex reporting queries that often consume 80% of CPU resources, causing slow response times for student transactions during peak hours. Current workload includes 8,000 transactions per second with 60% reads and 40% writes. The reporting queries involve JOIN operations across multiple large tables with millions of rows requiring highly efficient analytical processing. The platform also experiences sudden spikes in analytical reporting demand, requiring an elastic scaling of read capacity. You need to improve the query performance for your analytics team to run their reports efficiently without impacting transactional users. You also need to plan for future traffic growth. What should you do?
A. Upgrade to Cloud SAL for PostgreSQL Enterprise Edition and route transaction and analytical queries to the primary instance.
B. Migrate to AlloyDB for PostgreSQL and upgrade the machine type of the primary instance to 32 vCPU. Create materialized views for common analytical queries.
C. Migrate to AlloyDB for PostgreSQL with a 16 vCPU primary instance and enable columnar engine for analytical workloads, using read pools for query isolation.
D. Upgrade the Cloud SQL for PostgreSQL instance to db-n1-highmem-32 and implement connection pooling with PgBouncer to handle increased load.
Show Answer
Correct Answer: C
Explanation: The main problem is heavy analytical queries competing with high‑TPS transactional workloads, causing CPU contention and latency. AlloyDB for PostgreSQL is designed for this mixed workload scenario. Enabling the columnar engine accelerates large JOIN‑heavy analytical queries across millions of rows, while read pools provide elastic, isolated read scaling so reporting queries do not impact transactional users. Keeping a 16 vCPU primary is sufficient because analytics are offloaded to read pools, and the architecture also supports future traffic growth and sudden reporting spikes. Other options either keep all workloads on a single primary or only scale vertically, which does not solve query isolation or analytical efficiency.
Question 2
You have a regional Spanner instance with no autoscaler that is serving a production workload. You observed a surge in write activities to the database during an ongoing promotional event. You received an alert that the database is close to the storage limit. Based on the storage utilization trend, the database will run out of storage in the next few hours. You want to resolve this issue as soon as possible. What should you do?
A. Create a custom instance configuration and add a custom read-only replica to the Spanner instance.
B. Increase the compute capacity of the Spanner instance.
C. Move the Spanner instance to a multi-regional configuration.
D. Archive and delete historical data from the database.
Show Answer
Correct Answer: B
Explanation: The immediate risk is running out of Spanner storage within hours. In Cloud Spanner, available storage scales with compute capacity (nodes or processing units). Increasing compute capacity quickly increases the storage limit and is the fastest, recommended mitigation during a surge. Adding replicas or moving to multi-region does not increase storage capacity, and archiving/deleting data is risky and not fast enough for an urgent production incident.
Question 3
Your company is using a multi-region Spanner instance. The instance stores data from an application which does a lot of writes without reading the data. You are noticing a lot of latency regression. You want to reduce latency and improve performance. What should you do?
A. Enable leader-aware routing in the client library.
B. Add additional indexes to the table.
C. Disable leader-aware routing in the client library.
D. Increase the number of Spanner nodes.
Show Answer
Correct Answer: A
Explanation: In a multi-region Cloud Spanner instance, all writes must be sent to the leader replica of the data. Without leader-aware routing, write requests may first go to a non-leader replica and then be forwarded to the leader, adding extra network hops and increasing latency. Since the workload is write-heavy and does not depend on reads, enabling leader-aware routing allows the client to send writes directly to the leader replica, reducing latency and improving performance. Adding indexes would worsen write latency, disabling leader-aware routing would increase latency, and adding nodes helps throughput but does not address cross-region write latency.
Question 4
You are planning the migration of a large Oracle database to AlloyDB for PostgreSQL. The database contains a large amount of application logic written as stored procedures that needs to be migrated to the target database. You want to minimize both migration effort and downtime for the migration. What should you do?
A. Use Ora2pg for schema and code conversion and data migration.
B. Use Ora2pg for schema and code conversion. Use the oracle_fdw extension in AlloyDB and replicate data from source to destination by using CREATE TABLE AS SELECT statements.
C. Use Database Migration Service. Set up a conversion workspace for schema and code conversion. Create a migration job to perform backfill and change data capture to replicate data from source to destination.
D. Use Database Migration Service. Set up a legacy conversion workspace for schema and code conversion. Create a migration job to perform backfill and change data capture to replicate data from source to destination.
Show Answer
Correct Answer: C
Explanation: To minimize both migration effort and downtime when moving a large Oracle database with extensive stored procedures to AlloyDB, the best approach is to use Database Migration Service (DMS) with a conversion workspace. The conversion workspace automates schema and stored procedure conversion from Oracle to PostgreSQL-compatible formats, reducing manual effort. A DMS migration job supports initial backfill followed by change data capture (CDC), allowing continuous replication from Oracle to AlloyDB and enabling a near‑zero‑downtime cutover. Ora2pg alone requires more manual coordination for data synchronization and typically results in higher downtime for large, actively changing databases.
Question 5
Your application uses a Cloud SQL for MySQL instance. Recently, you have noticed performance degradation during peak hours, leading to slow response times and frustrated users. You suspect that inefficient queries might be contributing to these issues. You want to pinpoint and analyze these problematic queries and pass them to the application team for optimizations. What should you do?
A. Use the underprovisioned instance recommender.
B. Increase the Cloud SQL instance read_buffer_size flag.
C. Enable and use Query Insights.
D. Create a Cloud Monitoring alert based on the database/mysql/queries metric.
Show Answer
Correct Answer: C
Explanation: Query Insights for Cloud SQL for MySQL identifies slow and resource-intensive queries by analyzing execution time, frequency, and wait events. It is specifically designed to pinpoint inefficient queries so they can be reviewed and optimized by the application team. The other options either adjust resources or provide indirect signals without identifying problematic queries.
Question 6
You are using Memorystore for Redis to cache frequently accessed data and improve your application’s performance. In the event of a complete regional outage, the application will failover to another region. You want to ensure that the Memorystore instance in the new region does not start from an empty cache after failover. What should you do?
A. Use Memorystore Standard Tier. Disable read replicas.
B. Use Memorystore Standard Tier. Configure at least one read replica.
C. Schedule exports of the Memorystore instance. Specify a dual-region Cloud Storage bucket as the export destination.
D. Enable Redis RDB snapshots for Memorystore.
Show Answer
Correct Answer: D
Explanation: Memorystore for Redis is a regional service; Standard Tier replicas and high availability only protect against zonal failures, not complete regional outages. To avoid starting with an empty cache after failing over to another region, you need a way to restore data into a new Redis instance. Enabling Redis RDB snapshots allows you to back up the dataset and restore it into a Memorystore instance in a different region. Scheduled exports to Cloud Storage are not the standard or recommended mechanism for Memorystore cross-region recovery, whereas RDB snapshots are explicitly designed for backup and restore scenarios.
Question 7
You are migrating an on-premises online transactional process (OLTP) PostgreSQL database to Google Cloud. You want to reduce the administrative overhead on database maintenance activities, such as vacuum and memory tuning. You are also planning to introduce analytic use cases in this database. You need the migration to have minimal schema and application changes. What should you do?
A. Use Spanner with PGAdapter.
B. Use Cloud SQL for PostgreSQL.
C. Use AlloyDB for PostgreSQL.
D. Deploy a self-managed PostgreSQL database on Compute Engine.
Show Answer
Correct Answer: C
Explanation: AlloyDB for PostgreSQL is a fully managed, PostgreSQL‑compatible service that minimizes administrative overhead such as vacuuming and memory tuning. It is optimized for both OLTP and analytical workloads, supports PostgreSQL extensions, and requires minimal schema and application changes compared to self‑managed PostgreSQL or Cloud SQL. Spanner with PGAdapter would require more architectural changes, and self‑managed PostgreSQL increases maintenance effort.
Question 8
Your company is migrating from an on-premises database to a single-region Spanner instance. The current database supports 40,000 reads each second, and 7,000 writes each second, at 1 KB row sizes at peak. You need to determine the most cost-effective size for the Spanner instance to handle the equivalent current workload. What should you do?
A. Select a 4-node Spanner instance.
B. Select a 6-node Spanner instance.
C. Select a 1-node Spanner instance.
D. Recommend a multi-region Spanner instance.
Show Answer
Correct Answer: A
Explanation: For single‑region Cloud Spanner, a common sizing guideline at ~1 KB rows is about 10,000 reads/sec and ~2,000 writes/sec per node. The workload requires 40,000 reads/sec (≈4 nodes) and 7,000 writes/sec (≈3.5 nodes, round up). Reads and writes together point to 4 nodes as the smallest, most cost‑effective size that meets peak demand. A multi‑region instance is unnecessary for this requirement.
Question 9
You are a DBA at a retail company. The production databases are running in Cloud SQL for MySQL Enterprise Plus edition, version 8.0.34, in the us-centrall region. You need to set up and test disaster recovery (DR) with zero data loss in the us-west1 region. What should you do?
A. Use advanced DR by setting up a cascading read replica in the us-west1 region, and designate it as the failover DR replica. Test switchover by using the gcloud switchover command.
B. Create a cross-region read replica, version 8.0.37, in the us-west1 region. Designate it as the failover DR replica, and test switchover by using the gcloud switchover command.
C. Create a cross-region read replica version 8.0.34, in the us-west1 region. Designate it as the failover DR replica, and test switchover by using the gcloud switchover command.
D. Create a cross-region read replica, version 8.0.34, in the us-west1 region. Test switchover by using the gcloud promote-replica with failover command.
Show Answer
Correct Answer: C
Explanation: Zero data loss DR in Cloud SQL for MySQL requires a cross-region read replica using the same major and minor engine version as the primary. For MySQL Enterprise Plus, DR is achieved via cross-region read replicas with controlled switchover. Advanced DR with cascading replicas is not required here, and replica version upgrades (8.0.37) are not supported for replication from a lower version primary. The correct way to test DR is a planned switchover using the gcloud switchover command, not promote-replica failover. Therefore, creating a cross-region read replica in us-west1 on version 8.0.34 and testing switchover is correct.
Question 10
You want to migrate an on-premises MySQL database to Cloud SQL. The on-premises database currently has 16 cores and 64 GB of RAM and averages 75% CPU utilization to support an application with over 100.000 tables. You need to specify the most cost-effective machine size you need when migrating to Cloud SQL for MySQL. What should you do?
A. Select a Cloud SQL for MySQL database with a machine configuration of 12 cores and 48 GB of RAM.
B. Select a Cloud SQL for MySQL database with a machine configuration of 16 cores and 64 GB of RAM.
C. Select a Cloud SQL for MySQL database with a machine configuration of 32 cores and 256 GB of RAM.
D. Select a Cloud SQL for MySQL database with a machine configuration of 64 cores and 768 GB of RAM.
Show Answer
Correct Answer: C
Explanation: Although CPU utilization might suggest a smaller instance, the dominant constraint is the very high number of tables (>100,000). Cloud SQL for MySQL has documented recommendations/SLA considerations for high table counts, requiring larger instances to avoid metadata, file descriptor, and memory pressure issues. To support more than 50,000 tables and remain within recommended limits, Google Cloud requires at least ~32 vCPUs and ~200 GB RAM. Option C (32 cores, 256 GB RAM) is therefore the smallest—and most cost‑effective—configuration that meets this requirement.
$19
Get all 167 questions with detailed answers and explanations
Instant download HTML + PDF delivered the moment payment clears.
Secure Stripe checkout we never see or store your card details.
7-day refund if files are defective see our refund policy.