Google Cloud · Free Practice Questions · Last reviewed May 2026
42real exam-style questions organised by domain, each with the correct answer highlighted and a plain-English explanation of why it's right — and why the others are wrong.
32% of exam · 6 sample questions below
A company needs to store petabytes of time-series IoT sensor data and query it with single-digit millisecond latency at millions of reads per second. The data has a simple key-value structure with timestamps. Which Google Cloud database is MOST appropriate?
Firestore
Cloud Spanner
Cloud Bigtable
Bigtable is the correct choice: wide-column NoSQL, designed for time-series and IoT workloads, single-digit ms latency, and scales to millions of QPS with additional nodes.
BigQuery
You are designing a schema for Cloud Spanner and need to avoid write hotspots. Which primary key design strategy is recommended?
Use the most frequently queried column as the primary key
Use a UUID or hash prefix as the first part of the primary key
UUIDs or hash prefixes distribute writes across tablets, avoiding hotspots.
Use a composite key with the leading column being a timestamp
Use a monotonically increasing timestamp as the primary key
A company is migrating an on-premise PostgreSQL database to Cloud SQL. The current database has a connection pool with 200 connections and uses 64 GB RAM. According to Cloud SQL best practices, what is the maximum recommended max_connections setting?
200
64
4096
64 GB RAM = 65536 MB, divided by 16 gives 4096 connections.
1024
You need to design a Cloud Bigtable row key for a time-series application that records user activity. The most common queries filter by user_id and then by timestamp (most recent first). Which row key design is MOST appropriate?
user_id#timestamp
user_id#reverse_timestamp
This ensures data for a user is together and the most recent entry comes first.
reverse_timestamp#user_id
timestamp#user_id
A company is running a financial application on Cloud Spanner and needs to ensure strong transactional consistency across regions. The application requires both high write throughput (2000 mutations/second) and read throughput (2000 reads/second). According to Spanner capacity planning, how many processing units (PUs) are needed for the combined workload?
2 processing units (PUs)
4 processing units (PUs)
0.5 processing units (PUs)
1 processing unit (PU)
One PU provides 2000 writes/s and 2000 reads/s, exactly matching the requirement.
You are designing a database schema for Cloud SQL (MySQL) for an OLTP application. Which normal form is typically recommended to avoid update anomalies?
Denormalized form
Second Normal Form (2NF)
Third Normal Form (3NF)
3NF eliminates transitive dependencies and is the standard for OLTP.
First Normal Form (1NF)
Want more Design innovative, scalable, and highly available cloud database solutions practice?
Practice this domain25% of exam · 6 sample questions below
Your team manages a Cloud SQL for MySQL instance used by a critical application. You need to ensure the instance is recoverable to any point within the last 4 days, with a Recovery Point Objective (RPO) of under 5 minutes. What configuration steps are required?
Enable automated backups and set the backup retention to 4 days. Binary logging is not required because automated backups already capture all changes.
Enable binary logging and set the binary log retention to 4 days. Automated backups are optional and not needed for PITR.
Create an on-demand backup daily and set binary log retention to 4 days. This provides the same RPO as automated backups with binary logging.
Enable automated backups and binary logging. Set the transaction log retention period to 4 days.
Automated backups plus binary logging (with appropriate retention) enables PITR with a 4-day window.
You are responsible for a Cloud Spanner instance that serves a global user base. A new feature requires adding an index on a column of an existing table that contains millions of rows. The table is actively used by production traffic. What is the recommended approach to add the index with minimal impact?
Create a second table with the index already defined, then copy the data using batch writes and switch traffic. This avoids any impact to the original table.
Take a full database backup to Cloud Storage, restore it to a new instance, create the index on the restored instance, and then fail over to the new instance.
Use the gcloud command 'gcloud spanner databases ddl update' with an ALTER TABLE statement to add the index. This will lock the table briefly but is acceptable.
Use the gcloud command 'gcloud spanner databases ddl update' with a CREATE INDEX statement. The operation will be non-blocking and will not impact production traffic.
Correct. CREATE INDEX in Spanner is an online, non-blocking operation.
Your Cloud Bigtable instance is experiencing high latency for certain row key ranges. You suspect a hotspot is developing. Which Google Cloud tool should you use to visualize and diagnose the hotspot?
Key Visualiser
Key Visualiser is the correct tool for detecting hotspots in Bigtable.
Cloud Monitoring dashboard to check CPU utilization per node
Bigtable's built-in 'hotspot detection' alert in Cloud Monitoring
Cloud Logging to review request logs and identify slow queries
You manage a Memorystore for Redis instance that is regularly hitting its maximum memory limit. The application can tolerate some data loss and prefers to keep the most recently used data. Which eviction policy should you configure?
noeviction
volatile-lru
volatile-lru evicts the least recently used keys among those with an expiry set, matching the requirement.
volatile-ttl
allkeys-lru
Your Firestore database in Native mode is used by a mobile app. You need to query a collection where documents are filtered by two fields: 'status' (string) and 'createdAt' (timestamp). The query is not performing as expected. What action is required?
Create an index exemption for the collection to allow multi-field queries.
Add a third field to the query to make it more specific.
Create a composite index on the 'status' and 'createdAt' fields.
Composite indexes are required for multi-field queries. Firestore does not automatically create them.
Ensure that single-field indexes exist for both 'status' and 'createdAt'.
You need to set up disaster recovery for a Cloud SQL for PostgreSQL instance. The primary instance is in us-central1, and you want a standby in us-west1 that can be promoted to a standalone instance during a regional outage. The solution must minimize data loss and recovery time. Which approach should you take?
Configure cross-region automated backups with a retention of 7 days. In the event of a disaster, restore the latest backup to a new instance in us-west1.
Set up an on-premise PostgreSQL instance and configure streaming replication from Cloud SQL to the on-premise instance.
Create a cross-region read replica in us-west1. During a disaster, promote the replica to a standalone instance.
A cross-region read replica is the best option: it stays up-to-date (asynchronously) and can be promoted quickly.
Use gcloud sql instances create with a backup configuration pointing to us-west1, but this does not create a live standby.
Want more Manage a solution that can span multiple database technologies practice?
Practice this domain23% of exam · 6 sample questions below
A company is migrating their on-premises MySQL database to Cloud SQL using Database Migration Service (DMS). The source database is MySQL 5.7, and the target is a Cloud SQL MySQL 8.0 instance. The migration job is set to continuous, but after the full dump phase, the CDC phase keeps failing with the error 'binary log not found'. What is the most likely cause?
Cloud SQL Auth Proxy is not configured on the source.
The Cloud SQL instance does not have binary logging enabled.
The DMS migration job uses the wrong source connection profile.
The source MySQL binary logs have been purged before DMS could replicate them.
If source binary logs are purged (e.g., due to low retention), DMS cannot find them and CDC fails.
An organization is planning a database migration from Oracle to PostgreSQL on Cloud SQL. They have a large number of stored procedures that use Oracle-specific PL/SQL features. Which tool should they use to automate the schema conversion, including conversion of PL/SQL to PL/pgSQL?
Ora2Pg
Ora2Pg is designed to convert Oracle schemas and objects to PostgreSQL.
pglogical
pg_dump
Database Migration Service (DMS)
A company wants to migrate their on-premises SQL Server database to Cloud SQL for PostgreSQL using Database Migration Service. They need to minimize downtime. The source database is 2 TB and the network link has 1 Gbps bandwidth. What should they do first?
Use pg_dump to export the database and then import into Cloud SQL.
Create a one-time migration job to copy the database during a maintenance window.
Create a continuous migration job with DMS using a VPC peering connection.
Continuous migration allows CDC to replicate changes, minimizing downtime.
Use mysqldump to export and import the database.
A company is migrating an on-premises PostgreSQL 13 database to AlloyDB for PostgreSQL using DMS continuous migration. The source is configured with logical replication using the pglogical extension. During the initial sync, the migration job fails with the error 'could not open relation with OID xxxx'. What is the most likely cause?
The source database has a firewall blocking the DMS IP address.
The source database does not have the pglogical extension installed.
The target AlloyDB cluster does not have the pglogical extension.
A DDL operation on the source dropped or altered a table after the replication slot was created.
DDL changes invalidate the replication slot, causing the relation OID error.
A data engineer is migrating a large Teradata data warehouse to BigQuery using the Schema Conversion Tool (SCTS). They need to convert BTEQ scripts and Teradata DDL to BigQuery-compatible SQL. After conversion, several date functions are not working correctly. What is the most likely reason?
The BigQuery Data Transfer Service is required for date conversion.
The Teradata source has a different date format that is incompatible with BigQuery.
The SCTS tool did not fully convert the Teradata-specific date functions to BigQuery equivalents.
Some Teradata date functions have no direct BigQuery equivalent and require manual adjustment.
BigQuery does not support date arithmetic.
A team is migrating a MySQL database to Cloud SQL using mysqldump for the initial snapshot. The source database uses InnoDB tables. Which mysqldump flags should be used to ensure a consistent snapshot without locking tables?
--single-transaction --skip-lock-tables
--single-transaction provides a consistent snapshot; --skip-lock-tables avoids additional locks.
--all-databases --routines
--lock-tables --single-transaction
--flush-logs --master-data=2
Want more Migrate data solutions practice?
Practice this domain20% of exam · 6 sample questions below
A company needs to store petabytes of time-series IoT sensor data and query it with single-digit millisecond latency at millions of reads per second. The data has a simple key-value structure with timestamps. Which Google Cloud database is MOST appropriate?
Cloud Spanner
BigQuery
Firestore
Cloud Bigtable
Bigtable is the correct choice: wide-column NoSQL, designed for time-series and IoT workloads, single-digit ms latency, and scales to millions of QPS with additional nodes.
A company runs a Cloud SQL for PostgreSQL instance with a cross-region read replica in a different region for disaster recovery. The primary region experiences a complete outage. What is the expected RPO and RTO for promoting the read replica to become the new primary?
RPO: up to 1 hour; RTO: up to 24 hours
RPO: near zero (loss of last few transactions); RTO: under 60 seconds
RPO: zero; RTO: less than 1 minute
RPO: equals the replication lag (seconds to minutes); RTO: minutes (manual promotion)
Cross-region read replicas replicate asynchronously, so RPO is the replication lag. Manual promotion takes minutes to complete and reconfigure.
A global financial services company requires a multi-region Spanner instance with an RPO of zero and an RTO of less than 5 seconds for a critical transactional workload. The application writes to a single region and reads from multiple regions. Which Spanner configuration should they choose?
A single-region configuration with read replicas in multiple zones
A two-region multi-region configuration (e.g., nam6)
Two-region multi-region configs use synchronous replication across two regions, providing RPO=0 and RTO<5s. Nam6 (us-central1 and us-east1) fits this scenario.
A dual-region configuration with two read-write regions and one read-only region
A three-region multi-region configuration (e.g., nam-eur-asia1)
A company uses AlloyDB for an e-commerce platform. They want to achieve the highest availability within a single region. What configuration should they use, and what is the expected failover RTO?
Use a primary instance with a standby in the same zone; RTO less than 10 seconds
Use a primary instance with multiple read pools; RTO less than 5 seconds
Use a primary instance with a cross-region read replica; RTO less than 1 minute
Use a primary instance with a standby in a different zone in the same region; RTO less than 30 seconds
AlloyDB HA uses a primary and standby in different zones within the same region. Automatic failover completes in under 30 seconds.
A company has a Cloud SQL for MySQL instance with point-in-time recovery (PITR) enabled. They need to restore the database to a specific time exactly 2 hours ago to recover from an accidental data deletion. What is the minimum requirement for this operation?
The instance must have a backup window configured within the last 2 hours
The instance must have at least one automatic backup taken after the desired restore time
Binary logging must be enabled, and the transaction log retention period must cover the desired restore time
PITR requires binary logging enabled and a transaction log retention period that includes the restore time (default 7 days).
The instance must be stopped before initiating the restore
A company uses Cloud Spanner and needs to back up a large database (several TB) for compliance reasons. They want to retain the backup for 400 days. What is the optimal approach to meet this requirement?
Create a backup with 365-day retention, and before it expires, create another backup to extend coverage
Create a backup and set the expiration time to 400 days using the gcloud command
Use continuous PITR to retain transaction logs for 400 days
Export the database to Cloud Storage using Dataflow or an export job, which can be retained indefinitely
Exporting to Cloud Storage bypasses the 365-day limit; you can retain exports as long as needed.
Want more Deploy scalable and highly available databases in Google Cloud practice?
Practice this domain49% of exam · 6 sample questions below
A company runs a production Cloud SQL for PostgreSQL instance used by a web application. The instance experiences intermittent latency spikes during peak hours. You need to diagnose the cause without downtime. Which tool should you use first?
Use Database Migration Service to failover to a read replica.
Use Cloud SQL Insights to analyze query performance and identify slow queries.
Cloud SQL Insights provides query-level performance diagnostics without downtime.
Use gcloud sql instances describe to check instance configuration.
Use VPC Flow Logs to analyze network traffic.
A company is migrating an on-premises Oracle database to Cloud SQL for PostgreSQL. The database is 2 TB in size and the network bandwidth to Google Cloud is limited to 500 Mbps. The migration window is 48 hours. Which migration strategy should the Database Engineer recommend?
Create a VPN tunnel and use pg_dump/pg_restore over the network.
Use Database Migration Service with continuous replication.
Export the database to flat files, compress, upload to Cloud Storage, then import to Cloud SQL.
File-based migration with compression can work within the bandwidth and time constraints.
Request a dedicated interconnect and then migrate.
A financial services company uses Cloud Spanner for transaction processing. They need to ensure zero downtime during a schema change that adds a new column with a default value to a large table. Which approach should the Database Engineer take?
Create a new table with the new column, then use a fan-out pattern to write to both tables until the old table is deprecated.
Use an ALTER TABLE statement during a maintenance window.
Drop the table and recreate it with the new schema.
Use ALTER TABLE to add the column; Spanner handles schema changes online.
Spanner schema changes are online and do not cause downtime.
A company runs a BigQuery data warehouse. They notice that query performance has degraded over time. The data is loaded daily from Cloud Storage using batch loads. Which action is most likely to improve query performance?
Partition and cluster tables based on common query filters.
Partitioning and clustering reduce data scanned, improving performance.
Increase the number of slots in the reservation.
Create materialized views for all frequent queries.
Migrate the data to Cloud SQL for better performance.
A gaming company uses Memorystore for Redis to cache player session data. They need to ensure high availability with automatic failover in case of a zone failure. Which configuration should the Database Engineer choose?
Deploy a Standard tier Redis instance with replication across two zones.
Standard tier provides replication and automatic failover.
Deploy a Basic tier Redis instance with multiple read replicas.
Deploy a Memcached cluster with multiple nodes.
Deploy a Basic tier Redis instance in a single zone.
A company is designing a global application using Cloud Spanner. They need to ensure low latency reads and writes across three continents. Which TWO configurations should they consider?
Use a multi-region configuration with leader regions in each continent.
Multi-region with leader regions reduces write latency.
Use a single-region instance and rely on application caching.
Use strongly consistent reads from a single region.
Use read replicas in each continent for stale read use cases.
Read replicas reduce read latency for remote users.
Use interleaved tables to optimize query performance.
Want more Plan and manage database infrastructure practice?
Practice this domain31% of exam · 6 sample questions below
A company is designing a database schema for a global e-commerce platform. Orders are created with high frequency, and order status updates occur frequently. The team needs to choose a primary key strategy for the orders table in Spanner. Which approach minimizes hot-spotting?
Use a monotonically increasing integer (e.g., auto-increment)
Use a timestamp as the primary key
Use a composite key with user_id and order_date
Use a universally unique identifier (UUID) as the primary key
Distributes writes uniformly across splits.
A team is migrating an on-premises PostgreSQL database to Cloud SQL for PostgreSQL. The existing schema uses a large number of foreign key constraints and triggers for data validation. The team wants to minimize migration effort and maintain data integrity. Which schema design approach is most appropriate for Cloud SQL?
Keep the existing foreign keys and triggers as-is in Cloud SQL for PostgreSQL
Cloud SQL supports these features, minimizing migration effort.
Migrate to Cloud Spanner and use interleaved tables to simulate foreign keys
Remove all foreign keys and triggers and implement validation in the application layer
Convert the schema to use Firestore in Datastore mode with composite indexes
A team is designing a schema for a time-series database in Bigtable to store IoT sensor readings. Each sensor sends a reading every minute. The team needs to create a row key that supports efficient queries for a specific sensor's readings over a time range. Which row key design is most appropriate?
timestamp#sensor_id
hash(sensor_id)#timestamp
sensor_id#reverse_timestamp
Groups all readings for a sensor together in reverse chronological order.
random_UUID
A company is using Cloud Spanner to manage financial transactions. The current schema has a single table 'Transactions' with a composite primary key (account_id, transaction_timestamp). The company frequently queries the latest transaction for each account. This query pattern is causing full table scans. Which schema design change would most improve query performance?
Add a secondary index on (account_id, transaction_timestamp DESC)
Change the primary key to (transaction_timestamp, account_id) and use interleaving
Create a separate 'LatestTransaction' table keyed by account_id, and update it whenever a new transaction occurs
Enables direct point reads for the latest transaction.
Add a 'is_latest' boolean column to the Transactions table and index it
A team is designing a relational schema for a new application on Cloud SQL. The schema includes a table 'Orders' and a table 'Customers'. Each order belongs to one customer. The team anticipates high write throughput and needs to enforce referential integrity. Which schema design is most appropriate?
Use Cloud Spanner interleaved tables with Orders as a child of Customers
Implement referential integrity checks in the application code and omit database constraints
Store order data as a JSON array in a column of the Customers table
Use a foreign key constraint from Orders.customer_id to Customers.customer_id
Enforces integrity efficiently within the database.
A team is designing a schema for a user activity logging system using Bigtable. Each log entry includes a user ID, activity type, timestamp, and details. The access pattern requires retrieving all activities for a specific user within a time range. Which TWO row key designs are suitable? (Choose TWO.)
timestamp#user_id
random_uuid
reverse_timestamp
user_id#activity_type#timestamp
Allows filtering by activity type within a user.
user_id#timestamp
Groups all activities for a user together in time order.
Want more Design and implement database schemas practice?
Practice this domain20% of exam · 6 sample questions below
You are managing a Cloud SQL for PostgreSQL instance that is experiencing high CPU usage and slow query performance. You notice that the database has a high number of idle-in-transaction connections. Which immediate action should you take to reduce CPU load without disrupting active transactions?
Use VPC firewall rules to block new connections until the issue resolves.
Kill all idle-in-transaction connections using pg_terminate_backend.
Set the cloudsql.enable_idle_in_transaction_session_timeout flag to true and configure idle_in_transaction_session_timeout.
This flag automatically terminates idle-in-transaction sessions after a specified timeout, reducing CPU usage without manual intervention.
Set a statement_timeout at the session level for new connections.
A team is deploying a new application on Google Kubernetes Engine (GKE) that uses Cloud Spanner. They want to minimize latency for read operations. Which Spanner configuration should they use?
Use a multi-region configuration with default leader preference set to the region where the application runs.
Use a regional instance with read replicas in the same region.
Use a single-region instance and configure the leader preference to the application's zone.
A single-region instance with leader preference set to the application's zone ensures the leader is local, minimizing read latency.
Use a single-region instance and enable read-only replicas in multiple zones.
Your Cloud SQL for MySQL instance is experiencing intermittent performance degradation. You suspect that the issue is due to a sudden spike in connections from a specific application. Which metric and monitoring approach would best help you correlate the connection spike with performance degradation?
Monitor 'cloudsql.googleapis.com/network/received_bytes_count' and compare with connection count.
Monitor 'cloudsql.googleapis.com/database/mysql/replication/seconds_behind_master' and compare with query latency.
Monitor 'cloudsql.googleapis.com/instance/uptime' and check for instance restarts during degradation.
Monitor 'cloudsql.googleapis.com/database/mysql/threads/threads_connected' and correlate with CPU utilization and query latency.
Threads connected directly indicates active connections, and correlating with CPU and latency helps identify the impact.
You are running a production workload on Cloud Bigtable and notice that read latency has increased. Upon reviewing the monitoring dashboard, you see that CPU utilization is below 50% but the number of active tablets is high. What is the most likely cause of the increased read latency?
Read requests are being throttled due to exceeding IOPS limits.
There are too many tablets, causing increased metadata operations and slower reads.
Excessive tablets increase the overhead of metadata lookups and tablet splitting, leading to higher latency.
A hot node is throttling read requests.
The cluster is underprovisioned, causing resource contention.
A developer has deployed a new version of an application that uses Cloud SQL. After the deployment, you notice a sharp increase in the number of slow queries. What should you do first to identify the problematic queries?
Check the slow query log in Cloud Logging and look for queries with high rows_examined.
Use Cloud SQL Query Insights to identify the queries with the highest latency and examine their execution plans.
Query Insights provides detailed query performance data without additional overhead.
Increase the instance tier to reduce the impact of slow queries.
Enable the general query log and parse the log file to find slow queries.
Which TWO actions can help reduce the number of read replicas needed for a Cloud SQL for PostgreSQL instance that serves a read-heavy workload?
Implement connection pooling to reuse database connections.
Reduces connection overhead and improves replica efficiency.
Enable synchronous replication on all read replicas.
Use smaller machine types for read replicas.
Use application-level caching (e.g., Redis) to cache frequent read results.
Offloads read requests from the database, reducing replica load.
Increase the max_connections parameter on the primary instance.
Want more Monitor and optimize database performance practice?
Practice this domainThe PCDE exam has 60 questions and must be completed in 120 minutes. The passing score is 720/1000.
Scenario-based questions covering exam objectives with detailed answer explanations.
The exam covers 7 domains: Design innovative, scalable, and highly available cloud database solutions, Manage a solution that can span multiple database technologies, Migrate data solutions, Deploy scalable and highly available databases in Google Cloud, Plan and manage database infrastructure, Design and implement database schemas, Monitor and optimize database performance. Questions are weighted by domain — higher-weight domains appear more on your actual exam.
No. These are original exam-style practice questions written against the official Google Cloud PCDE exam objectives. They are not copied from the real exam. Courseiva focuses on genuine understanding, not memorisation of braindumps.
Courseiva tracks your accuracy per domain and routes you toward weak areas automatically. Free, no account required.