All Google Cloud exams
Free Professional Cloud Database Engineer practice test: 30 questions with answers
30 original questions for Professional Cloud Database Engineer, drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.
- Free questions
- 30
- Full bank
- 112 questions
- Real exam
- 120 min
Professional Cloud Database Engineer exam guide: topics, cost and format
All 30 Professional Cloud Database Engineer questions with answers
The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.
Design scalable and highly available cloud database solutions (8 questions)
Question 1
A retail application needs a relational database that survives a zone failure with no data loss and minimal downtime. Which Cloud SQL configuration fits?
- AA larger machine type in one zone, with the storage set to the fastest disk type that is available
- BA single-zone instance with a daily backup, restored into a new zone by hand after any zone outage
- CA read replica in the same zone, promoted by hand if the primary instance is lost during an outage
- DA regional instance with high availability, using a standby in a second zone that replicates synchronously
Show answer and explanationHide answer
Correct answer: DA regional high-availability instance keeps a standby in another zone that replicates synchronously, so failover avoids data loss and keeps downtime short. Single-zone backups need a slow manual restore, a same-zone replica fails with its zone, and a bigger machine in one zone does not protect against a zone outage.
Question 2
A global application needs strongly consistent relational transactions across several continents. Which design fits?
- ACloud Spanner in a multi-region configuration, which provides synchronous replication and strong consistency
- BCloud SQL with asynchronous read replicas on each continent, with all writes sent to the primary only
- CMemorystore for Redis in each region, with writes replicated to the other regions by the application code
- DFirestore in Datastore mode, with one region chosen for all writes and reads from every continent
Show answer and explanationHide answer
Correct answer: ACloud Spanner multi-region configurations provide synchronous replication with strong consistency across regions, which matches the requirement. Asynchronous replicas can serve stale reads and do not give globally consistent transactions, and Memorystore is a cache rather than a transactional database.
Question 3
A team needs point-in-time recovery of a PostgreSQL Cloud SQL instance to any second within the last seven days. Which setup is required?
- AA nightly export to a Cloud Storage bucket, restored by importing the export file when it is needed
- BManual on-demand backups taken before each change, so that one can be restored when a problem arises
- CPoint-in-time recovery enabled, with write-ahead log retention that covers the seven-day window
- DA read replica that is refreshed each hour, and promoted when the team needs an earlier state of the data
Show answer and explanationHide answer
Correct answer: CPoint-in-time recovery with write-ahead log retention over seven days allows restoring to any second in that window. Nightly exports and manual backups give fixed recovery points only, and an hourly replica cannot reach an arbitrary second.
Question 4
A Spanner table has a primary key that increases with every insert, and writes are creating a hotspot. Which key design avoids it?
- AA sequential integer key that increases with each insert, so that rows stay in insertion order over time
- BA timestamp at the start of the key, so that all new rows are written into the same key range each time
- CA UUID or bit-reversed sequence as the key, so that new writes spread across the whole key space
- DA single fixed key value for all rows, so that the table has one predictable location for every write
Show answer and explanationHide answer
Correct answer: CA UUID or bit-reversed sequence spreads new writes across the key space and avoids the hotspot caused by monotonically increasing keys. Sequential and timestamp-prefixed keys concentrate writes, and a fixed key puts every row in one place.
Question 5
A Bigtable table stores sensor readings with the sensor identifier at the start of the row key, followed by a timestamp. Which problem can occur, and how is it avoided?
- AHotspotting on one node when sensor identifiers are sequential, avoided by salting or reversing the row key
- BData loss on every write, avoided by turning on the local SSD cache for the cluster in the instance
- CSlow reads across the whole cluster, avoided by adding a new column family for each sensor in the table
- DDuplicate rows for each sensor, avoided by removing the timestamp from the row key entirely from the design
Show answer and explanationHide answer
Correct answer: ASequential row keys direct reads and writes to a narrow key range, which hotspots one node. Salting or reversing the key spreads the load across the table. The cache option does not prevent data loss, column families do not fix key hotspots, and removing the timestamp loses ordering that time-series queries need.
Question 6
Which Memorystore option gives an in-memory cache with high availability and automatic failover?
- AMemorystore for Memcached without replicas, which fails over only when a person restarts the instance by hand
- BMemorystore for Redis Standard tier, which provides a replica and automatic failover to it
- CA Cloud Storage bucket used as a cache, with object versioning enabled as the failover mechanism
- DA local Redis process on each VM with no replication, so that the cache is rebuilt after every restart
Show answer and explanationHide answer
Correct answer: BThe Standard tier of Memorystore for Redis provides a replica and automatic failover. Memcached has no replication, a bucket is not a cache, and a local process without replication loses its data on restart.
Question 7
Which TWO actions improve the availability of a database solution across zones or regions? (Choose two.)
- ADeploying a regional Cloud SQL instance with automatic failover to its standby in another zone
- BKeeping all application servers and the database in a single zone, to reduce the latency between them
- CUsing a single backup file stored on the database VM's own boot disk, for simplicity of recovery
- DPlacing read replicas in a second region for read traffic and for disaster recovery purposes
- ETurning off backups, so that a failover completes more quickly without any extra write work to do
Show answer and explanationHide answer
Correct answer: A, DA regional instance with automatic failover and read replicas in a second region both protect availability across zones or regions. Single-zone placement and backups on the same VM disk create single points of failure, and turning off backups removes the recovery path.
Question 8
Which TWO statements about AlloyDB for PostgreSQL are correct? (Choose two.)
- AAlloyDB is compatible with PostgreSQL, so most PostgreSQL applications connect to it with little change
- BAlloyDB is a NoSQL document database that stores its data in JSON collections only, not in tables
- CAlloyDB read pools can serve read traffic separately from the primary instance of the cluster
- DAlloyDB can run only in a single zone, so no high availability option is available for it at all
- EAlloyDB does not support SQL queries, so applications must use a key-value API to access the data
Show answer and explanationHide answer
Correct answer: A, CAlloyDB is PostgreSQL-compatible and its read pools offload read traffic from the primary. It is not a document database, it supports SQL, and it offers high availability options rather than being limited to one zone.
Manage a solution that can span multiple database solutions (8 questions)
Question 9
A team must keep reporting data current from a Cloud SQL database and a Spanner database, without adding load to the operational systems. Which approach fits?
- ARunning a full manual export of both databases each day and loading the files into reporting by hand
- BAdding a second application that writes the same data to both databases at the same time, from one client
- CReplicating changes from each source with a change data capture pipeline into BigQuery for reporting
- DQuerying the production Spanner database directly from the reporting tool for every dashboard that loads
Show answer and explanationHide answer
Correct answer: CChange data capture pipelines stream changes from the sources into BigQuery, which keeps reporting current without heavy queries against the operational systems. Daily manual exports are stale and manual, dual writes risk inconsistency, and direct dashboard queries add load to production.
Question 10
Query performance on a Cloud SQL instance has degraded. Which tool helps the team find the slowest statements and the load they place on the instance?
- ACloud Storage access logs, which show the object requests made to the backup bucket for each day
- BCloud Billing reports for the database instance, which show the cost of its storage and compute resources
- CCloud SQL query insights, which show the slowest queries and the load that each one places on the instance
- DThe instance's uptime check result, which shows only whether the instance responded at the last check
Show answer and explanationHide answer
Correct answer: CQuery insights show the slowest queries and the load they place on the instance, which is what the team needs to find the cause. Storage logs, billing reports and uptime checks do not show query-level performance.
Question 11
A service account must connect to a Cloud SQL instance, but must not be able to change the instance's configuration. Which role fits?
- ACloud SQL Client, which allows connections to the instance without permission to modify its configuration
- BCloud SQL Admin, which allows changes to the instance configuration as well as to its backups and users
- CProject Owner, which allows full control of the project and every resource that it contains in the project
- DViewer on the billing account, which allows the team to see the charges but not to connect to the database
Show answer and explanationHide answer
Correct answer: AThe Cloud SQL Client role allows connecting to the instance without permission to modify it, which matches the requirement. Cloud SQL Admin and Project Owner allow configuration changes, and billing viewer rights do not grant database connections.
Question 12
A team wants Cloud SQL maintenance to happen at a time that suits its users, with minimal disruption. Which setting controls this?
- AThe instance's default storage type, which determines when the database is restarted for updates by the platform
- BThe maintenance window on the instance, which sets the day and hour when maintenance updates are applied
- CThe read replica count, which controls how often the database is restarted by the platform for its updates
- DThe IP address range of the instance, which determines the month in which patches are applied to the instance
Show answer and explanationHide answer
Correct answer: BThe maintenance window sets the day and hour for updates, which lets the team schedule disruption at a quiet time. Storage type, replica count and IP range do not control when maintenance happens.
Question 13
A Spanner database spans several regions. Which configuration choice most affects its availability, placement and processing capacity?
- AThe database name, which affects the cost of storage in each region where the instance's data is kept
- BThe instance configuration, which selects regional or multi-region placement and sets the processing capacity
- CThe table's column order, which affects how much storage Spanner charges for each row written to it
- DThe default time zone of the client application, which determines the availability of the database itself
Show answer and explanationHide answer
Correct answer: BThe instance configuration selects regional or multi-region placement and sets processing capacity, which determine availability and cost. A database name, column order and client time zone do not change placement or availability.
Question 14
A Cloud SQL instance must accept connections only over private IP from the application's VPC. Which setting enforces this?
- AA public IP address on the instance, with a firewall rule that allows connections from the VPC only
- BA Cloud NAT gateway that translates the instance's public address for the application each time it connects
- CA read replica in the VPC that accepts connections on behalf of the primary instance for the application
- DPrivate IP on the instance, attached to the VPC through private services access
Show answer and explanationHide answer
Correct answer: DPrivate IP attached to the VPC through private services access means the instance is reachable only inside the VPC. A public address with a firewall rule still exposes an endpoint, and Cloud NAT and replicas do not restrict where connections originate.
Question 15
Which TWO are good practices for managing several database services as one solution? (Choose two.)
- AUsing one shared password for every database, so that the applications need only a single credential
- BDocumenting the data flows between the databases and their owners, so that changes are reviewed in advance
- CGranting every application full admin rights on every database, so that access errors never block the team
- DKeeping each database's backups only in the same zone as the database, to simplify the restore process
- EMonitoring each database with its own dashboards and alerts, tied to a single operations view for the team
Show answer and explanationHide answer
Correct answer: B, EDocumented data flows with named owners allow changes to be reviewed in advance, and a single operations view over each database's monitoring keeps the solution visible. Shared passwords, full admin rights and same-zone backups weaken security or resilience.
Question 16
A team wants an alert when a Cloud SQL instance's CPU stays above a threshold for a sustained period. Which combination fits?
- AA monthly budget alert on the project's total spend, which fires when the bill exceeds a set amount
- BA Cloud Monitoring alerting policy on the CPU metric, with a duration condition
- CAn uptime check that emails the team only when the instance stops responding to requests entirely
- DA log export of the instance's query text to a bucket, which the team reviews each morning for anomalies
Show answer and explanationHide answer
Correct answer: BA Cloud Monitoring alerting policy on the CPU metric, with a duration condition and notification channels, alerts on sustained high CPU. A budget alert tracks spend, log exports are reviewed late, and an uptime check only fires when the instance is down.
Deploy scalable and highly available databases (7 questions)
Question 17
A team must serve reads locally in two regions, with writes going to one primary. Which Cloud SQL feature supports this?
- AA single instance in one region, with the other region connecting to it over a public IP address only
- BCross-region read replicas, which serve local reads while the primary instance handles all of the writes
- CTwo independent instances with no replication, with the application choosing which one to use for each request
- DA backup stored in the second region, which is restored each time the application needs local reads
Show answer and explanationHide answer
Correct answer: BCross-region read replicas serve reads close to users while the primary handles writes, which matches the requirement. Independent instances have diverging data, a single region adds latency for the second region, and restoring a backup for each read is impractical.
Question 18
A schema change must reach a production database with minimal risk. Which practice is most appropriate?
- ATesting the change in a staging copy, keeping a backup for rollback, and deploying in a planned change window
- BMaking the change in production first and testing it there only if users report an error in the application
- CApplying the change directly to production during business hours, with the rollback plan written afterwards
- DSkipping testing for small schema changes, on the basis that they cannot affect the database's performance at all
Show answer and explanationHide answer
Correct answer: ATesting in a staging copy, keeping a backup for rollback and deploying in a planned window reduces risk to the production database. Changing production first, writing the rollback afterwards and skipping tests all expose production before the change is proven.
Question 19
Which Spanner feature lets a read see the data as it was at an earlier time, without taking locks on the rows?
- AA foreign key constraint, which prevents rows from being deleted while other rows still reference them
- BTable partitioning by date, which stores the rows for each month in a separate storage file on the disk
- CA secondary index on the timestamp column, which speeds up searches over time ranges in the table
- DStale reads or read timestamps, which let a query read a consistent older snapshot of the data
Show answer and explanationHide answer
Correct answer: DStale reads and read timestamps let a query read a consistent older snapshot without taking locks, which suits reporting on past states. Foreign keys enforce integrity, partitioning and indexes speed up access, and none of them reads a past snapshot.
Question 20
A reporting workload needs more read capacity on Cloud SQL, without slowing down writes on the primary. Which option fits?
- AIncreasing only the primary's CPU, which also increases the replication lag seen by the reporting queries
- BAdding read replicas, which serve the reporting queries while the primary instance handles the writes
- CTurning off the primary's backups, so that the reporting queries get more of the disk and I/O capacity
- DChanging the reporting queries to write their results into the primary instance every single minute of the day
Show answer and explanationHide answer
Correct answer: BRead replicas add read capacity while the primary keeps handling writes, which matches the requirement. A larger primary does not add read capacity on replicas, turning off backups removes recovery, and writing reports into the primary adds load.
Question 21
Which Bigtable setup improves availability across zones or regions for reads and writes?
- AA single cluster in one zone with a larger node count, to absorb any failure without a second cluster
- BA single node with the local SSD cache turned on, which keeps data available through any failure in the zone
- CReplication to a second cluster in another zone or region, with an app profile to route requests between them
- DTurning off the cluster's backups, which increases the write throughput to every cluster of the instance
Show answer and explanationHide answer
Correct answer: CReplicating to a second cluster in another zone or region, with app profiles controlling routing, improves availability. A larger single cluster still fails with its zone, a cache does not survive a zone failure, and turning off backups removes recovery.
Question 22
A team wants Firestore data to sync to mobile apps in real time, including while offline. Which mode fits?
- AFirestore in Native mode, which supports real-time listeners and offline sync for client applications
- BBigtable with a change stream that the mobile app polls every few minutes for any updates to the data
- CDatastore mode, which provides batch queries only, with no real-time listeners on the data at all
- DMemorystore with keyspace notifications, which the mobile app reads directly over the public internet
Show answer and explanationHide answer
Correct answer: AFirestore in Native mode supports real-time listeners and offline sync for client apps, which matches the requirement. Datastore mode does not provide real-time listeners, Bigtable is not a client sync store, and Memorystore is a cache rather than a synchronised data store.
Question 23
Which TWO are valid ways to protect production databases from accidental deletion? (Choose two.)
- ADeletion protection on the instance, which blocks deletion until an authorised user disables it
- BGiving every developer the Owner role on the project, so that they can fix any issue quickly
- CKeeping all backups in the same project as the database, which makes restores faster in an emergency
- DUsing retention settings on backups, with the backups kept in a separate project that has restricted delete rights
- EDisabling audit logs so that delete operations are not recorded in the project's logs at all
Show answer and explanationHide answer
Correct answer: A, DDeletion protection stops an instance being removed by accident, and retention settings with separately restricted backups keep recovery points safe. Owner rights for every developer, same-project backups and disabled audit logs all make accidental or malicious loss easier.
Migrate data solutions (7 questions)
Question 24
A company must migrate a MySQL database to Cloud SQL, with continuous replication and a short, planned cutover. Which service fits?
- AA custom script that copies rows table by table, with no validation step at the end of the copy
- BA nightly mysqldump file copied to a bucket and imported during a full outage in the business day
- CA manual copy of the database files to a new VM, with the application left pointed at the old server
- DDatabase Migration Service, which replicates continuously from the source and supports a planned cutover
Show answer and explanationHide answer
Correct answer: DDatabase Migration Service replicates continuously from the source and supports a planned cutover, which keeps downtime short. Nightly dumps require a long outage, manual file copies are fragile, and scripts without validation risk silent data loss.
Question 25
An on-premises Oracle database must feed BigQuery continuously for analytics. Which service fits?
- ADatastream, which captures changes from the source database and delivers them to BigQuery continuously
- BCloud Storage Transfer Service, which copies whole files from an on-premises share on a schedule
- CA Cloud Scheduler job that runs a SELECT on the Oracle database each hour and writes the result out
- DCloud Pub/Sub, which the database publishes its rows to as applications write them to the database
Show answer and explanationHide answer
Correct answer: ADatastream captures changes from the source database and delivers them to BigQuery as a continuous stream. File transfers copy whole files on a schedule, hourly queries load the source repeatedly, and Pub/Sub does not capture database changes by itself.
Question 26
Before cutover, the migration team must confirm that the migrated data matches the source. Which step is most useful?
- AChecking that the target instance has a larger disk than the source, so that the data fits comfortably
- BComparing the number of rows for the largest table only, without checking any of the smaller tables
- CAccepting the migrated data without checks, since the migration tool is managed by the cloud provider itself
- DValidating the data by comparing row counts, checksums or sample records between the source and the target
Show answer and explanationHide answer
Correct answer: DComparing row counts, checksums and sample records between source and target shows whether the data matches. Disk size says nothing about correctness, checking one table leaves the rest unverified, and accepting data without checks removes the evidence the cutover depends on.
Question 27
A stable application needs its database moved with minimal change to the engine and its queries. Which migration path is best?
- ARewriting the application's queries for a new database engine before any data is moved at all
- BConverting the schema to a document model before the migration, which changes every query the app runs
- CRehosting the same engine on Cloud SQL with minimal application change, then optimising later
- DMoving to a different engine and changing the application's data access layer at the same time as the move
Show answer and explanationHide answer
Correct answer: CRehosting the same engine on Cloud SQL keeps the application change minimal, and optimisation can follow once the move is stable. Rewriting queries or changing engines first adds risk, and changing the engine and the data layer together makes faults hard to isolate.
Question 28
A migration must cut over with less than five minutes of write downtime. Which approach fits best?
- AA full export and import during the business day, with the application online and writing throughout
- BContinuous replication until the cutover, then a short write freeze and promotion of the target database
- CA new empty database on the target, with the application writing to it and no existing data copied across
- DTaking a snapshot of the source at cutover and restoring it on the target, with no replication running beforehand
Show answer and explanationHide answer
Correct answer: BContinuous replication keeps the target current, so the only downtime is the short freeze and promotion at cutover. A daytime export and import, an empty target, and a snapshot restored without prior replication all require longer write downtime or lose data.
Question 29
Which TWO are appropriate ways to validate a migration to a new database service? (Choose two.)
- ARunning the application's key queries on both the source and the target, and comparing the results
- BSkipping the performance test because the target service is fully managed by the cloud provider
- CComparing only the table counts, without checking row content or any sample of the data at all
- DTesting the application only after cutover, when the production users are already on the new system
- EPerforming a read-only test of the target with production-like data before the cutover is carried out
Show answer and explanationHide answer
Correct answer: A, ERunning key queries on both sides and testing the target read-only with production-like data both reveal mismatches before the cutover. Skipping performance tests, comparing only counts and testing after cutover all find problems too late or miss them.
Question 30
A team must migrate an Oracle database to a PostgreSQL-compatible engine. Which step should come first?
- AAssessing the schema and the stored code for compatibility, using a migration assessment tool first
- BMoving all the data first, then finding out which stored procedures no longer work after the move is complete
- CAsking the application team to start rewriting its queries before any inventory of the database has been made
- DSkipping the assessment, because the data itself is the same regardless of which database engine stores it
Show answer and explanationHide answer
Correct answer: AAn assessment of the schema and stored code identifies the incompatibilities and the effort needed before any data moves. Moving data first, rewriting queries blind and skipping the assessment each create avoidable rework.