Professional Cloud Database Engineer Free Practice Questions — Page 6
Question 51
You are designing a database strategy for a new web application in one region. You need to minimize write latency. What should you do?
A. Use Cloud SQL with cross-region replicas.
B. Use high availability (HA) Cloud SQL with multiple zones.
C. Use zonal Cloud SQL without high availability (HA).
D. Use Cloud Spanner in a regional configuration.
Show Answer
Correct Answer: C
Explanation: To minimize write latency in a single region, a zonal Cloud SQL instance without high availability avoids the synchronous cross-zone replication required by HA configurations. Cross-region replicas are for replication/read availability and do not reduce write latency. Cloud Spanner, even in a regional configuration, commits writes via distributed consensus across multiple zones, which generally adds write latency compared with a single-zone Cloud SQL instance.
Question 52
Your organization is running a critical production database on a virtual machine (VM) on Compute Engine. The VM has an ext4-formatted persistent disk for data files. The database will soon run out of storage space. You need to implement a solution that avoids downtime. What should you do?
A. In the Google Cloud Console, increase the size of the persistent disk, and use the resize2fs command to extend the disk.
B. In the Google Cloud Console, increase the size of the persistent disk, and use the fdisk command to verify that the new space is ready to use
C. In the Google Cloud Console, create a snapshot of the persistent disk, restore the snapshot to a new larger disk, unmount the old disk, mount the new disk, and restart the database service.
D. In the Google Cloud Console, create a new persistent disk attached to the VM, and configure the database service to move the files to the new disk.
Show Answer
Correct Answer: A
Explanation: Compute Engine persistent disks can be resized while attached. For an ext4 filesystem, after increasing the persistent disk size, use resize2fs to expand the filesystem online (or with minimal impact depending on configuration), avoiding the downtime required by migrating to a new disk. fdisk does not resize the filesystem, and snapshot/restore or moving data to another disk introduces unnecessary disruption.
Question 53
Your organization needs to migrate a critical, on-premises MySQL database to Cloud SQL for MySQL. The on-premises database is on a version of MySQL that is supported by Cloud SQL and uses the InnoDB storage engine. You need to migrate the database while preserving transactions and minimizing downtime. What should you do?
A. 1. Use Database Migration Service to connect to your on-premises database, and choose continuous replication. 2. After the on-premises database is migrated, promote the Cloud SQL for MySQL instance, and connect applications to your Cloud SQL instance.
B. 1. Build a Cloud Data Fusion pipeline for each table to migrate data from the on-premises MySQL database to Cloud SQL for MySQL. 2. Schedule downtime to run each Cloud Data Fusion pipeline. 3. Verify that the migration was successful. 4. Re-point the applications to the Cloud SQL for MySQL instance.
C. 1. Pause the on-premises applications. 2. Use the mysqldump utility to dump the database content in compressed format. 3. Run gsutil –m to move the dump file to Cloud Storage. 4. Use the Cloud SQL for MySQL import option. 5. After the import operation is complete, re-point the applications to the Cloud SQL for MySQL instance.
D. 1 Pause the on-premises applications. 2. Use the mysqldump utility to dump the database content in CSV format. 3. Run gsutil –m to move the dump file to Cloud Storage. 4. Use the Cloud SQL for MySQL import option. 5. After the import operation is complete, re-point the applications to the Cloud SQL for MySQL instance.
Show Answer
Correct Answer: A
Explanation: Database Migration Service supports MySQL-to-Cloud SQL migrations with continuous replication, allowing ongoing changes to be replicated until cutover. This preserves transactions and minimizes downtime. The other options require application downtime and dump/import workflows, which do not minimize downtime; CSV dumps are also not appropriate for full MySQL database migration.
Question 54
You are working on a new centralized inventory management system to track items available in 200 stores, which each have 500 GB of data. You are planning a gradual rollout of the system to a few stores each week. You need to design an SQL database architecture that minimizes costs and user disruption during each regional rollout and can scale up or down on nights and holidays. What should you do?
A. Use Oracle Real Application Cluster (RAC) databases on Bare Metal Solution for Oracle.
B. Use sharded Cloud SQL instances with one or more stores per database instance.
C. Use a Biglable cluster with autoscaling.
D. Use Cloud Spanner with a custom autoscaling solution.
Show Answer
Correct Answer: D
Explanation: Cloud Spanner best matches the requirements for gradual regional rollout with minimal disruption and elastic scaling. Bigtable is not a relational SQL database, and Oracle RAC is costly. While sharded Cloud SQL can reduce costs, it does not provide seamless compute scaling; changing instance size generally requires a restart. Cloud Spanner supports horizontal scaling, and autoscaling can be implemented with the Cloud Spanner Autoscaler, making it the best fit for scaling up and down during nights and holidays.
Question 55
Your organization has strict policies on tracking rollouts to production and periodically shares this information with external auditors to meet compliance requirements. You need to enable auditing on several Cloud Spanner databases. What should you do?
A. Use replication to roll out changes to higher environments.
B. Use backup and restore to roll out changes to higher environments.
C. Use Liquibase to roll out changes to higher environments.
D. Manually capture detailed DBA audit logs when changes are rolled out to higher environments.
Show Answer
Correct Answer: C
Explanation: Liquibase is the appropriate choice because it provides database schema change management with version-controlled changelogs and an auditable history of what changed, when, and how changes were promoted across environments. This aligns with compliance requirements for tracking production rollouts. Replication and backup/restore are not deployment change management mechanisms, and relying on manual audit log capture is not the recommended approach for controlled, auditable database deployments.
Question 56
You are migrating an on-premises application to Google Cloud. The application requires a high availability (HA) PostgreSQL database to support business-critical functions. Your company's disaster recovery strategy requires a recovery time objective (RTO) and recovery point objective (RPO) within 30 minutes of failure. You plan to use a Google Cloud managed service. What should you do to maximize uptime for your application?
A. Deploy Cloud SQL for PostgreSQL in a regional configuration. Create a read replica in a different zone in the same region and a read replica in another region for disaster recovery.
B. Deploy Cloud SQL for PostgreSQL in a regional configuration with HA enabled. Take periodic backups, and use this backup to restore to a new Cloud SQL for PostgreSQL instance in another region during a disaster recovery event.
C. Deploy Cloud SQL for PostgreSQL in a regional configuration with HA enabled. Create a cross-region read replica, and promote the read replica as the primary node for disaster recovery.
D. Migrate the PostgreSQL database to multi-regional Cloud Spanner so that a single region outage will not affect your application. Update the schema to support Cloud Spanner data types, and refactor the application.
Show Answer
Correct Answer: C
Explanation: Cloud SQL for PostgreSQL with regional HA provides automatic failover within a region for zonal failures. To meet a disaster recovery requirement across regions with RTO/RPO within 30 minutes, a cross-region read replica can be promoted if the primary region is unavailable. Periodic backups alone do not meet the stated recovery objectives, and migrating to Cloud Spanner is unnecessary given the requirement to use a managed PostgreSQL service. Option A omits enabling HA on the primary deployment.
Question 57
You are writing an application that will run on Cloud Run and require a database running in the Cloud SQL managed service. You want to secure this instance so that it only receives connections from applications running in your VPC environment in Google Cloud. What should you do?
A. 1. Create your instance with a specified external (public) IP address. 2. Choose the VPC and create firewall rules to allow only connections from Cloud Run into your instance. 3. Use Cloud SQL Auth proxy to connect to the instance.
B. 1. Create your instance with a specified external (public) IP address. 2. Choose the VPC and create firewall rules to allow only connections from Cloud Run into your instance. 3. Connect to the instance using a connection pool to best manage connections to the instance.
C. 1. Create your instance with a specified internal (private) IP address. 2. Choose the VPC with private service connection configured. 3. Configure the Serverless VPC Access connector in the same VPC network as your Cloud SQL instance. 4. Use Cloud SQL Auth proxy to connect to the instance.
D. 1. Create your instance with a specified internal (private) IP address. 2. Choose the VPC with private service connection configured. 3. Configure the Serverless VPC Access connector in the same VPC network as your Cloud SQL instance. 4. Connect to the instance using a connection pool to best manage connections to the instance.
Show Answer
Correct Answer: D
Explanation: To restrict Cloud SQL to VPC-only access from Cloud Run, use a private IP on the Cloud SQL instance, configure Private Service Connect/private services access for the VPC, and connect Cloud Run through Serverless VPC Access (or modern direct VPC egress). For private IP connectivity, the application connects directly over the VPC; an explicit Cloud SQL Auth Proxy is not required. Using connection pooling is recommended to manage Cloud SQL connections efficiently.
Question 58
You are responsible for designing a new database for an airline ticketing application in Google Cloud. This application must be able to:
Work with transactions and offer strong consistency.
Work with structured and semi-structured (JSON) data.
Scale transparently to multiple regions globally as the operation grows.
You need a Google Cloud database that meets all the requirements of the application. What should you do?
A. Use Cloud SQL for PostgreSQL with both cross-region read replicas.
B. Use Cloud Spanner in a multi-region configuration.
C. Use Firestore in Datastore mode.
D. Use a Bigtable instance with clusters in multiple regions.
Show Answer
Correct Answer: B
Explanation: Cloud Spanner in a multi-region configuration is the only option that satisfies all stated requirements: it provides ACID transactions with strong consistency, supports structured relational data and JSON (semi-structured) data, and is designed for transparent horizontal scaling across regions with global availability. Cloud SQL does not transparently scale globally, Firestore in Datastore mode does not provide the required strong consistency for all query patterns/transactions, and Bigtable is not a relational transactional database for this use case.
Question 59
An analytics team needs to read data out of Cloud SQL for SQL Server and update a table in Cloud Spanner. You need to create a service account and grant least privilege access using predefined roles. What roles should you assign to the service account?
A. roles/cloudsql.viewer and roles/spanner.databaseUser
B. roles/cloudsql.editor and roles/spanner.admin
C. roles/cloudsql.client and roles/spanner.databaseReader
D. roles/cloudsql.instanceUser and roles/spanner.databaseUser
Show Answer
Correct Answer: A
Explanation: The service account needs read-only access to Cloud SQL resources and read/write access to Cloud Spanner data. The predefined role roles/spanner.databaseUser includes database read and write permissions. Among the Cloud SQL roles listed, roles/cloudsql.viewer is the appropriate read-only role; editor and admin are excessive, client does not grant database read capabilities, and instanceUser is primarily for IAM database login/connect rather than viewing Cloud SQL resources.
Sources:
https://docs.cloud.google.com/spanner/docs/iam
Question 60
You are deploying a new Cloud SQL instance on Google Cloud using the Cloud SQL Auth proxy. You have identified snippets of application code that need to access the new Cloud SQL instance. The snippets reside and execute on an application server running on a Compute Engine machine. You want to follow Google-recommended practices to set up Identity and Access Management (IAM) as quickly and securely as possible. What should you do?
A. For each application code, set up a common shared user account.
B. For each application code, set up a dedicated user account.
C. For the application server, set up a service account.
D. For the application server, set up a common shared user account.
Show Answer
Correct Answer: C
Explanation: Use a service account attached to the Compute Engine application server. The Cloud SQL Auth Proxy is designed to authenticate using the VM's service account (or another service account) with the Cloud SQL Client role, following Google-recommended IAM best practices by avoiding user accounts and long-lived credentials on applications. Since the application code runs on the same Compute Engine instance, the proxy can use the instance's service account to access Cloud SQL securely and with minimal setup.
$19
Get all 168 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.