Home / Google Cloud Professional Cloud Database Engineer / Mock exam
Google Cloud Professional Cloud Database Engineer Exam-style mock test

Google Cloud Professional Cloud Database Engineer Practice Exams|Practice test

Full explanations Exam format Pass line 70%
33 USD One-time · lifetime access
Enroll →

Sample questions

Example1 · Database Design and Migration Strategy on Google Cloud
A B2B SaaS company runs a multi-tenant invoicing platform that needs globally consistent writes across three continents, horizontal scalability to thousands of transactions per second, and a 99.999% SLA without the team managing shards manually. Which Google Cloud database service best fits these requirements?
・Cloud SQL for PostgreSQL configured with a regional high-availability pair plus several cross-region read replicas
Incorrect. Cloud SQL read replicas only scale reads and do not provide globally consistent synchronous writes or a five-nines SLA across continents.
✓Cloud Spanner with a multi-region configuration to deliver global strong consistency and automatic sharding
Correct. Cloud Spanner's multi-region configuration gives global strong consistency, automatic sharding, and a 99.999% availability SLA for this workload.
・AlloyDB for PostgreSQL running in a single region with multiple read pool instances for scaling reads
Incorrect. AlloyDB scales reads well but a single-region deployment cannot deliver globally consistent writes across three continents.
・Bigtable provisioned as a multi-cluster instance with application-managed secondary indexes for the invoices
Incorrect. Bigtable is a NoSQL wide-column store without multi-row ACID transactions, so it cannot guarantee consistent invoicing writes.
Explanation
Global strong consistency with horizontal write scaling and a five-nines SLA is the signature use case for multi-region Cloud Spanner.
Example2 · Cloud SQL and AlloyDB Management
A B2B SaaS company runs its billing service on a regional Cloud SQL for PostgreSQL instance. The team needs automatic failover so that a zonal outage does not take the billing database offline. Which configuration meets this requirement?
✓Enable the high availability configuration so a standby instance is maintained in a second zone within the same region for automatic failover
Correct. Cloud SQL HA maintains a synchronized standby in a different zone of the same region and fails over automatically on zonal failure.
・Create a cross-region read replica in another region and promote it manually whenever the primary zone becomes unavailable
Incorrect. A cross-region replica requires manual promotion and is for regional disaster recovery, not automatic zonal failover.
・Deploy the instance as a zonal configuration and rely on scheduled on-demand backups taken every hour for recovery
Incorrect. A zonal instance with hourly backups still goes offline during a zonal outage and requires manual restore.
・Attach additional read replicas in the primary zone to spread connections and absorb the load during an outage
Incorrect. Read replicas offload reads but do not provide automatic failover for the writable primary.
Explanation
Cloud SQL high availability provides an automatic cross-zone standby within the region, which is what protects against a zonal outage.
Example3 · Spanner, Bigtable, and Firestore (NoSQL and Scale)
A B2B SaaS invoicing platform needs a transactional database for a new global billing ledger. The team requires strong consistency, relational SQL, and horizontal scaling across three continents with externally consistent transactions. Which Google Cloud database best fits these requirements?
✓Cloud Spanner, because it provides a relational schema with SQL and horizontally scalable, externally consistent transactions worldwide
Correct. Spanner uniquely combines relational SQL, horizontal scalability, and external consistency across multiple regions and continents.
・Cloud Bigtable, because it offers a wide-column store with very high write throughput and millisecond latency at scale
Incorrect. Bigtable has no relational schema or multi-row ACID transactions, so it cannot serve a relational billing ledger.
・Firestore in Native mode, because it gives a document model with automatic multi-region replication and offline sync
Incorrect. Firestore is a document database without a relational SQL model and is not designed for a relational ledger.
・Cloud SQL for PostgreSQL with read replicas, because it supports standard SQL and can serve reads from several regions
Incorrect. Cloud SQL read replicas scale reads but writes stay in a single primary region, so it cannot scale writes globally.
Explanation
Spanner is the only Google Cloud service that offers relational SQL, horizontal write scaling, and externally consistent global transactions.
Example4 · High Availability, DR, Backup, and Security
A healthcare services firm runs its patient-scheduling application on a Cloud SQL for PostgreSQL instance in us-central1. The compliance team requires that the database survive a single-zone outage with automatic failover and minimal data loss. Which configuration should the database engineer apply to the primary instance?
✓Enable the high availability configuration so a synchronous standby runs in a separate zone within the same region
Correct. Cloud SQL HA provisions a synchronous standby in a different zone of the same region, giving automatic failover with no committed-data loss.
・Create several read replicas spread across multiple zones and promote one manually during an outage
Incorrect. Read replicas use asynchronous replication and require manual promotion, so failover is neither automatic nor guaranteed lossless.
・Enable point-in-time recovery and restore the instance into another zone whenever a zonal outage occurs
Incorrect. Point-in-time recovery is a backup-restore workflow for data recovery, not an automatic zonal failover mechanism for availability.
・Deploy a cross-region replica in us-east1 and redirect application traffic to it during an outage
Incorrect. A cross-region replica addresses regional disaster recovery, not automatic same-region zonal failover, and replication is asynchronous.
Explanation
Same-region automatic zonal failover with no committed-data loss is delivered by the Cloud SQL HA configuration, which maintains a synchronous standby in another zone.
Example5 · Monitoring, Performance, and Cost Optimization
A healthcare services firm runs a patient-portal API on a Cloud SQL for PostgreSQL instance. Clinicians report that the appointment-lookup page intermittently stalls, but CPU and memory metrics look normal. The team needs to pinpoint which specific SQL statements are slow and see their execution plans without installing third-party agents. What should the database engineer do first?
✓Enable Query Insights on the Cloud SQL instance and review the top queries, their latency, and tags by database and end user
Correct. Query Insights provides per-query latency, normalized statements, and execution plan sampling tagged by database and user without extra agents.
・Export the PostgreSQL error logs to Cloud Logging and build a log-based metric that counts statement duration warnings
Incorrect. Error logs capture duration warnings only when thresholds are set and lack normalized per-query aggregation and plan detail.
・Increase the instance machine type to a larger tier so that the appointment-lookup queries complete faster during peak hours
Incorrect. Scaling the machine type may mask the symptom but does not identify which statements are slow or why.
・Attach a read replica and route the appointment-lookup traffic to it so that the slow statements no longer affect the primary
Incorrect. A read replica distributes load but does not diagnose which queries are slow or expose their execution plans.
Explanation
Query Insights is the native Cloud SQL tool for identifying slow queries, their execution plans, and attributing load to databases and users.
Example6 · Database Design and Migration Strategy on Google Cloud
A healthcare services firm is building a new patient appointment platform serving clinics across three continents. The platform requires a single logical database with strong external consistency, horizontal write scaling, and 99.999% availability. Which Google Cloud database service best fits these requirements?
・Cloud SQL for PostgreSQL configured with cross-region read replicas and automated failover to a standby instance in another region
Incorrect. Cloud SQL scales reads with replicas but does not scale writes horizontally and does not offer 99.999% availability across regions.
✓Cloud Spanner, which provides horizontally scalable writes, external consistency, and a multi-region configuration for high availability
Correct. Cloud Spanner delivers horizontal write scaling, external consistency, and a multi-region configuration meeting 99.999% availability.
・AlloyDB for PostgreSQL deployed in a single region with multiple read pool instances behind a load balancer for scaling
Incorrect. AlloyDB is regional and scales reads with read pools, but it does not provide global horizontal write scaling or multi-region writes.
・Bigtable configured with a multi-cluster routing policy and replication across regions for globally distributed access
Incorrect. Bigtable is a wide-column NoSQL store without the relational schema and strong external consistency this OLTP workload requires.
Explanation
Cloud Spanner is the only Google Cloud service that combines relational semantics, horizontal write scaling, external consistency, and a multi-region 99.999% availability SLA.
Example7 · Database Design and Migration Strategy on Google Cloud
UrbanThread, a fashion retailer, runs a transactional order-entry system that must stay available across multiple continents, scale horizontally to millions of writes during flash sales, and present a single global relational schema with strong consistency. Which Google Cloud managed database best fits these requirements?
・Cloud SQL for PostgreSQL configured with cross-region read replicas placed near each regional storefront
Incorrect. Cloud SQL scales reads with replicas but keeps a single primary for writes, so it cannot absorb globally distributed high-volume writes with one schema.
✓Cloud Spanner, which provides horizontally scalable, strongly consistent relational storage across regions
Correct. Spanner is a horizontally scalable, strongly consistent relational database designed for global multi-region transactional workloads.
・Bigtable, which offers wide-column storage tuned for high-throughput time-series and analytical access
Incorrect. Bigtable is a NoSQL wide-column store without relational schema or multi-statement SQL transactions, so it does not match a relational order-entry system.
・AlloyDB for PostgreSQL deployed as a single primary with several read pool instances in one region
Incorrect. AlloyDB is regional with a single write primary, which limits global write scale even though its read pools serve many readers.
Explanation
Global scale, horizontal write scaling, and strong relational consistency together point specifically to Cloud Spanner.
Example8 · Database Design and Migration Strategy on Google Cloud
UrbanThread needs to migrate a 4 TB on-premises MySQL catalog database to Cloud SQL for MySQL while keeping store downtime to a few minutes during the final switchover. Which migration approach should the database engineer choose?
・Export the database to a SQL dump file, upload it to Cloud Storage, and import it into a freshly created Cloud SQL instance
Incorrect. A dump-and-import is a one-time offline copy, so a 4 TB load forces extended downtime rather than a few-minute cutover.
✓Use Database Migration Service with a continuous replication job that keeps the destination synchronized until a brief cutover
Correct. Database Migration Service performs an initial load plus continuous change data capture, allowing a near-zero-downtime cutover.
・Provision a Cloud SQL instance and manually replay application traffic against both databases until they converge
Incorrect. Replaying application traffic against two databases is error-prone, does not guarantee consistency, and is not a supported migration path.
・Take a nightly filesystem snapshot of the source server and restore the snapshot onto Compute Engine disks
Incorrect. Filesystem snapshots are not a supported logical migration into managed Cloud SQL and would not minimize switchover downtime.
Explanation
Minimal-downtime migrations rely on continuous replication, which Database Migration Service provides for MySQL into Cloud SQL.
Example9 · Database Design and Migration Strategy on Google Cloud
UrbanThread is designing a Cloud Spanner table that records loyalty points earned every second by millions of customers. The team initially proposed a monotonically increasing timestamp as the primary key. What should the database engineer recommend to avoid write hotspots?
・Keep the timestamp primary key but add more nodes to the Spanner instance so writes spread evenly
Incorrect. Adding nodes does not fix a sequential key, because all new rows still land in one lexicographic range and overload a single split.
✓Prefix the key with a hashed or UUID-based customer identifier so writes distribute across the key space
Correct. Leading the key with a high-cardinality hashed or random value spreads inserts across splits and removes the hotspot.
・Store the timestamp as a descending-order key so the newest rows are always written first
Incorrect. Reversing sort order still writes sequentially into one range, so the hotspot simply moves rather than disappearing.
・Create a secondary index on the timestamp column and let Spanner route inserts through the index
Incorrect. A secondary index on the timestamp does not change where base-table inserts land and can create its own hot index range.
Explanation
Hotspots in Spanner come from sequential keys; a high-cardinality prefix is the standard fix to distribute writes.
Example10 · Database Design and Migration Strategy on Google Cloud
A financial services firm runs a trading platform that must process strongly consistent transactions across customers in North America, Europe, and Asia, with a committed 99.999% availability SLA and horizontal scale beyond a single machine. Which Google Cloud database service should the architect choose?
・Cloud SQL for PostgreSQL configured with a regional high-availability pair and several cross-region read replicas serving each continent
Incorrect. Cloud SQL scales up a single primary and read replicas are eventually consistent, so it cannot deliver global strong consistency or the five-nines SLA.
✓Cloud Spanner provisioned as a multi-region instance so it offers external consistency and horizontal scale
Correct. A multi-region Cloud Spanner instance provides external (strong) consistency globally, horizontal scale, and a 99.999% availability SLA.
・AlloyDB for PostgreSQL deployed in one primary region with read pool instances added in every other region
Incorrect. AlloyDB is a single-region relational engine; its cross-region reads are replicas and it does not offer a global 99.999% strongly consistent write SLA.
・Bigtable configured as a multi-cluster instance that replicates application rows eventually across the three continents
Incorrect. Bigtable is a NoSQL wide-column store with eventual replication and no multi-row transactional SQL, so it does not fit strongly consistent trading transactions.
Explanation
Global, strongly consistent, horizontally scalable relational workloads with a 99.999% SLA map directly to multi-region Cloud Spanner.
Example11 · Database Design and Migration Strategy on Google Cloud
A bank must migrate a 4 TB on-premises PostgreSQL database that backs an online banking portal to Cloud SQL for PostgreSQL with a cutover window measured in minutes. Which migration approach best meets the low-downtime requirement?
・Export the database to a SQL dump file, upload it to a Cloud Storage bucket, and import it into the new Cloud SQL instance during the maintenance window
Incorrect. A dump-and-import of 4 TB requires freezing writes during the whole load, producing hours of downtime rather than minutes.
✓Use Database Migration Service with a continuous replication job so ongoing changes are applied until a brief promotion cutover
Correct. Database Migration Service performs an initial full load then streams ongoing changes via continuous replication, keeping downtime to a short promotion step.
・Stand up Cloud SQL and rewrite the application to dual-write to both the old and new databases until records match
Incorrect. Application dual-write is a complex custom pattern, is error-prone to reconcile, and is unnecessary when managed continuous replication exists.
・Take a storage snapshot of the on-premises volume and restore that block image onto a Cloud SQL instance
Incorrect. Cloud SQL is a managed service and cannot restore an arbitrary on-premises block snapshot of the source volume.
Explanation
Continuous replication through Database Migration Service minimizes downtime by keeping source and target in sync until a quick cutover.
Example12 · Database Design and Migration Strategy on Google Cloud
A manufacturing distributor runs an order-management system on a single PostgreSQL instance that handles regional traffic. Leadership wants a managed Google Cloud service that keeps full PostgreSQL compatibility, improves transactional read performance for reporting, and avoids application rewrites. Which service should the database engineer recommend?
・Deploy the workload on Cloud SQL for MySQL and rewrite the application queries to target the MySQL dialect for better compatibility
Incorrect. Switching to the MySQL dialect breaks PostgreSQL compatibility and forces exactly the application rewrite leadership wants to avoid.
✓Migrate the workload to AlloyDB for PostgreSQL to keep compatibility and gain analytical acceleration
Correct. AlloyDB for PostgreSQL is wire-compatible with PostgreSQL and adds a columnar engine that accelerates analytical reads without rewrites.
・Re-platform the relational schema onto Cloud Bigtable and use wide-column rows to store each customer order history
Incorrect. Bigtable is a NoSQL wide-column store with no SQL joins or transactional relational semantics, so it cannot run the existing relational order system.
・Move the entire relational order system into BigQuery and run all transactional writes as streaming inserts from the application tier
Incorrect. BigQuery is an analytical warehouse optimized for scans, not high-frequency transactional writes, and is unsuitable as the primary OLTP store.
Explanation
AlloyDB for PostgreSQL preserves PostgreSQL compatibility while adding a columnar accelerator, making it the best fit for transactional plus reporting workloads without application changes.
Example13 · Database Design and Migration Strategy on Google Cloud
The manufacturing distributor is launching a new global inventory platform that must serve warehouses on three continents with strong consistency and 99.999% availability as regions grow. The team wants a relational database that scales horizontally without manual sharding. Which Google Cloud database best meets these requirements?
・Use Cloud SQL for PostgreSQL with cross-region read replicas and route every write to the single regional primary instance
Incorrect. Cloud SQL has a single regional primary, so global writes bottleneck there and it does not provide automatic horizontal write scaling.
✓Adopt Cloud Spanner for globally distributed strong consistency and horizontal scale
Correct. Cloud Spanner delivers globally distributed, strongly consistent, horizontally scalable relational storage with up to 99.999% availability.
・Deploy several independent Cloud SQL instances per region and build a custom application layer that shards and reconciles inventory writes
Incorrect. Manual per-region sharding with custom reconciliation is operationally heavy and is precisely the work the team wants to avoid.
・Store inventory counts in Memorystore for Redis and periodically flush aggregated totals into a reporting table
Incorrect. Memorystore for Redis is an in-memory cache, not a durable system of record for strongly consistent global inventory.
Explanation
Cloud Spanner is purpose-built for horizontally scalable, globally consistent relational workloads, matching the multi-continent inventory requirement.
Example14 · Database Design and Migration Strategy on Google Cloud
A telecom operator is building a global subscriber billing platform that must handle strongly consistent transactions across customers in North America, Europe, and Asia, with horizontal scalability and 99.999% availability. Which Google Cloud database best fits this requirement?
・Cloud SQL for PostgreSQL deployed as a regional high-availability instance with cross-region read replicas added on demand
Incorrect. Cloud SQL caps at a single regional primary with read replicas and does not offer globally distributed strong-consistency writes or the five-nines SLA.
✓Cloud Spanner, because it provides global horizontal scale with strong external consistency and a 99.999% availability SLA
Correct. Cloud Spanner delivers global horizontal scale, external (strong) consistency, and a 99.999% multi-region availability SLA, matching a worldwide billing platform.
・AlloyDB for PostgreSQL configured with a primary instance and multiple read pool instances inside one region
Incorrect. AlloyDB is a high-performance PostgreSQL service but remains regionally scoped and does not provide a globally distributed write architecture.
・Bigtable, since it delivers low-latency key access and scales horizontally to very large wide-column datasets
Incorrect. Bigtable is a NoSQL wide-column store without multi-row relational transactions, so it cannot back a strongly consistent relational billing schema.
Explanation
Global, strongly consistent, horizontally scalable relational workloads with a five-nines requirement map to Cloud Spanner.
Example15 · Database Design and Migration Strategy on Google Cloud
A telecom operator must migrate an on-premises PostgreSQL CRM database to Cloud SQL for PostgreSQL with near-zero downtime during the final cutover. The migration team wants continuous replication so the application can switch over once replication lag is minimal. Which Database Migration Service approach should they configure?
・A one-time snapshot migration job that dumps the source and imports it, scheduled during an overnight maintenance window to limit disruption
Incorrect. A one-time job copies a static snapshot with no ongoing replication, forcing a long freeze and failing the near-zero-downtime goal.
✓A continuous migration job that performs an initial dump followed by ongoing change data capture until the team promotes the destination
Correct. A continuous DMS job seeds the destination and then streams CDC, letting the team promote at low lag for minimal cutover downtime.
・A manual pg_dump export written to Cloud Storage and then imported into Cloud SQL using the console import feature during cutover
Incorrect. A manual dump-and-import is a point-in-time copy with no change capture, so writes during the load would be lost at cutover.
・A heterogeneous conversion workflow that first translates the PostgreSQL schema before loading the data into the destination instance
Incorrect. Heterogeneous conversion is for migrations between different engines; PostgreSQL to PostgreSQL is homogeneous and needs no schema translation.
Explanation
Near-zero-downtime homogeneous migrations use a continuous DMS job (initial load plus CDC), promoting the destination when lag is minimal.
▶ Try 10 free questions (graded)
Measure your readiness with a full mock exam
All questions · full explanations · lifetime access
Enroll(33 USD)