Courseiva

Google Professional Cloud Database Engineer (PCDE) — Questions 601675

1446 questions total · 20pages · All types, answers revealed

Page 8

Page 9 of 20

Page 10
601
MCQmedium

A company wants to store and analyze time-series metrics from thousands of servers. The data is write-heavy with occasional reads of recent data. They need low-latency writes and the ability to scan large ranges later. Which Google Cloud database is MOST appropriate?

A.Firestore
B.Cloud Spanner
C.Cloud Bigtable
D.Cloud SQL
AnswerC

Bigtable is ideal for time-series workloads with high write throughput and range scan queries.

Why this answer

Bigtable is designed for time-series data, high write throughput, and efficient range scans. It can handle large volumes of time-series data with low latency.

602
MCQmedium

A company has a Cloud SQL for PostgreSQL instance with cross-region read replicas for disaster recovery. They want to test the failover process without affecting the primary instance. What is the recommended approach?

A.Create a clone of the primary instance and promote the clone to simulate failover.
B.Promote the cross-region read replica to a standalone instance in a separate project for testing.
C.Trigger a failover using the gcloud sql instances failover command on the primary instance.
D.Stop the primary instance and observe how the application behaves.
AnswerB

Promoting a read replica creates a new standalone instance without affecting the primary. Testing in a separate project avoids interference. This is a non-destructive way to validate failover.

Why this answer

Cloud SQL cross-region read replicas can be promoted to a standalone instance. This promotion is a manual operation that creates a new primary instance. To test failover non-destructively, you can promote a read replica to a standalone instance in a different project or region.

You can then test connectivity and read/write operations. After testing, you can either keep the promoted instance or delete it. You cannot failover and then revert the replica; promotion is irreversible.

The promotion does not affect the original primary instance.

603
MCQhard

An e-commerce platform uses Cloud Spanner as its database. The orders table has a monotonically increasing order_id as the primary key, and the team observes high write latency during peak hours. Which design change would BEST distribute write load across nodes?

A.Add a secondary index on order_id
B.Increase the number of nodes
C.Use interleaving with a parent table
D.Change the primary key to a UUID string
AnswerD

UUIDs are random, distributing writes evenly across nodes and avoiding hotspots.

Why this answer

Using a UUID (or a hash prefix) as the primary key or as a leading part of a composite key prevents hotspotting on a single tablet server by distributing writes across the cluster.

604
MCQmedium

A team uses Cloud Deploy to manage deployments to multiple GKE clusters in different environments. They need to ensure that only a specific service account can promote releases to the production target. What should they configure?

A.Grant the service account the 'roles/clouddeploy.releaser' role on the production target
B.Restrict the service account's permissions via a VPC Service Controls perimeter
C.Grant the service account the 'roles/clouddeploy.operator' role on the delivery pipeline
D.Use a manual approval gate for the production stage
AnswerA

The releaser role on a target allows promoting releases to that target, and can be scoped per target.

Why this answer

Cloud Deploy uses IAM roles on targets to control who can promote. By granting the roles/clouddeploy.releaser role to the service account on the production target, only that account can promote releases to that target.

605
MCQhard

Your team uses Cloud SQL for PostgreSQL and needs to run a one-time data correction query that will update 10 million rows. The instance has 8 vCPUs and 30 GB memory. The query is currently running for hours and impacting production performance. What should you do?

A.Create a read replica and run the update on the replica.
B.Create a clone of the instance, run the update on the clone, then promote it.
C.Run the query during off-peak hours with reduced concurrency.
D.Increase the instance size to 16 vCPUs and 60 GB memory before running the query.
AnswerB

Cloning provides an isolated environment for the update.

Why this answer

Creating a clone of the Cloud SQL instance provides an isolated environment where the heavy UPDATE can run without impacting production performance. After the update completes on the clone, you can promote it to become the new primary instance, effectively applying the data correction with minimal downtime. This approach avoids the performance degradation caused by running the query on the production instance and leverages Cloud SQL's cloning feature for a one-time data correction.

Exam trap

Google Cloud often tests the misconception that read replicas can handle write operations, but in Cloud SQL for PostgreSQL, replicas are strictly read-only and cannot be used for UPDATE queries.

How to eliminate wrong answers

Option A is wrong because Cloud SQL read replicas are read-only and cannot execute UPDATE, INSERT, or DELETE statements; they are designed for offloading read traffic, not for write operations. Option C is wrong because running the query during off-peak hours with reduced concurrency still executes the update on the production instance, which will continue to consume significant CPU, memory, and I/O resources, degrading performance for any concurrent production queries. Option D is wrong because increasing the instance size to 16 vCPUs and 60 GB memory only provides more resources but does not eliminate the performance impact on the production instance; the query will still contend with production workloads for the same database engine and storage, and scaling up is not a cost-effective or risk-free solution for a one-time operation.

606
Multi-Selectmedium

A company uses Cloud Deploy for a CD pipeline to Cloud Run. They want to implement a canary deployment that automatically rolls back if the error rate increases by more than 5% during the canary phase. Which TWO actions should they take?

Select 2 answers
A.Use a blue/green strategy instead, as it supports automatic rollback
B.Configure a canary deployment strategy in the delivery pipeline with phases and metrics
C.Delegate rollback to the developer who must manually approve or reject
D.Create a Cloud Monitoring alert policy that triggers a Cloud Deploy rollback via a webhook
E.Set up a preDeploy hook to run a load test
AnswersB, D

This sets up the canary with metric thresholds.

Why this answer

Cloud Deploy's canary strategy allows you to define phases with specific metrics (e.g., error rate) that are evaluated during the rollout. If the error rate exceeds the defined threshold (e.g., 5% increase), Cloud Deploy automatically rolls back the canary without manual intervention. This is configured in the delivery pipeline YAML under the `strategy` section with `canary` and `phases`.

Exam trap

A common misconception is that blue/green strategies support automatic rollback based on metrics, but in Cloud Deploy, canary strategies are the only ones that natively integrate with Cloud Monitoring for automated rollback decisions.

607
MCQmedium

You have a Cloud Bigtable instance with a single cluster. To improve availability and durability, you want to enable replication across two regions. After configuring replication, you notice that reads from the replica cluster show data that is not yet consistent with the primary. What is the expected consistency model for Bigtable replication?

A.Read-your-writes consistency from the primary
B.Eventually consistent reads from replicas
C.Strongly consistent reads from any cluster
D.Strict serializability across clusters
AnswerB

Bigtable uses async replication, so replicas are eventually consistent. This is the expected behavior.

Why this answer

Cloud Bigtable replication uses an eventually consistent model for reads from replica clusters. When you write to the primary cluster, the data is asynchronously replicated to the replica cluster using a distributed replication pipeline. This means that reads from the replica cluster may return stale data until the replication process completes, and there is no guarantee of immediate consistency with the primary.

Exam trap

A common misconception is that Bigtable replication provides strongly consistent reads across all clusters, similar to synchronous replication, but it is eventually consistent. Only the primary cluster guarantees strong consistency.

How to eliminate wrong answers

Option A is wrong because read-your-writes consistency is a property of the primary cluster, not of replicas; Bigtable does not guarantee that a write to the primary is immediately visible from the replica. Option C is wrong because strongly consistent reads are only guaranteed from the primary cluster, not from any cluster; replicas provide only eventual consistency. Option D is wrong because strict serializability is not supported across clusters in Bigtable replication; replication is asynchronous and does not provide global ordering or serializability.

608
MCQeasy

You are managing a Cloud SQL for MySQL instance that supports a web application. Recently, users have reported that the application is responding slowly during peak hours. You examine the Query Insights dashboard and see that a specific query is running frequently and has a high execution time. The query involves JOINs on three tables, each with tens of thousands of rows. The query plan shows a full table scan on two tables. What should you do first to improve performance?

A.Enable the query cache flag in Cloud SQL database flags.
B.Increase the instance size to provide more memory and CPU.
C.Add indexes on the columns used in JOIN conditions.
D.Rewrite the query to use subqueries instead of JOINs.
AnswerC

Adding indexes on the columns used in JOIN conditions directly reduces full table scans by allowing the database to use index lookups, which is the most effective and immediate action to improve query performance.

Why this answer

Adding appropriate indexes on the join columns will reduce full table scans, which is the most effective immediate action. Option A (enabling query cache) is not recommended because query cache is deprecated in MySQL 8.0 and does not address the root cause of full table scans. Option B (increasing instance size) may provide more resources but does not fix the inefficient query plan, making it a costly temporary solution.

Option D (rewriting with subqueries) could change the execution plan but is more complex and time-consuming; indexing is the standard first step for JOIN performance.

609
MCQhard

An engineer needs to create an SLO in Cloud Monitoring for a service that processes requests. The SLO should measure the proportion of requests that complete successfully within 300ms. The metric type for successful requests is custom.googleapis.com/myapp/success_count and for total requests is custom.googleapis.com/myapp/total_count. Which type of SLO should they create?

A.Availability SLO using a single metric for uptime
B.Request-based SLO using a single distribution metric
C.Window-based SLO with metric distribution
D.Request-based SLO using two metrics (good count / valid count)
AnswerD

The engineer has two metrics: good and total. A request-based SLO calculates the ratio.

Why this answer

Cloud Monitoring SLOs can be request-based using a ratio of good requests to total requests from two metrics. This is a request-based SLO with a metric distribution.

610
MCQeasy

A team is designing a disaster recovery plan for a Cloud SQL for PostgreSQL instance. The RPO is 5 minutes and RTO is 1 hour. Which configuration meets these requirements?

A.Schedule daily exports to Cloud Storage and import in another region
B.Enable automatic failover within the same region using HA configuration
C.Create a read replica in the same region and promote it during disaster
D.Configure a cross-region read replica with point-in-time recovery (PITR) to enable failover
AnswerD

Cross-region replica provides region failover; PITR allows recovery to any point within the backup window.

Why this answer

Meets the RPO of 5 minutes and RTO of 1 hour because a cross-region read replica with point-in-time recovery (PITR) allows you to failover to a replica in another region, minimizing data loss to within seconds (PITR can recover to any point in time within the retention window) and promoting the replica typically completes within minutes, well under the 1-hour RTO. This configuration provides both disaster recovery across regions and granular recovery to meet the strict RPO.

Exam trap

Google Cloud often tests the distinction between high availability (HA) within a region and disaster recovery (DR) across regions, and the trap here is that candidates confuse automatic failover in the same region (Option B) with cross-region DR, failing to realize that HA does not protect against a full regional outage.

How to eliminate wrong answers

Option A is wrong because daily exports to Cloud Storage have an RPO of up to 24 hours (the time between exports), far exceeding the 5-minute requirement, and importing to another region would take much longer than the 1-hour RTO. Option B is wrong because automatic failover within the same region using HA configuration protects against zonal failures but does not protect against a regional disaster, so it cannot meet the cross-region DR requirement. Option C is wrong because a read replica in the same region cannot survive a regional outage; promoting it still leaves you in the same failed region, violating the DR need for geographic separation.

611
MCQhard

You are managing a Cloud SQL for PostgreSQL instance with point-in-time recovery (PITR) enabled. The retention period is set to 7 days. A developer accidentally dropped a critical table 3 days ago. You need to restore the database to the state just before the table was dropped, without affecting the current production instance. What should you do?

A.Enable binary logging and reconfigure PITR retention to 10 days, then wait for the logs to catch up.
B.Use the gcloud sql backups create command to create an on-demand backup, then restore the original instance to that backup.
C.Use the gcloud sql instances clone command with the --point-in-time flag to clone the instance to a new instance at the timestamp just before the table was dropped.
D.Use the gcloud sql instances restore-backup command to restore the original instance to the backup from 3 days ago.
AnswerC

Cloning with --point-in-time creates a new instance restored to that exact timestamp, preserving the original instance. This is the correct procedure.

Why this answer

The gcloud sql instances clone command with the --point-in-time flag allows you to create a new Cloud SQL instance that is a clone of the original at a specific timestamp. Since PITR is enabled and the retention period is 7 days, you can specify a timestamp just before the table was dropped (3 days ago) to restore the database to that exact state without affecting the current production instance. This approach meets the requirement of restoring to a point in time without overwriting the original instance.

Exam trap

The trap here is that candidates may confuse the clone command with the restore-backup command, thinking they must restore the original instance to a previous backup, but the question explicitly requires not affecting the current production instance, making clone the correct choice.

How to eliminate wrong answers

Option A is wrong because binary logging is not a configurable setting in Cloud SQL for PostgreSQL (it uses PostgreSQL's WAL archiving for PITR, not MySQL-style binary logs), and increasing retention to 10 days does not help recover a table dropped 3 days ago without restoring from a backup or clone. Option B is wrong because creating an on-demand backup captures the current state, not the state from 3 days ago, so restoring to that backup would not recover the dropped table. Option D is wrong because restoring the original instance to a backup from 3 days ago would overwrite the current production instance, which violates the requirement to not affect the current production instance.

612
MCQmedium

A company wants to centralize audit logs and billing data from multiple projects in a single project for analysis. What is the best approach?

A.Use Cloud Monitoring to view logs from all projects in one dashboard
B.Create a shared VPC project and enable VPC flow logs
C.Create a dedicated logging project, set up aggregated log sinks from all projects to that project, and export billing data to BigQuery in the same project
D.Enable billing export to BigQuery in each project and query across projects
AnswerC

This is the landing zone best practice: a centralized logging project with aggregated sinks and billing export.

Why this answer

Using a separate project for logging centralization with aggregated sinks to export logs and billing export to BigQuery in that project is the recommended landing zone design pattern.

613
MCQhard

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?

A.Add a secondary index on (account_id, transaction_timestamp DESC)
B.Change the primary key to (transaction_timestamp, account_id) and use interleaving
C.Create a separate 'LatestTransaction' table keyed by account_id, and update it whenever a new transaction occurs
D.Add a 'is_latest' boolean column to the Transactions table and index it
AnswerC

Enables direct point reads for the latest transaction.

Why this answer

It eliminates the need to scan the entire Transactions table to find the latest transaction per account. By maintaining a separate LatestTransaction table keyed by account_id, each account's latest transaction can be retrieved with a single point read. This is a classic denormalization pattern in Cloud Spanner that avoids the overhead of scanning or sorting large datasets for 'latest per group' queries.

Exam trap

Google Cloud often tests the misconception that a secondary index with DESC ordering can efficiently retrieve the latest row per group, but in Cloud Spanner, secondary indexes do not support 'top-N per group' without scanning all index entries for each group.

How to eliminate wrong answers

Option A is wrong because a secondary index on (account_id, transaction_timestamp DESC) would still require a full index scan to find the latest transaction per account, as Cloud Spanner secondary indexes do not support 'latest per group' without scanning all rows for each account. Option B is wrong because changing the primary key to (transaction_timestamp, account_id) would scatter rows for the same account across splits, making per-account queries inefficient and requiring a full table scan to gather all rows for a single account. Option D is wrong because adding an 'is_latest' boolean column and indexing it would require updating all previous rows for an account on every insert to set is_latest=false, which is both expensive and prone to race conditions in a distributed database like Cloud Spanner.

614
MCQhard

A Cloud SQL for MySQL instance's storage utilization has reached 95%. The database is 5 TB and needs to grow. The operations team tries to increase storage via gcloud but receives an error. What is the likely cause?

A.The instance is at the maximum storage limit for its machine tier
B.The storage resize operation is only allowed during maintenance windows
C.The instance has binary logging enabled, which prevents storage increase
D.The instance has automatic storage increase disabled
AnswerA

Each Cloud SQL tier has a max storage limit (e.g., 10 TB for db-n1-standard-8). If the instance is already at that limit, resize is blocked.

Why this answer

Cloud SQL allows online storage increases but with limits: the maximum storage cannot exceed 30 TB, and the increase must be done in increments. However, the error is likely because the instance is using the maximum allowed storage for its tier, or the storage cannot be shrunk. But the most common issue is that the instance has an on-demand backup or restore operation in progress, which blocks resize.

Another possibility is that the storage is already at the maximum for that machine type. However, the question implies a common misconfiguration: the instance may have a read replica that is replicating from it, and storage resize is not allowed if the replica is in a different region? Actually, storage resize is allowed regardless. More likely: the user has reached the maximum storage size for the current tier (e.g., db-n1-standard-8 supports up to 10 TB).

The correct answer is tier storage limit.

615
MCQhard

A large enterprise uses Cloud Bigtable for analytics. They notice that some nodes are handling significantly more traffic than others, causing hot spots and performance degradation. Which tool should they use to identify the specific row keys causing the issue?

A.Bigtable Key Visualiser
B.Stackdriver Error Reporting
C.Bigtable cbt tool with read rows command
D.Cloud Monitoring dashboard for Bigtable
AnswerA

Correct. Key Visualiser visualizes access patterns to identify hot spots.

Why this answer

Key Visualiser is a Bigtable tool that provides a heatmap of row key access patterns, helping to identify hot spots by showing which row key ranges are heavily accessed.

616
MCQhard

You are designing a Bigtable schema for a time-series application that records sensor readings every second. Queries always filter by device ID and time range. To avoid hotspotting and ensure recent data is retrieved quickly, which row key design is MOST effective?

A.Row key: deviceID#timestamp
B.Row key: (reverseTimestamp#deviceID)
C.Row key: (hash(deviceID)#deviceID#reverseTimestamp)
D.Row key: timestamp#deviceID
AnswerC

Salting distributes writes, deviceID enables filtering, reverseTimestamp orders recent first.

Why this answer

Salting (hash prefix) distributes writes across nodes, avoiding hotspots from sequential timestamps. Field promotion (device ID first) allows efficient prefix scans. Reverse timestamp ensures most recent data appears first when scanning.

617
MCQmedium

A team is designing a schema for Cloud Spanner to store user profiles. The primary access pattern is to read a user's profile by their unique user ID. To avoid write hotspots, which primary key design strategy should the team use?

A.Use the user's email address as the primary key
B.Use a monotonically increasing integer as the primary key
C.Use a UUID (universally unique identifier) as the primary key
D.Use a timestamp as the primary key
AnswerC

UUIDs are randomly distributed, spreading writes across tablets and avoiding hotspots.

Why this answer

Monotonically increasing keys (e.g., sequential integers or timestamps) cause all writes to hit the same tablet, creating hotspots. Using a random UUID distributes writes evenly across the cluster, avoiding hotspots.

618
MCQeasy

A Cloud SQL for MySQL instance is experiencing increased replica lag. The write workload is constant. What is the most likely cause?

A.Binary logs are being deleted too frequently on the primary
B.The query cache is enabled on the primary
C.The replica is on a higher machine tier than the primary
D.A long-running query is executing on the replica
AnswerD

Long queries delay the SQL thread from applying changes.

Why this answer

A long-running query on the replica can block the SQL thread from applying relay log events, causing replica lag to increase even if the primary's write workload is constant. This is because replication is single-threaded by default in MySQL, so one slow query stalls all subsequent events until it completes.

Exam trap

Google Cloud often tests the misconception that replica lag is always caused by primary-side issues (like binary log deletion or query cache), when in fact the replica's own processing bottlenecks are a frequent root cause.

How to eliminate wrong answers

Option A is wrong because deleting binary logs too frequently on the primary does not directly cause replica lag; it can cause replication errors if the replica hasn't yet processed the logs, but lag itself is driven by apply delays, not log retention. Option B is wrong because the query cache is deprecated in MySQL 8.0 and, even when enabled, it caches SELECT results on the primary, not affecting replication lag. Option C is wrong because a higher machine tier on the replica would reduce, not increase, replica lag by providing more resources to apply changes faster.

619
Multi-Selectmedium

A developer is building an application that uses Firestore (in Datastore mode). The application needs to query data across two properties: 'status' and 'timestamp', with an equality filter on 'status' and a range filter on 'timestamp'. Which three steps are required to support this query efficiently? (Choose THREE.)

Select 3 answers
A.Ensure that single-field indexes exist for both 'status' and 'timestamp'
B.Enable automatic composite index creation in Firestore settings
C.Create an index exemption for the 'timestamp' field
D.Create a composite index on the 'status' and 'timestamp' fields
E.Use gcloud alpha firestore indexes composite create to define the index
AnswersA, D, E

Firestore in Datastore mode requires single-field indexes on both 'status' and 'timestamp' to support equality and range filters. These indexes are not automatically created; they must be manually defined. Ensuring they exist is necessary even when a composite index is present.

Why this answer

Firestore (in Datastore mode) requires single-field indexes to be defined for each property used in a query, even when a composite index is also present. Without a single-field index on 'status' and 'timestamp', the query engine cannot efficiently evaluate the equality and range filters, leading to full table scans or query failures.

Exam trap

A common misconception is that Firestore in Datastore mode automatically creates composite indexes like Firestore Native mode does, but Datastore mode requires manual composite index creation. Also, index exemptions cannot replace proper composite index design.

620
MCQmedium

A company is designing a Cloud Spanner database for a global user base. They need to support strong consistency and low-latency reads across multiple regions. Which schema design practice is most important?

A.Denormalize data into wide tables to reduce the number of joins.
B.Use interleaved tables to co-locate related rows that are queried together.
C.Use a single table with composite primary key to avoid joins.
D.Create secondary indexes on every column to optimize read queries.
AnswerB

Interleaving ensures parent and child rows are stored on the same split, reducing latency for joins.

Why this answer

Interleaved tables in Cloud Spanner physically co-locate parent and child rows on the same split, enabling local joins with strong consistency and low latency across regions. This design minimizes cross-node communication, which is critical for global workloads that require both strong consistency and fast reads.

Exam trap

A common mistake is thinking that denormalization or secondary indexes are the best way to optimize reads in Cloud Spanner, but the key to low-latency global reads is physical data locality via interleaved tables, not schema flattening or excessive indexing.

How to eliminate wrong answers

Option A is wrong because denormalizing into wide tables increases storage costs and write overhead, and does not guarantee low-latency reads across regions since wide rows can still be split across nodes. Option C is wrong because a single table with a composite primary key does not avoid joins when querying related data; it forces all data into one table, leading to redundancy and potential hotspots. Option D is wrong because creating secondary indexes on every column increases write latency and storage costs, and secondary indexes in Spanner are not co-located with the base table, so reads may require cross-node lookups.

621
MCQeasy

A company needs a cross-region disaster recovery solution for their Cloud SQL MySQL database. Which feature should they use?

A.Read replicas in the same region.
B.Cloud SQL for MySQL does not support cross-region replication.
C.Cross-region replication using external replicas.
D.Use Database Migration Service to continuously copy data.
AnswerC

An external replica in a different region can serve as a disaster recovery target.

Why this answer

Cloud SQL for MySQL does not natively support cross-region replication, but you can achieve it by configuring an external replica (a MySQL instance running outside Cloud SQL, such as on Compute Engine) that uses MySQL's native binary log (binlog) replication from the primary Cloud SQL instance. This setup allows you to maintain a standby database in a different region for disaster recovery, with the external replica continuously applying changes from the primary.

Exam trap

The trap here is that candidates assume Cloud SQL for MySQL has a built-in cross-region replica feature like Cloud SQL for PostgreSQL or Spanner, but it does not, leading them to incorrectly select Option B or D.

How to eliminate wrong answers

Option A is wrong because read replicas in the same region do not provide cross-region disaster recovery; they only offload read traffic within the same region and cannot survive a regional outage. Option B is wrong because Cloud SQL for MySQL does support cross-region replication indirectly through external replicas, making the absolute statement 'does not support' incorrect. Option D is wrong because Database Migration Service is designed for one-time migrations, not continuous cross-region replication; it does not maintain an ongoing sync for disaster recovery.

622
MCQhard

You are configuring a log-based metric that counts error log entries with severity ERROR. You need to set up an alert that fires when the count exceeds 100 in a 5-minute window. Which alert condition type and reducer should you use?

A.Metric absence condition with reducer COUNT and alignment period 5 minutes
B.Metric threshold condition with reducer MEAN and alignment period 5 minutes
C.Forecast condition with reducer SUM and alignment period 5 minutes
D.Metric threshold condition with reducer COUNT and alignment period 5 minutes
AnswerB

MEAN reducer on a cumulative metric gives the rate, which can be compared to a threshold.

Why this answer

For log-based counter metrics, you use a metric threshold condition. The metric type is a counter (cumulative), so you need to compute the rate of change using the MEAN reducer (which for a counter gives the rate) to compare against a threshold.

623
MCQeasy

You need to create a custom metric in Cloud Monitoring that measures the number of HTTP requests to your application each second. Which metric type should you use?

A.DELTA
B.GAUGE
C.CUMULATIVE
D.COUNT
AnswerA

Delta reports the change over time, suitable for counting events per second.

Why this answer

A DELTA metric reports the change in a value over time, which is appropriate for counting events per second. GAUGE reports a value at a point in time, and CUMULATIVE reports an accumulating total.

624
MCQhard

A Cloud Bigtable instance stores high-volume time-series data. Write throughput is at node capacity, but read latency spikes occasionally. The row key pattern is 'timestamp#device_id'. Which optimization should be applied first?

A.Add more nodes to the cluster
B.Enable SSD storage
C.Reverse the row key to device_id#timestamp
D.Use a single column family
AnswerC

Device ID first distributes writes across nodes, reducing hotspots.

Why this answer

With timestamp first, writes are concentrated on the same tablet, causing hotspots and read latency spikes. Reversing the order or salting distributes writes.

625
MCQeasy

You run the above command to create a Spanner instance. Later, you need to increase the instance's compute capacity to handle higher traffic. What is the correct approach?

A.Use the console to change the instance configuration to a larger one.
B.Delete the instance and recreate with --nodes=5.
C.Create a new instance with a larger config and migrate data.
D.Run gcloud spanner instances update test-instance --nodes=5
AnswerD

This updates the node count without recreating the instance.

Why this answer

Cloud Spanner allows you to increase the compute capacity of an existing instance by updating the node count using the `gcloud spanner instances update` command. This operation is performed online without downtime, as Spanner supports live resizing of nodes to handle increased traffic.

Exam trap

The trap here is that candidates confuse changing the instance configuration (which requires migration) with scaling compute capacity by adjusting node count (which is a live, online operation).

How to eliminate wrong answers

Option A is wrong because instance configuration (e.g., regional vs. multi-regional) cannot be changed after creation; you would need to create a new instance with the desired configuration and migrate data. Option B is wrong because deleting and recreating the instance is unnecessary and causes downtime; Spanner supports live node count changes without instance deletion. Option C is wrong because creating a new instance with a larger config and migrating data is only required when changing the instance configuration (e.g., from regional to multi-regional), not when simply increasing node count within the same configuration.

626
MCQhard

An organization uses Terraform to manage infrastructure across multiple teams. They want to implement a branching strategy that supports rapid iteration and continuous integration for infrastructure changes while ensuring that the main branch always reflects the desired state. Which Git branching model is most aligned with GitOps principles for IaC?

A.Feature branching with long-lived branches for each environment (dev, staging, prod).
B.Trunk-based development with short-lived feature branches and automated CI/CD pipelines that apply changes upon merge to main.
C.Each team maintains its own fork and periodically submits pull requests to a central repository.
D.GitFlow with separate branches for develop, release, and hotfixes.
AnswerB

This aligns with GitOps: main is the source of truth, and merges trigger automated deployment.

Why this answer

Trunk-based development with short-lived feature branches is recommended for GitOps. Developers branch off main, make changes, commit frequently, and merge back to main after automated testing. This keeps main deployable and reduces merge conflicts.

627
MCQhard

During a MySQL to Cloud SQL migration using Database Migration Service, the full dump phase is taking much longer than expected. The source MySQL database is 500 GB and the Cloud SQL instance is of sufficient size. What is the most likely cause of the slow dump?

A.The source database is using a public IP address.
B.The source database has many MyISAM tables.
C.Binary logging is not enabled on the source.
D.The Cloud SQL instance is using a shared-core machine type.
AnswerB

MyISAM tables require table locks during dump, causing slower performance and potential contention. InnoDB tables with --single-transaction allow non-blocking dumps.

Why this answer

Without --single-transaction, mysqldump locks tables, causing contention and slow performance. DMS uses mysqldump internally and requires InnoDB tables with --single-transaction for consistent non-blocking dumps.

628
MCQeasy

A Cloud SQL for PostgreSQL instance is running out of storage. The engineer wants to configure automatic storage increase to avoid manual intervention. What should they do?

A.Use gcloud sql instances patch with the --disk-size flag to set a larger size.
B.Use gcloud sql instances patch with the --storage-auto-increase flag.
C.Create a cron job to monitor disk usage and increase storage via API.
D.Use gcloud sql instances create to create a new instance with larger storage.
AnswerB

This enables automatic storage increase for the Cloud SQL instance.

Why this answer

Cloud SQL for PostgreSQL supports automatic storage increase, which can be enabled via the `--storage-auto-increase` flag in the `gcloud sql instances patch` command. This feature automatically increases the instance's storage capacity when it approaches the configured limit, eliminating the need for manual intervention.

Exam trap

The trap here is that candidates may confuse manual resizing (using `--disk-size`) with automatic storage increase, or think that a custom monitoring solution is required, when Cloud SQL's built-in `--storage-auto-increase` flag is the correct and simplest solution.

How to eliminate wrong answers

Option A is wrong because the `--disk-size` flag only sets a static disk size; it does not enable automatic storage increase, so manual resizing would still be required when storage runs out. Option C is wrong because creating a custom cron job to monitor and increase storage via the API is unnecessary and error-prone; Cloud SQL provides a built-in automatic storage increase feature that should be used instead. Option D is wrong because creating a new instance with larger storage is a disruptive, manual migration process that does not solve the need for automatic scaling; it also requires downtime and data migration, whereas the existing instance can be patched to enable auto-increase.

629
MCQeasy

A developer needs to store JSON documents that are frequently accessed by key but rarely updated. The data size is under 10 GB initially but expected to grow to 500 GB. Which database service is most suitable?

A.Firestore (Datastore mode) with document keys
B.Cloud Bigtable with row keys as document IDs
C.Memorystore for Redis with JSON data type
D.Cloud SQL for PostgreSQL with JSONB column
AnswerA

Firestore provides document store with automatic scaling and low-latency key lookups.

Why this answer

Firestore in Datastore mode is ideal because it provides a fully managed, scalable NoSQL document database with automatic sharding and strong consistency for key-based lookups. It handles growth from 10 GB to 500 GB seamlessly without manual partitioning, and its document keys enable efficient point reads for frequently accessed, rarely updated JSON data.

Exam trap

The trap here is that candidates often choose Cloud Bigtable (B) for large-scale key-value workloads, overlooking that Bigtable is designed for wide-column, high-throughput analytical access patterns, not for storing JSON documents with frequent point reads by key.

How to eliminate wrong answers

Option B is wrong because Cloud Bigtable is a wide-column NoSQL database optimized for high-throughput, low-latency analytical workloads (e.g., time-series or IoT data), not for storing and retrieving JSON documents by key; it lacks native JSON support and is overkill for this use case. Option C is wrong because Memorystore for Redis is an in-memory cache, not a persistent database; while it supports JSON data type via RedisJSON module, it is designed for ephemeral caching and cannot reliably store 500 GB of data without significant cost and data loss risk on restart. Option D is wrong because Cloud SQL for PostgreSQL with JSONB column is a relational database that requires manual sharding or read replicas to scale beyond a single instance, and it does not provide the automatic, seamless scalability to 500 GB that a NoSQL document store like Firestore offers.

630
MCQmedium

An online retailer uses Cloud SQL for PostgreSQL. They need to scale for a seasonal peak. They expect 2x current traffic. Their current instance is 16 vCPU, 64 GB RAM, 1 TB storage. The peak lasts 4 hours. They want to handle it without downtime. What is the best approach?

A.Use Cloud Spanner to auto-scale.
B.Upgrade to a higher-tier machine type permanently.
C.Add read replicas and rewrite queries to use replicas for reads.
D.Increase vCPU and memory to 32 vCPU/128 GB temporarily for the peak window.
AnswerD

Vertical scaling is straightforward and temporary, minimizing cost.

Why this answer

Cloud SQL for PostgreSQL supports vertical scaling with minimal downtime, and temporarily increasing vCPU and memory to 32 vCPU/128 GB for the 4-hour peak window meets the 2x traffic demand without requiring application changes. This approach avoids permanent cost increases and leverages Cloud SQL's ability to scale up and down via the gcloud command or console, with only a brief failover (typically under 60 seconds) that can be scheduled during a maintenance window to achieve near-zero downtime.

Exam trap

The Google Cloud Professional Database Engineer exam often tests the misconception that read replicas can handle all traffic scaling (including writes), but the trap here is that read replicas do not increase write capacity, so for a 2x traffic mix that includes writes, vertical scaling of the primary instance is the only viable single-database solution without downtime.

How to eliminate wrong answers

Option A is wrong because Cloud Spanner is a globally distributed, horizontally scalable database that requires schema redesign and is not a direct upgrade path from Cloud SQL for PostgreSQL; it also introduces significant complexity and cost for a temporary 4-hour peak. Option B is wrong because permanently upgrading to a higher-tier machine type incurs ongoing costs for resources that are only needed for 4 hours, which is inefficient and not cost-optimal. Option C is wrong because read replicas only offload read traffic, not write traffic, and the 2x traffic increase likely includes writes; additionally, rewriting queries to use replicas introduces application complexity and does not address the primary instance's write capacity bottleneck.

631
MCQeasy

A Cloud Spanner query is performing a join between two tables that are frequently accessed together. Which schema design can optimize this query?

A.Use interleaved tables
B.Use a foreign key constraint
C.Create a secondary index
D.Denormalize the data into a single table
AnswerA

Interleaving colocates parent and child rows, reducing cross-split joins.

Why this answer

Interleaved tables store child rows physically with parent rows, improving locality for parent-child joins.

632
MCQmedium

Your application uses Cloud SQL for PostgreSQL. You notice that the database CPU utilization has been consistently above 90% during peak hours, causing increased query latency. You have already tuned the most expensive queries. What is the most cost-effective next step?

A.Enable high availability with a failover replica.
B.Implement connection pooling via Cloud SQL Proxy or a dedicated pooler like PgBouncer.
C.Increase the machine type to a higher CPU tier.
D.Add a read replica to offload read queries.
AnswerB

Connection pooling reduces the number of active connections, lowering context switching and CPU overhead.

Why this answer

The question states that expensive queries have already been tuned, yet CPU remains high. This indicates that the database is spending excessive CPU on handling connection overhead (forking processes, parsing sessions) rather than query execution. Connection pooling with PgBouncer reduces the number of active connections, allowing PostgreSQL to reuse backend processes and significantly lower CPU usage without scaling hardware.

Exam trap

The trap here is that candidates often assume high CPU always means underpowered hardware (Option C) or that read replicas (Option D) solve all performance issues, but they overlook the hidden cost of connection overhead in PostgreSQL's process-per-connection model. In Google Cloud exams, be mindful that Cloud SQL for PostgreSQL benefits greatly from connection pooling via PgBouncer when CPU is high despite query optimization.

How to eliminate wrong answers

Option A is wrong because enabling high availability with a failover replica does not reduce CPU utilization on the primary instance; it only provides redundancy in case of failure. Option C is wrong because increasing the machine type to a higher CPU tier is a vertical scaling approach that incurs higher cost without addressing the root cause of connection overhead; it may temporarily mask the issue but is not the most cost-effective step. Option D is wrong because adding a read replica offloads read queries but does not reduce CPU consumption from connection management or write-heavy workloads; the primary instance still handles all writes and connection overhead.

633
MCQhard

A service has an SLO based on request latency: 99% of requests must complete under 500ms over a 28-day window. The team wants to monitor the error budget burn rate. Which Cloud Monitoring SLO type and configuration should be used?

A.Request-based SLO: good request count / valid request count with threshold 500ms
B.Window-based SLO: good minutes / total minutes with threshold 500ms
C.Request-based SLO: good request count / total request count with threshold 500ms
D.Window-based SLO: good requests / total requests with threshold 500ms
AnswerA

Correct: request-based SLO with a latency threshold.

Why this answer

A request-based SLO with a good-request-count/valid-request-count metric is appropriate for latency SLIs. The threshold is set at 500ms. Window-based SLOs are for uptime, not latency.

634
MCQmedium

A BI team finds that their BigQuery query that aggregates sales by region runs slower than expected, even with appropriate clustering and partitioning. The query filters on a date range and then groups by region. The table is partitioned by date and clustered by region. What can the team do to improve query performance without increasing cost?

A.Increase the number of clusters to include more columns.
B.Change the partition type to ingestion-time partitioning.
C.Add an ORDER BY clause to the query.
D.Use a materialized view that pre-aggregates sales by region and date.
AnswerD

Materialized views provide pre-computed results, reducing query time and data processed.

Why this answer

A materialized view in BigQuery can pre-aggregate sales by region and date, allowing the query to read precomputed results instead of scanning the entire table. This reduces the amount of data processed and speeds up the query without increasing cost, as the materialized view is automatically maintained and only incremental changes are processed.

Exam trap

The trap here is that candidates often think adding more clustering columns or sorting will improve aggregation performance, but they fail to recognize that pre-aggregation via materialized views is the only option that reduces the data scanned without increasing cost.

How to eliminate wrong answers

Option A is wrong because increasing the number of clusters to include more columns does not improve performance for a query that already filters on a partitioned column and groups by a clustered column; additional clustering columns can increase write overhead and may not reduce the data scanned. Option B is wrong because changing to ingestion-time partitioning does not provide any benefit over the existing date-based partitioning; ingestion-time partitioning is typically used when no timestamp column exists, and it would not improve query performance for date-range filters. Option C is wrong because adding an ORDER BY clause does not reduce the amount of data scanned or processed; it only sorts the final result, which adds overhead without addressing the root cause of slow aggregation.

635
MCQmedium

During an incident, the incident commander delegates tasks to multiple teams. After the incident is resolved, the team holds a postmortem. Which of the following is a key principle of a blameless postmortem culture?

A.Analyze contributing factors and implement action items with owners
B.Focus on human error and retraining
C.Identify the individual responsible and assign corrective action
D.Share the postmortem only with the incident commander
AnswerA

This is the correct approach: identify contributing factors and create action items with owners and deadlines.

Why this answer

Blameless postmortems focus on identifying system and process failures, not individual mistakes. The goal is to improve reliability.

636
Multi-Selectmedium

An SRE team wants to implement error budget burn rate alerts for a service with SLO 99.9% over 30 days. They need to be notified both when the error budget is being consumed rapidly (full consumption in ~2 days) and when it is being consumed slowly (full consumption in ~6 days). Which two alert configurations should they use? (Choose 2)

Select 2 answers
A.Burn rate threshold: 2, lookback window: 1 hour
B.Burn rate threshold: 14, lookback window: 1 hour
C.Burn rate threshold: 5, lookback window: 6 hours
D.Burn rate threshold: 10, lookback window: 1 hour
E.Burn rate threshold: 14, lookback window: 6 hours
AnswersB, C

Burn rate 14, window 1 hour: Exhausts budget in ~2.14 days, closest to rapid consumption among options; correct for fast alert.

Why this answer

The correct choices are B (burn rate 14, window 1 hour) and C (burn rate 5, window 6 hours). These are the standard Google SRE recommended alert configurations for fast and slow error budget burn rate alerts. Option B: With a burn rate of 14 over a 1-hour window, the error budget would be exhausted in approximately 2.14 days (30 days / 14), matching the requirement for rapid consumption (~2 days).

Option C: A burn rate of 5 over a 6-hour window exhausts the budget in 6 days (30 days / 5), matching the 'slow' consumption requirement of ~6 days. Option A (2/1) would exhaust in 15 days, too slow for rapid. Option D (10/1) exhausts in 3 days, not fast enough.

Option E (14/6) exhausts in 2.14 days but with a longer window, making it less suitable for rapid detection. Therefore, B and C are the correct pair.

637
Multi-Selecthard

A DevOps engineer is optimizing a GKE workload that is CPU-bound. They want to ensure proper resource allocation to improve performance. Which three actions should they take? (Choose THREE).

Select 3 answers
A.Set min instances on Cloud Run
B.Set Horizontal Pod Autoscaler based on CPU utilization
C.Use preemptible nodes
D.Enable Cluster Autoscaler for node scaling
E.Configure Vertical Pod Autoscaler in Auto mode
AnswersB, D, E

HPA scales pods when CPU is high.

Why this answer

VPA recommends resource requests/limits; cluster autoscaler ensures node capacity; HPA handles scaling based on CPU.

638
Multi-Selecteasy

Which TWO metrics are examples of GAUGE metric types? (Select 2)

Select 2 answers
A.CPU utilization
B.Total number of active users
C.Disk read bytes per second
D.Memory usage
E.Request count per second
AnswersA, D

CPU utilization is a gauge.

Why this answer

GAUGE metrics represent a value at a point in time, such as CPU usage or memory usage. Request count is a DELTA or CUMULATIVE metric, and disk read bytes per second is a DELTA metric.

639
MCQeasy

A company is building a business intelligence dashboard on BigQuery to analyze daily sales data. The table contains a TIMESTAMP column 'order_ts' and a string column 'region'. The BI team frequently filters by month and region. Which table design best optimizes query performance and cost?

A.Use a separate table for each region
B.Clustering by order_ts and region without partitioning
C.Partition the table by date (month) and cluster by region
D.Partition the table by region and cluster by order_ts
AnswerC

Partitioning on the date granularity used in filters and clustering on region minimizes scanned data.

Why this answer

Partitioning the table by month (using the DATE_TRUNC function on order_ts) allows BigQuery to prune entire partitions when filtering by month, reducing the amount of data scanned and thus lowering cost. Clustering by region further organizes data within each partition, enabling efficient block-level pruning for region filters. This combination optimizes both query performance and cost for the BI team's common filter pattern.

Exam trap

A common misconception is to partition on the most frequently filtered column, such as region. However, partitioning on a low-cardinality column like region creates many small partitions, leading to poor performance and cost. In Google BigQuery, partitioning on a date/time column and clustering on low-cardinality filters like region is optimal for queries filtering by month and region.

How to eliminate wrong answers

Option A is wrong because using separate tables for each region increases management overhead, requires UNION queries for cross-region analysis, and prevents BigQuery from optimizing scans across regions; it also violates normalization principles and can lead to higher storage costs due to redundant metadata. Option B is wrong because clustering without partitioning does not allow BigQuery to skip entire storage blocks based on time filters; the BI team frequently filters by month, and without partitioning, every query must scan all data, increasing cost and latency. Option D is wrong because partitioning by region and clustering by order_ts is inefficient: region has low cardinality (few distinct values), leading to many small partitions that degrade performance due to metadata overhead, and the common month filter cannot leverage partition pruning since partitions are by region, not time.

640
MCQeasy

A company is running analytical queries on large datasets (terabytes) that involve aggregations, joins, and window functions. The data is updated daily via batch loads. The queries must complete in seconds to minutes. Which Google Cloud database service is BEST suited for this workload?

A.Cloud SQL for MySQL
B.Cloud Spanner
C.Bigtable
D.BigQuery
AnswerD

BigQuery is purpose-built for analytics, with fast SQL on large datasets.

Why this answer

BigQuery is a serverless data warehouse designed for large-scale analytics with fast SQL queries. It handles terabytes to petabytes, charges by query usage, and is ideal for OLAP workloads.

641
MCQeasy

An SRE team wants to alert when the error budget burn rate exceeds 14x the allowed rate over a 1-hour window. Which Cloud Monitoring alert policy configuration is appropriate?

A.Alert on error budget burn rate > 14 over a 1-hour window
B.Alert on error budget burn rate > 14 over a 6-hour window
C.Alert on error budget burn rate > 5 over a 1-hour window
D.Alert on error budget burn rate > 8 over a 2-hour window
AnswerA

Correct: fast burn alert uses 1-hour window with burn rate > 14.

Why this answer

For fast burn alert, use a 1-hour window with a burn rate threshold of 14. The burn rate is calculated as the ratio of actual failures to the allowed error budget per time unit.

642
MCQeasy

Your Cloud Spanner instance has high latency for point reads. The workload is evenly distributed across all nodes. Which metric should you examine first to identify the bottleneck?

A.CPU utilization per node
B.Storage utilization
C.Rows returned per second
D.Number of committed nodes
AnswerA

High CPU suggests node is overloaded, causing latency.

Why this answer

High latency for point reads in Cloud Spanner, even with evenly distributed workload, often points to CPU saturation on individual nodes. Spanner uses a shared-nothing architecture where each node handles a portion of the data and queries; if CPU utilization per node is high, it indicates that the node is overloaded, causing queuing and increased latency. This metric directly reflects processing capacity and is the first place to look for a bottleneck in point-read performance.

Exam trap

Google Cloud often tests the misconception that evenly distributed workload means no node-level bottleneck, but the trap here is that even distribution does not guarantee low latency if each node is individually under high CPU load, so candidates incorrectly focus on throughput or storage metrics instead of CPU utilization.

How to eliminate wrong answers

Option B is wrong because storage utilization measures disk space usage, not processing capacity; Spanner automatically manages storage distribution and high storage does not directly cause point-read latency. Option C is wrong because rows returned per second is a throughput metric, not a latency metric; high throughput can coexist with high latency if nodes are overloaded, so it does not identify the bottleneck. Option D is wrong because 'number of committed nodes' is not a standard Spanner metric; Spanner uses a fixed number of nodes provisioned, and committed nodes refer to a different concept (e.g., in Google Cloud commitments), not a real-time performance indicator.

643
MCQmedium

A team uses Cloud Build to build a Docker image and push it to Artifact Registry. They need to cache Docker layers to speed up subsequent builds. The build runs on a private pool with access to a VPC. Which caching approach should they implement in cloudbuild.yaml?

A.Build images with --no-cache flag to ensure consistency
B.Docker cache import/export with a GCS bucket
C.Use BuildKit with inline cache
D.Kaniko layer caching with cache repository in Artifact Registry
AnswerD

Kaniko supports --cache-repo to cache layers in Artifact Registry, which is efficient and works with Cloud Build.

Why this answer

Kaniko layer caching with a cache repository in Artifact Registry is the recommended method for Cloud Build. It stores intermediate layers and reuses them when unchanged. Docker cache import/export requires a persistent volume, which is not native to Cloud Build.

644
MCQeasy

A Site Reliability Engineer is tasked with reducing toil in their team. They identify that resetting expired database connections manually is a common task. What is the best way to automate this toil?

A.Use Cloud Scheduler to invoke a Cloud Function that resets connections
B.Create a Cloud Workflow that runs every hour
C.Train all team members to reset connections manually
D.Write a cron job on a Compute Engine instance
AnswerA

This is serverless, event-driven, and reduces toil.

Why this answer

Automating toil typically involves using serverless automation or workflow services. Cloud Functions are ideal for event-driven automation like resetting connections on a schedule or in response to an alert. Cloud Workflows is for orchestrating longer running tasks.

Cloud Scheduler can trigger a Cloud Function to perform the reset. The best option is to use a Cloud Function triggered by Cloud Scheduler to reset connections periodically or on-demand.

645
MCQmedium

A team is migrating a MongoDB application to Firestore. The data model includes embedded documents and references between collections. Which approach should they follow to maintain similar query performance?

A.Flatten all data into a single document per entity
B.Replicate data across multiple collections to avoid reads
C.Use subcollections for embedded data and references for relationships
D.Use a single collection for all documents and rely on client-side joins
AnswerC

Subcollections preserve the embedded document structure; references handle relationships.

Why this answer

Firestore supports subcollections (similar to embedded documents) and references. Denormalization can reduce the need for joins. Avoiding transactions for every write is not ideal for consistency.

The recommended pattern is to use subcollections for embedded data and references for related entities.

646
MCQhard

Refer to the exhibit. You restored a Spanner database from a backup and are checking the status of the optimize operation. The operation has been running for 15 minutes and is 45% complete. The database is already accessible but queries on it are slower than expected. What should you do?

A.Continue running queries; performance will improve once the optimize operation completes.
B.Wait for the operation to finish before allowing any queries.
C.Drop and restore the database again to start fresh.
D.Cancel the optimize operation to reduce resource usage.
AnswerA

The optimize operation rebuilds indexes and updates statistics, which improves query performance.

Why this answer

Spanner's optimize operation runs asynchronously and does not block database access. Queries are slower during optimization because the operation reorganizes data and rebuilds indexes, which consumes I/O and CPU resources. Once the optimize operation completes, query performance will improve as the data layout becomes more efficient.

Exam trap

Google Cloud often tests the misconception that database maintenance operations like optimization must complete before the database is usable, but Spanner is designed for continuous availability and allows queries during such operations.

How to eliminate wrong answers

Option B is wrong because Spanner allows queries during an optimize operation; waiting is unnecessary and defeats the purpose of high availability. Option C is wrong because dropping and restoring the database would restart the optimization from scratch, wasting time and resources without any benefit. Option D is wrong because canceling the optimize operation would leave the database in a suboptimal state, and performance would remain degraded until optimization is completed or re-triggered.

647
MCQeasy

A company needs to store session data for a web application that runs on Google Kubernetes Engine (GKE). The data is temporary and high-availability is required. Which database service is most appropriate?

A.Cloud Spanner
B.Cloud SQL for MySQL
C.Memorystore for Redis with replication
D.Cloud Bigtable
AnswerC

Memorystore provides a highly available in-memory cache, perfect for session data.

Why this answer

Memorystore for Redis with replication is the most appropriate choice because session data is temporary, requires high availability, and benefits from Redis's in-memory, low-latency key-value store. Replication provides failover capability, ensuring session continuity if a primary node fails, while Redis's built-in expiry (TTL) handles temporary data cleanup automatically.

Exam trap

Google Cloud often tests the distinction between 'persistent storage' and 'temporary cache'—candidates mistakenly choose Cloud SQL or Spanner for 'high availability' without recognizing that session data is ephemeral and better served by an in-memory store with replication.

How to eliminate wrong answers

Option A is wrong because Cloud Spanner is a globally distributed, strongly consistent relational database designed for OLTP workloads with horizontal scaling, not for temporary session data; its high cost and latency overhead are unnecessary for ephemeral key-value storage. Option B is wrong because Cloud SQL for MySQL is a relational database with disk-based storage, which introduces higher latency and operational overhead for session data that is better served by an in-memory cache; it also lacks native TTL-based expiry for temporary data. Option D is wrong because Cloud Bigtable is a wide-column NoSQL database optimized for large-scale analytical and time-series workloads, not for low-latency session storage; its access patterns and cost model are mismatched for transient, high-frequency read/write session data.

648
MCQmedium

A team needs to create an alert that triggers when the 99th percentile latency of a service exceeds 500ms for at least 10 minutes. Which alerting configuration is correct?

A.Absent condition with duration 10 min, based on 'latency' metric.
B.Metric threshold condition with alignment period 10 min, reducer MEAN, based on 'latency' metric.
C.Metric threshold condition with alignment period 10 min, reducer PERCENTILE_99, based on 'latency' metric.
D.Metric threshold condition with alignment period 10 min, reducer COUNT, based on 'latency' metric.
AnswerC

PERCENTILE_99 reducer computes the 99th percentile over the alignment period.

649
Matchingmedium

Match each BigQuery DDL statement to its function.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

Creates a new table

Modifies table schema or options

Deletes a table

Creates a logical view

Creates a precomputed view for faster queries

Why these pairings

BigQuery DDL statements manage database objects. CREATE TABLE and CREATE VIEW define new objects, while DROP TABLE removes them. Common confusions arise from swapping CREATE and DROP or using ALTER for creation.

650
MCQmedium

A startup is building a real-time analytics dashboard that ingests 500,000 events per second and needs to query the last hour of data with sub-second latency. The data has a high write volume and the query pattern is time-range scans. Which Google Cloud database is most appropriate?

A.Cloud Spanner
B.Cloud SQL (PostgreSQL)
C.BigQuery
D.Cloud Bigtable
AnswerD

Bigtable supports millions of writes per second and sub-second latency for time-range scans, perfect for this workload.

Why this answer

Cloud Bigtable is the correct choice because it is a fully managed, scalable NoSQL database designed for high-throughput writes and low-latency time-series data access. It supports sub-second latency on time-range scans by storing data in sorted order by row key, making it ideal for ingesting 500,000 events per second and querying the last hour of data.

Exam trap

The trap here is that candidates often choose BigQuery for analytics workloads, but BigQuery is not designed for sub-second real-time queries on streaming data, whereas Cloud Bigtable is purpose-built for high-throughput, low-latency time-series access.

How to eliminate wrong answers

Option A is wrong because Cloud Spanner is a globally distributed relational database optimized for strong consistency and complex transactions, not for high-volume time-series scans with sub-second latency. Option B is wrong because Cloud SQL (PostgreSQL) is a traditional relational database that cannot handle 500,000 writes per second without significant scaling issues and lacks the columnar or sorted storage needed for fast time-range scans. Option C is wrong because BigQuery is a data warehouse designed for analytical queries on large datasets, not for real-time sub-second queries on streaming data; its latency is typically seconds to minutes for interactive queries.

651
MCQmedium

A data engineer is migrating a Teradata data warehouse to BigQuery. They have a large number of BTEQ scripts that need to be converted. Which tool is designed to automate the conversion of Teradata DDL and BTEQ scripts to BigQuery-compatible SQL?

A.Database Migration Service
B.Ora2Pg
C.Schema Conversion Tool (SCTS)
D.BigQuery Data Transfer Service
AnswerC

SCTS automates conversion of Teradata schemas and BTEQ scripts to BigQuery.

Why this answer

Schema Conversion Tool (SCTS) is provided by Google Cloud to automate the conversion of Teradata (and other) DDL and BTEQ scripts to BigQuery SQL. BigQuery Data Transfer Service is for loading data from SaaS applications. Ora2Pg is for Oracle to PostgreSQL.

Database Migration Service is for database migrations to Cloud SQL or AlloyDB.

652
MCQeasy

A company is using Memorystore for Redis and wants to ensure data persistence in case of a failure. What is the recommended approach?

A.Configure a standard tier instance, which provides automatic persistence.
B.Enable RDB persistence and configure the backup interval.
C.Use Cloud Storage snapshots (export) or configure cross-region replication.
D.Enable AOF persistence in Memorystore settings.
AnswerC

Correct. Use scheduled exports to Cloud Storage or cross-region replication for disaster recovery.

Why this answer

Memorystore for Redis does not support native persistence (AOF/RDB). For data durability, the recommendation is to use scheduled Cloud Storage snapshots or cross-region replication.

653
MCQmedium

A Cloud SQL for PostgreSQL instance has a read replica lagging behind the primary. The team needs to monitor the replica lag and set up an alert if it exceeds 60 seconds. Which metric should they use?

A.bytes_received
B.disk_read_ops
C.replication_lag
D.cpu_utilization
AnswerC

This metric directly measures replica lag in seconds.

Why this answer

The correct metric is `replication_lag` because it directly measures the delay in seconds between the primary and read replica in Cloud SQL for PostgreSQL. This metric reflects how far behind the replica is in applying changes from the primary's write-ahead log (WAL), making it the precise indicator for alerting when lag exceeds 60 seconds.

Exam trap

The trap here is that candidates might confuse performance metrics like CPU or disk I/O with direct replication delay, assuming high resource usage always indicates lag, when in fact `replication_lag` is the only metric that measures the exact time difference between primary and replica.

How to eliminate wrong answers

Option A is wrong because `bytes_received` measures the amount of data received by the instance, not the time delay in replication; it could be high even when lag is low. Option B is wrong because `disk_read_ops` tracks input/output operations on disk, which is unrelated to replication lag and instead indicates storage performance. Option D is wrong because `cpu_utilization` measures processor usage, which does not directly represent the replication delay; high CPU could cause lag but is not a direct measure of it.

654
MCQmedium

A company uses Cloud Profiler to analyze CPU usage of a Java application running on GKE. They see a function consuming 40% of CPU time. To investigate further, they want to see the exact line numbers in the source code. What should they do?

A.Use Cloud Trace to trace the function call
B.Enable debug symbols in the application and upload source code to Cloud Profiler
C.Enable structured logging for the application
D.Switch to a different profiling tool
AnswerB

Source code upload allows Profiler to map addresses to line numbers.

Why this answer

Cloud Profiler requires the source code to be available and configured for symbolication. The flame graph shows function names, but line numbers require source context.

655
Multi-Selectmedium

You are designing a Spanner schema for a financial application that stores transactions for user accounts. To avoid hotspots and optimize performance, which TWO practices should you follow?

Select 2 answers
A.Store all data in a single table without interleaving.
B.Use the STORING clause in secondary indexes to include frequently accessed columns.
C.Use a UUID as the primary key.
D.Use a monotonically increasing integer as the primary key.
E.Create secondary indexes without the STORING clause.
AnswersB, C

Optimizes read performance.

Why this answer

The STORING clause in a Spanner secondary index allows you to include non-key columns directly in the index, enabling index-only scans that avoid a back-join to the base table. This reduces read latency and resource consumption, which is critical for high-throughput financial transaction queries.

Exam trap

A common misconception in Spanner is that monotonically increasing keys are safe, but they create hotspots. Candidates must remember that UUIDs or other high-cardinality, non-sequential keys are required for write distribution.

656
Multi-Selectmedium

A company is migrating a 5 TB Oracle database to Cloud SQL for PostgreSQL using DMS with continuous migration. They need to minimize downtime and have a rollback plan. Which TWO actions should they include in their migration plan? (Choose TWO.)

Select 2 answers
A.Use a one-time migration job instead of continuous.
B.Test the application against the destination Cloud SQL instance before cutover.
C.Delete the source database immediately after promoting the destination.
D.Skip schema conversion and use raw Oracle SQL.
E.Keep the source database running in read-only mode for a period after cutover.
AnswersB, E

Validates functionality before final switch.

Why this answer

A rollback plan involves keeping the source available in read-only mode for a validation window. Testing the application against the destination also validates the migration before cutover.

657
MCQeasy

A data engineer needs to grant a service account read-only access to a Cloud Storage bucket containing sensitive data. The service account is used by a Compute Engine instance. What is the most secure way to assign the permissions?

A.Set bucket ACLs to allow read access for the service account.
B.Make the bucket public and rely on network restrictions.
C.Grant the service account the Storage Object Viewer role at the project level.
D.Grant the service account the Storage Object Viewer role on the specific bucket.
AnswerD

Bucket-level IAM grants least privilege.

Why this answer

Granting the Storage Object Viewer role at the bucket level applies the principle of least privilege, restricting the service account's read-only access to only that specific bucket. This avoids granting broader permissions at the project level, which would inadvertently allow access to all buckets in the project. Using IAM roles is more secure and manageable than legacy bucket ACLs.

Exam trap

Google Cloud often tests the principle of least privilege by making candidates choose between project-level and resource-level IAM roles, where the trap is assuming project-level roles are acceptable without considering the broader access they grant.

How to eliminate wrong answers

Option A is wrong because bucket ACLs are a legacy access control mechanism that are less granular and harder to audit than IAM roles; they also do not support service accounts natively in the same way IAM does, and mixing ACLs with IAM can lead to unintended permissions. Option B is wrong because making the bucket public exposes the sensitive data to anyone on the internet, and network restrictions alone are insufficient for authentication and authorization, violating the principle of least privilege. Option C is wrong because granting the Storage Object Viewer role at the project level gives the service account read access to all buckets in the project, not just the one containing sensitive data, which unnecessarily broadens the attack surface.

658
MCQmedium

A team wants to define an SLO for a microservice that processes batch jobs. The service is considered healthy if each batch completes within 60 minutes. There are 100 batches per day. Which SLI should be used?

A.Latency SLI: proportion of batches under 60 minutes
B.Request-based SLI with good-request-count / valid-request-count
C.Window-based SLI with good-minutes / total-minutes
D.Availability SLI: successful batch completions / total batch completions
AnswerC

Window-based SLI is correct for time-bounded processing like batch jobs.

Why this answer

A window-based SLI measures the proportion of good minutes (or windows) over total minutes. Since the service has a time-bounded objective (60 minutes per batch), a window-based SLI that counts each minute as 'good' if the oldest incomplete batch is less than 60 minutes old is appropriate. Request-based SLIs are for request/response patterns.

659
MCQmedium

A company is setting up access control for a BigQuery dataset using the above IAM policy. An analyst who is a member of the group 'analysts@example.com' also has the user account 'analyst@example.com'. They need to create new tables in the dataset. What will be the outcome?

A.The analyst will get an error because of conflicting roles.
B.The analyst cannot create tables because the group only has dataViewer.
C.The analyst can create tables because they have dataOwner role on their user account.
D.The analyst can create tables if they also have jobUser role.
AnswerC

The dataOwner role includes all dataset permissions, including table creation.

Why this answer

IAM policies grant permissions based on the union of all roles assigned to the user, regardless of whether they come from group membership or direct user assignment. The analyst has the `dataOwner` role directly on their user account, which includes the `bigquery.tables.create` permission required to create new tables. Group membership with a lower-privilege role (e.g., `dataViewer`) does not override or conflict with the higher-privilege role on the user account.

Exam trap

Google Cloud IAM often tests the misconception that group membership overrides direct user roles or that conflicting roles cause errors, when in reality IAM permissions are additive and the highest privilege always applies.

How to eliminate wrong answers

Option A is wrong because IAM permissions are additive, not conflicting; having multiple roles does not cause errors—the effective permissions are the union of all granted roles. Option B is wrong because the analyst's direct `dataOwner` role on their user account supersedes the group's `dataViewer` role, allowing table creation. Option D is wrong because the `jobUser` role is not required for table creation; the `dataOwner` role already includes the necessary `bigquery.tables.create` permission, and `jobUser` only allows running query jobs, not creating tables.

660
MCQhard

A global e-commerce company uses Cloud SQL for MySQL to store inventory data. They have a single primary instance in us-central1 and two read replicas in us-west1 and europe-west1 for local reads. Recently, the primary instance experienced a hardware failure causing an outage. The failover to a Cloud SQL high availability (HA) instance took 2 minutes. However, during that time, inventory updates were lost because the binary log position was not fully synchronized. The company requires zero data loss for inventory updates. What should the database engineer do?

A.Migrate to Cloud Spanner with multi-region configuration.
B.Use Cloud SQL with external replication and a stand-by instance in another region.
C.Implement application-level write-ahead logging and replay on failover.
D.Enable point-in-time recovery with a 7-day retention.
AnswerA

Spanner offers synchronous replication across regions, ensuring zero data loss.

Why this answer

Cloud Spanner with a multi-region configuration provides synchronous replication across regions, ensuring strong consistency and zero data loss during failover. Unlike Cloud SQL's asynchronous replication, Spanner uses the Paxos protocol to commit writes across multiple regions before acknowledging success, which eliminates the risk of lost inventory updates during a primary failure.

Exam trap

The trap here is that candidates assume Cloud SQL's high availability (HA) with regional replicas can guarantee zero data loss, but they overlook that Cloud SQL uses asynchronous replication for read replicas, which inherently risks data loss during a primary failure.

How to eliminate wrong answers

Option B is wrong because Cloud SQL with external replication still relies on asynchronous binary log replication, which cannot guarantee zero data loss during a failover; the stand-by instance would have the same synchronization lag issue. Option C is wrong because implementing application-level write-ahead logging and replay on failover adds complexity and does not address the underlying database replication gap; it still depends on the database's binary log position, which was not fully synchronized. Option D is wrong because point-in-time recovery (PITR) with a 7-day retention only allows restoring to a specific time in the past from backups, not real-time failover; it does not prevent data loss during a hardware failure because the binary log position was not synchronized at the moment of the outage.

661
MCQeasy

A Cloud Run service experiences cold starts on the first request after being idle, causing latency spikes. The team wants to eliminate cold starts entirely. Which configuration setting should they use?

A.Set CPU to always on
B.Set max instances to 1
C.Set min instances to a value greater than 0
D.Set concurrency to 1
AnswerC

Min instances ensures the specified number of instances are always running, eliminating cold starts.

Why this answer

Setting a minimum number of instances (min instances) keeps the specified number of instances always warm, preventing cold starts. CPU always on prevents throttling but does not eliminate cold starts. Max instances limits scale but does not prevent cold starts.

Concurrency controls how many requests an instance can handle but does not eliminate cold starts.

662
MCQeasy

A company uses Cloud Spanner and needs to retain backups for 365 days for compliance. What is the maximum backup expiration period that can be set for a Spanner backup?

A.30 days
B.365 days
C.Unlimited
D.90 days
AnswerB

The max backup expiration for Spanner is 365 days.

Why this answer

Spanner backups can have an expiration time set to a maximum of 365 days from the creation time. After that, the backup is automatically deleted.

663
Multi-Selectmedium

A company is evaluating Google Cloud databases for a new application that requires: (1) strong global consistency across multiple regions, (2) the ability to run complex analytical queries on the same data as the transactional workload, and (3) high write throughput. Which TWO databases should they consider?

Select 1 answer
A.Bigtable
B.AlloyDB
C.BigQuery
D.Firestore
E.Cloud Spanner
AnswersE

Cloud Spanner meets all three: strong global consistency via synchronous multi-region replication, high write throughput (scalable), and support for transactional workloads. It does not natively run complex analytical queries, but that can be addressed with external analytics tools.

Why this answer

Cloud Spanner provides strong global consistency across multiple regions via multi-region configurations using synchronous replication, high write throughput (up to 20,000 writes per second per node, scalable), and support for transactional workloads. However, it does not natively handle complex analytical queries on the same data; for HTAP, a separate analytics engine like BigQuery or a dedicated HTAP database such as AlloyDB would be needed. AlloyDB offers HTAP and high write throughput, but its cross-region replication is eventually consistent, failing the strong global consistency requirement.

BigQuery lacks transactional strong consistency and high write throughput. Bigtable provides eventual consistency and no SQL analytical queries. Firestore offers strong consistency only within a single region and no complex analytical queries.

Thus, only Cloud Spanner fully meets the three requirements.

Exam trap

Candidates often assume AlloyDB provides strong global consistency because of its marketing around 'global scale' and 'cross-region replication', but in reality its cross-region replication is eventually consistent. Cloud Spanner is the only Google Cloud database offering strong global consistency across multiple regions.

664
Multi-Selectmedium

A company is designing a Cloud Spanner database for a global inventory system. The application runs OLTP transactions on inventory levels and also needs to generate daily reports that scan the entire inventory table. Which two approaches will reduce the impact of analytical queries on transactional performance?

Select 2 answers
A.Export data to BigQuery daily for reporting
B.Use strong reads for all queries to ensure consistency
C.Use read-only replicas in separate regions for analytical queries
D.Increase the number of processing units to handle both workloads
E.Use interleaved tables for inventory items
AnswersA, C

Offloads analytical queries entirely from Spanner, preventing any impact on OLTP.

Why this answer

Exporting data to BigQuery offloads analytical workloads from Cloud Spanner entirely, preventing large scans from competing for Spanner's CPU and memory resources. BigQuery is purpose-built for analytical queries on large datasets, so daily exports ensure transactional performance remains unaffected by reporting queries.

Exam trap

A common mistake is to think that simply scaling up resources (Option D) or using strong consistency (Option B) can solve workload isolation problems, when in reality architectural separation via read-only replicas or data export is required to prevent analytical queries from starving transactional operations.

665
MCQmedium

A team uses Cloud Build with a cloudbuild.yaml that builds a Docker image. They want to speed up builds by caching the Docker layers using Kaniko cache in Artifact Registry. Which configuration change is required?

A.Add a step that runs 'docker build --cache-from' pointing to an Artifact Registry repo
B.Enable Cloud Build's built-in cache feature in the build configuration
C.Add a 'docker push' step after build to store layers in Artifact Registry
D.Use the '--cache' and '--cache-repo' flags in the kaniko builder step
AnswerD

Kaniko's --cache and --cache-repo flags enable layer caching to a remote repository.

Why this answer

Kaniko supports caching layers to a remote repository. In cloudbuild.yaml, the step using kaniko should set --cache=true and specify the --cache-repo pointing to an Artifact Registry Docker repository.

666
MCQhard

A company runs a batch processing job on Compute Engine VMs. The job is fault-tolerant and can handle individual VM failures by restarting tasks. To reduce costs, they want to use the cheapest possible VMs while ensuring the job completes within a flexible time window. Which VM option is MOST cost-effective?

A.Standard VMs with committed use discounts
B.Preemptible VMs
C.Sole-tenant VMs
D.Standard VMs without discounts
AnswerB

Preemptible VMs offer the lowest cost and are suitable for fault-tolerant batch jobs.

Why this answer

Preemptible VMs are significantly cheaper (up to 60-80% discount) than regular VMs but can be terminated at any time. Since the job is fault-tolerant, preemptibles are ideal for cost savings. Committed use discounts require a 1-year or 3-year commitment, less flexible.

Standard VMs are more expensive. Sole-tenant nodes are for isolation, not cost savings.

667
MCQmedium

An organization uses Cloud Build and wants to inject a secret API key into a build step without exposing it in the cloudbuild.yaml. Which approach should they use?

A.Use `secretEnv` to reference a Secret Manager secret
B.Store the key in a Cloud Build substitution variable
C.Pass the key via `args` with a substitution
D.Store the key in a Cloud Storage bucket and download it in the build
AnswerA

Correct: `secretEnv` injects secrets securely.

Why this answer

Cloud Build's `secretEnv` field allows you to reference a secret stored in Secret Manager and inject it as an environment variable into a build step. This approach ensures the secret value is never exposed in the `cloudbuild.yaml` file or build logs, as Cloud Build retrieves it securely at runtime using the Secret Manager API.

Exam trap

The trap here is that candidates often confuse substitution variables with secure injection, not realizing that substitution variables are resolved and visible in logs, while `secretEnv` is specifically designed to keep secrets out of logs and configuration files.

How to eliminate wrong answers

Option B is wrong because Cloud Build substitution variables are defined in the `cloudbuild.yaml` or passed at build time, and their values are visible in the build logs and the YAML file, which defeats the purpose of keeping the API key secret. Option C is wrong because passing the key via `args` with a substitution still exposes the value in the build logs and the YAML file, as substitutions are resolved and logged. Option D is wrong because storing the key in a Cloud Storage bucket and downloading it in the build step would require the bucket to be publicly accessible or the build service account to have permissions, and the key could be exposed in the build logs or the bucket's access logs, plus it adds unnecessary complexity compared to using Secret Manager.

668
MCQhard

A financial institution requires all data stored in Cloud Spanner to be encrypted using customer-managed encryption keys (CMEK) stored in Cloud KMS. The security team mandates that the key be in a separate project from the Spanner instance. How should the database engineer configure this?

A.Grant the Cloud Spanner service account the Editor role in the key project.
B.Grant the Cloud Spanner service account the Cloud KMS CryptoKey Encrypter/Decrypter role on the key.
C.Specify the key in the Spanner instance creation and provide the user's credentials for KMS access.
D.Grant the Spanner instance's service account the Cloud KMS Admin role on the key.
AnswerB

This role allows Spanner to use the key for encryption and decryption.

Why this answer

Cloud Spanner uses a service account to access Cloud KMS keys. To enable customer-managed encryption keys (CMEK) from a separate project, the Cloud Spanner service account must be granted the Cloud KMS CryptoKey Encrypter/Decrypter role on the specific key. This allows Spanner to encrypt and decrypt data using the key without granting broader permissions.

Exam trap

The trap here is that candidates often confuse the Cloud KMS Admin role (which manages the key lifecycle) with the Encrypter/Decrypter role (which performs cryptographic operations), leading them to select option D instead of B.

How to eliminate wrong answers

Option A is wrong because granting the Editor role in the key project is overly permissive and violates the principle of least privilege; it would allow the Spanner service account to manage all resources in the key project, not just the specific key. Option C is wrong because user credentials cannot be used for KMS access; Spanner requires a service account, not a user account, to authenticate with Cloud KMS. Option D is wrong because the Cloud KMS Admin role grants permissions to manage key policies and rotations, which is unnecessary for encryption/decryption operations and introduces security risks.

669
MCQeasy

A Firestore database has a collection with a composite index on (status, timestamp desc). The query `where status == 'active' order by timestamp desc limit 50` is returning empty results even though there are active documents. What could be the issue?

A.The status field is not indexed.
B.The composite index exists but the order of timestamp is asc instead of desc.
C.The documents have 'active' status but timestamp field is missing.
D.The query requires an index on timestamp only.
AnswerB

The query requires descending order; using an ascending index can cause the query to miss documents.

Why this answer

If the composite index has timestamp in ascending order, the order by desc cannot use the index efficiently, leading to empty results due to scanning in wrong order.

670
Multi-Selecteasy

A data engineer is creating a reporting layer in BigQuery for BI tools. Which TWO practices improve query performance?

Select 2 answers
A.Use approximate aggregate functions when exact accuracy is not needed.
B.Use SELECT * in queries.
C.Use ORDER BY in subqueries unnecessarily.
D.Store all data in a single table without partitioning.
E.Denormalize tables to reduce joins.
AnswersA, E

Approximate functions like APPROX_COUNT_DISTINCT use less resources.

Why this answer

BigQuery's approximate aggregate functions (e.g., APPROX_COUNT_DISTINCT, APPROX_QUANTILES) use HyperLogLog++ and other sketching algorithms to return results with a small, bounded error (typically <1%) while drastically reducing the amount of data scanned and shuffled. This trade-off is ideal for BI dashboards where exact counts are not critical, as it can cut query execution time by orders of magnitude.

Exam trap

Google Cloud often tests the misconception that SELECT * is acceptable in production BI queries, but the trap is that it defeats BigQuery's columnar storage and billing model, leading to unnecessary cost and slower performance.

671
MCQmedium

An e-commerce platform uses Cloud Bigtable for session data. They need to ensure that if one zone fails, the data is still available with eventual consistency. What should they configure?

A.Enable Bigtable replication across zones within the same region
B.Create a Cloud Bigtable cluster with multiple nodes
C.Export Bigtable tables to Cloud Storage periodically
D.Use Cloud Bigtable HDD storage for durability
AnswerA

Replication provides async eventual consistency and failover if a zone goes down.

Why this answer

Bigtable replication across zones provides high availability with eventual consistency (async replication). This meets the requirement of surviving a zone failure.

672
MCQmedium

An application running on GKE needs to send custom metrics to Cloud Monitoring. The team wants to use a vendor-neutral instrumentation approach that also supports traces and logs. Which solution should they choose?

A.Use the Cloud Monitoring API directly from the application to write metrics
B.Use OpenTelemetry SDK and OTel Collector to export to Cloud Monitoring and Cloud Trace
C.Use Prometheus client library and scrape metrics with Managed Service for Prometheus
D.Use the Stackdriver Monitoring client library
AnswerB

OpenTelemetry is vendor-neutral and the Collector can export to multiple backends including Google Cloud.

Why this answer

OpenTelemetry is a vendor-neutral standard for observability (metrics, traces, logs). The OpenTelemetry Collector can run as a DaemonSet on GKE and export data to Cloud Monitoring and Cloud Trace.

673
MCQhard

A Cloud Spanner database is experiencing high CPU utilization on one node. Users report slow queries. The table uses a UUID primary key. What is the most effective action?

A.Add a database index on frequently queried columns.
B.Convert the UUID to a monotonically increasing integer.
C.Use a hash key prefix to distribute writes.
D.Increase the number of nodes in the instance.
AnswerC

A hash prefix spreads writes across multiple nodes, reducing load on a single node.

Why this answer

A hash key prefix can distribute writes more evenly across nodes, preventing hot spots that cause high CPU on a single node. Adding nodes may not resolve a hot spot.

674
MCQhard

A global gaming company uses Cloud Spanner for user profiles and game state. They have a single-region instance in us-central1. Recently, they launched in Europe and notice high latency for European users. They also need to ensure data locality compliance (GDPR). The database is heavily written with throughput spikes. They want to minimize latency without sacrificing write throughput. They consider adding a secondary index on region column. What is the best course of action?

A.Shard the database by region into separate Spanner instances.
B.Use Cloud CDN to cache read data.
C.Create a read-only replica in Europe using Cloud Spanner's read replica feature.
D.Create a multi-region configuration spanning US and Europe, and modify application to read from closest region.
AnswerD

Multi-region provides synchronous replication for low-latency reads/writes globally and meets compliance.

Why this answer

A multi-region Cloud Spanner configuration with regional endpoints allows the application to read from the closest region, reducing latency for European users while maintaining strong consistency and write throughput. Spanner's multi-region configurations use synchronous replication across all regions, ensuring GDPR compliance by keeping European user data within Europe for reads. Write throughput is not sacrificed because Spanner's architecture is designed for high scalability and uses synchronous replication efficiently.

Exam trap

A key trap is that candidates may believe Cloud Spanner multi-region configurations use asynchronous replication, but in fact, Spanner uses synchronous replication across all regions to ensure strong consistency. This means all writes must be committed in all regions before acknowledgment, which does not sacrifice write throughput due to Spanner's architecture. The incorrect assumption that writes are committed only in the primary region and replicated asynchronously leads to misunderstandings about latency and consistency.

How to eliminate wrong answers

Option A is wrong because sharding into separate Spanner instances would break global consistency and require complex application-level routing, and it would not provide a single global database for user profiles and game state. Option B is wrong because Cloud CDN caches static content, not dynamic database writes or transactional data, and it cannot reduce latency for write-heavy workloads or ensure data locality for GDPR. Option C is wrong because Cloud Spanner does not support read-only replicas; it uses multi-region configurations with regional endpoints for read affinity, and a read replica would not handle write throughput spikes or maintain strong consistency.

675
MCQeasy

An SRE team defines an SLO for a batch processing pipeline. Which SLI is most appropriate for pipeline freshness?

A.Percentage of records with correct values
B.Number of records processed per second
C.Age of the most recent output record
D.Number of failed pipeline runs
AnswerC

Correct: indicates how fresh the data is.

Why this answer

Pipeline freshness measures how up-to-date the output data is compared to the input. It's best measured by the age of the most recent output record.

Page 8

Page 9 of 20

Page 10