Courseiva

Google Professional Cloud Database Engineer (PCDE) — Questions 12011275

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

Page 16

Page 17 of 20

Page 18
1201
MCQeasy

What is the purpose of a Google Cloud organization node in the resource hierarchy?

A.It is used to group billing accounts.
B.It is the root node in the GCP resource hierarchy for centralized policy and billing management.
C.It is an alias for a project.
D.It represents a team within a company.
AnswerB

Correct definition.

Why this answer

The organization node is the root resource. It allows centralized management of policies, roles, and billing across all folders and projects. It is required for organization-level IAM and organization policies.

1202
MCQhard

An engineer is migrating an Oracle database to Cloud SQL for PostgreSQL. They use Ora2Pg to convert the schema. One source table uses a column with data type NUMBER(10,2). What is the appropriate PostgreSQL data type after conversion, and which tool should the engineer use to verify the correctness of converted stored procedures?

A.Use VARCHAR2 and test with pgTAP.
B.Use NUMERIC(10,2) and pgTAP to write unit tests for stored procedures.
C.Use FLOAT and rely on Ora2Pg's built-in validation.
D.Use INTEGER for the data type and PL/pgSQL for testing stored procedures.
AnswerB

NUMERIC(10,2) is the correct mapping. pgTAP is a testing framework for PostgreSQL, suitable for verifying stored procedures.

Why this answer

NUMBER(10,2) maps to NUMERIC(10,2) as it is a fixed-point number. Stored procedures converted from PL/SQL to PL/pgSQL should be tested with unit tests, and pgTAP is a popular PostgreSQL testing framework for this purpose. PL/pgSQL is the procedural language, not a testing tool.

Ora2Pg handles conversion but does not provide unit tests.

1203
Multi-Selectmedium

A company is designing a database solution for a global social media application that requires strong consistency, high write throughput, and complex relational queries. Which TWO Google Cloud databases should they consider? (Choose 2)

Select 2 answers
A.Cloud Bigtable
B.BigQuery
C.Cloud Spanner
D.Firestore
E.AlloyDB for PostgreSQL
AnswersC, E

Spanner is globally distributed, strongly consistent, and relational.

Why this answer

Cloud Spanner provides global strong consistency and relational support. AlloyDB offers strong consistency and high performance for relational workloads. Bigtable is eventually consistent.

BigQuery is analytical. Firestore is not globally consistent.

1204
Multi-Selecthard

An engineer is configuring a Cloud Build build pool to connect to resources in a VPC network. They need to ensure the build can access a private Artifact Registry repository. Which three steps should they take?

Select 3 answers
A.Set up Private Service Connect for Artifact Registry
B.Enable public access on the Artifact Registry repository
C.Create a private build pool with the 'network' field set to the VPC network
D.Configure a Cloud NAT gateway for the VPC
E.Grant the Cloud Build service account the 'Artifact Registry Reader' role
AnswersA, C, E

Artifact Registry uses Private Service Connect to expose a private endpoint in the VPC.

Why this answer

Private pools allow builds to use a VPC network. To access private Artifact Registry, the pool must be in the same VPC as the registry endpoint (which uses Private Service Connect or VPC peering), and the service account must have permission to read from the registry.

1205
MCQmedium

A retail company uses Cloud SQL for PostgreSQL for inventory management. The schema has a table 'inventory' with columns: product_id, warehouse_id, quantity, last_updated. The table contains over 100 million rows. The application frequently runs aggregate queries to compute total quantity of a product across all warehouses (e.g., SELECT SUM(quantity) FROM inventory WHERE product_id = ?). These queries are slow, taking tens of seconds. The team tries a covering index on (product_id, quantity) but sees little improvement because they still need to scan many rows. They need to redesign the schema to improve aggregation performance. What is the best approach?

A.Add a covering index on (product_id, quantity).
B.Migrate the inventory table to Cloud Spanner and use interleaved indexes.
C.Use BigQuery as a read replica and query there.
D.Create a summary table 'product_totals' with columns product_id and total_quantity, and use triggers to keep it updated on INSERT/UPDATE/DELETE in inventory.
AnswerD

Pre-aggregation reduces the amount of work needed at query time.

Why this answer

Creating a summary table 'product_totals' that pre-aggregates total quantity per product, updated via triggers on INSERT, UPDATE, DELETE in the inventory table, dramatically speeds up aggregate queries by avoiding full scans of the large table. Option A (covering index on product_id, quantity) was tried and still requires scanning many rows to sum quantities, so it does not solve the performance issue. Option B (migrating to Cloud Spanner) is an unnecessary and costly migration.

Option C (using BigQuery as a read replica) adds latency and complexity without being a schema redesign. Thus, D is the best approach.

Exam trap

Candidates might assume that a covering index or a materialized view would be sufficient. However, Cloud SQL for PostgreSQL does not support materialized views with automatic refresh for this pattern, and a covering index still requires scanning all rows per product. The correct schema redesign is a summary table with triggers.

1206
Multi-Selectmedium

An engineer needs to migrate a MySQL database to Cloud SQL with minimal downtime. Which TWO steps should be part of the migration plan? (Choose 2)

Select 2 answers
A.Create a Cloud SQL read replica from the source
B.Perform a mysqldump and import the dump into Cloud SQL
C.Verify that the source MySQL version is compatible with Cloud SQL
D.Use Database Migration Service (DMS) to set up continuous replication
E.Set up a Cloud VPN tunnel between on-premise and GCP
AnswersC, D

Compatibility check is essential for a successful migration.

Why this answer

DMS provides continuous replication for minimal downtime. Verifying compatibility ensures a smooth migration. Cloud VPN is not required for connectivity if using public IP. mysqldump causes downtime.

Using a read replica is not applicable.

1207
Multi-Selectmedium

A company is migrating an on-premises PostgreSQL database to Cloud SQL. They need to minimize downtime during migration. Which TWO steps should they take?

Select 2 answers
A.Set up a read replica for switchover
B.Use pg_dump and restore
C.Enable automatic backups
D.Configure a high-availability instance
E.Use Database Migration Service with continuous replication
AnswersA, E

Setting up a read replica allows for a near-instantaneous cutover by promoting the replica.

Why this answer

(Set up a read replica for switchover) minimizes downtime by allowing a near-instantaneous cutover: you can promote the read replica to primary with minimal interruption. Option E (Use Database Migration Service with continuous replication) synchronizes changes in real time, enabling a controlled switchover with very low downtime. Option B (pg_dump and restore) involves exporting and importing data, which requires taking the source database offline or operating in read-only mode, causing significant downtime.

Option C (Enable automatic backups) is a backup strategy that does not directly address migration downtime. Option D (Configure a high-availability instance) is post-migration configuration for resilience, not a step that reduces downtime during the migration.

1208
MCQhard

A team is setting up a Cloud Build private pool to build Docker images that need access to resources in a VPC. After creating the private pool, builds fail with network errors. What is the most likely missing step?

A.Grant the Cloud Build service account the 'compute.networkUser' role
B.Configure Service Directory (private connection) between the pool and the VPC
C.Enable Cloud NAT on the VPC
D.Assign a public IP to the build instances
AnswerA

Correct. The Cloud Build service account needs 'compute.networkUser' role on the VPC to create and manage network resources.

Why this answer

For Cloud Build private pools to access resources in a VPC, the Cloud Build service account must have the 'compute.networkUser' role on the VPC. This role allows the pool to create and use network interfaces within the VPC. Without this permission, builds fail with network errors even if the pool is correctly configured.

Exam trap

Candidates may think private pools require explicit peering or service directory, but the actual requirement is the compute.networkUser IAM role on the service account.

1209
MCQmedium

An engineer wants to cache Docker layers in Cloud Build to speed up subsequent builds. The build uses Kaniko to build images. What should they include in the cloudbuild.yaml?

A.Set `--cache=true` and `--cache-repo` in the Kaniko builder arguments
B.Add a step that runs `docker save` and `docker load`
C.Use the `docker` builder instead of Kaniko and set `--cache-from`
D.Enable Cloud Build's built-in caching by setting `cache: true` in cloudbuild.yaml
AnswerA

Correct: Kaniko's `--cache` flag caches layers in the specified repo.

Why this answer

Kaniko uses `--cache=true` and `--cache-repo` to enable layer caching in a registry.

1210
Multi-Selectmedium

A Cloud SQL for MySQL instance has a read replica in a different region. The team wants to monitor replication lag and receive alerts if lag exceeds 60 seconds. Which two steps should they take? (Choose TWO.)

Select 2 answers
A.Create a Cloud Monitoring alerting policy with a condition on 'cloudsql.googleapis.com/database/replication/replica_lag' with threshold >60s.
B.Configure a Cloud Function to query the replica status every minute.
C.Set up a Cloud Scheduler job to run a query on the replica to check lag.
D.Promote the replica to standalone if lag exceeds 60 seconds.
E.Enable the 'replication_lag' metric in Cloud SQL monitoring.
AnswersA, E

This is the correct metric and threshold for alerting on lag.

Why this answer

The replication_lag metric is available in Cloud Monitoring. An alerting policy based on this metric with a threshold of 60 seconds will trigger notifications when lag exceeds that value.

1211
MCQeasy

A company uses BigQuery for BI dashboards. Users report that queries on the sales table take longer than expected. The table contains daily transaction data and is not partitioned. Which action will most improve query performance while minimizing cost?

A.Increase the BigQuery reservation slot count
B.Partition the table by the transaction date column
C.Cluster the table by the transaction date column
D.Denormalize the table by including dimension attributes
AnswerB

Partitioning limits data scanned to relevant partitions, improving performance and reducing cost.

Why this answer

Partitioning the table by the transaction date column allows BigQuery to perform partition pruning, scanning only the relevant date ranges instead of the entire table. This directly reduces the amount of data read, improving query performance and lowering costs since BigQuery charges based on the data scanned.

Exam trap

A common mistake in Google exams is confusing partitioning with clustering. For date-range queries on a non-partitioned table, clustering alone does not reduce the amount of data scanned—it only sorts data within each shard. Partitioning is required to enable partition pruning and avoid full table scans.

Note that Google BigQuery charges based on data scanned, so reducing scanned data directly lowers cost.

How to eliminate wrong answers

Option A is wrong because increasing the reservation slot count only improves concurrency and query throughput, not the efficiency of individual queries; it does not reduce the amount of data scanned and increases cost without addressing the root cause. Option C is wrong because clustering organizes data within partitions or tables to improve filter and sort performance, but without partitioning first, clustering on the date column still requires scanning the entire table for date-range queries, offering minimal benefit. Option D is wrong because denormalization reduces joins but does not reduce the volume of data scanned for date-range filters; it can actually increase storage costs and data scanned if dimension attributes are repeated across rows.

1212
MCQmedium

A team defines an SLO for a data pipeline: 99.9% of data records should be processed within 1 hour of ingestion. They need an SLI to measure this. Which SLI is most appropriate?

A.Pipeline freshness
B.Throughput
C.Error rate
D.Request latency
AnswerA

Freshness measures the age of data at processing time, suitable for batch pipelines.

Why this answer

Pipeline freshness measures the time it takes for data to be available after ingestion. This is commonly used for data processing SLOs.

1213
MCQeasy

Which Cloud Monitoring feature allows you to group log entries from the same request across multiple services using a common identifier?

A.Cloud Trace
B.Cloud Profiler
C.Log-based metrics
D.Error Reporting
AnswerA

Cloud Trace uses trace IDs to correlate requests across services.

Why this answer

Cloud Trace uses trace IDs to correlate requests across services. Logs can include the trace ID to enable correlation between logs and traces.

1214
MCQhard

Refer to the exhibit. The team notices high write latency on the Events table. They are inserting 1,000 events per second. The EventId is generated by a sequence. What is the most likely issue?

A.The sequential primary key creates a hotspot on a single split.
B.The allow_commit_timestamp option on CreatedAt column adds overhead.
C.The BYTES(MAX) data type causes excessive writing.
D.The node count is insufficient for the write throughput.
AnswerA

Sequential keys cause all writes to hit the same split, leading to contention and latency.

Why this answer

The sequential primary key (EventId generated by a sequence) causes all new writes to be directed to the last tablet or split in the table, creating a hotspot. In Cloud Spanner, this leads to contention on a single split, increasing write latency despite adequate overall throughput capacity.

Exam trap

In the Google Professional Cloud Developer Engineer exam, a common pitfall is confusing high write latency with insufficient node count or data type choices, when the real issue is often key design causing a hotspot on a single split in Cloud Spanner.

How to eliminate wrong answers

Option B is wrong because allow_commit_timestamp on the CreatedAt column does not add significant overhead; it simply enables commit timestamp-based reads and does not affect write latency. Option C is wrong because BYTES(MAX) data type does not inherently cause excessive writing; the issue is write distribution, not column size. Option D is wrong because the node count may be sufficient for the write throughput; the problem is that writes are not distributed across nodes due to the sequential key, not that there are too few nodes.

1215
Multi-Selecthard

A company is migrating on-premises PostgreSQL databases to Cloud SQL. They need to minimize downtime and ensure data consistency. Which THREE steps should they follow? (Choose 3)

Select 3 answers
A.Use Database Migration Service to set up continuous replication from the on-premises database.
B.Export the on-premises database to a dump file and import it into Cloud SQL.
C.Manually sync data using a custom script with pg_dump and pg_restore.
D.After replication is caught up, promote the Cloud SQL instance to make it the primary.
E.Create a Cloud SQL for PostgreSQL instance with the same version as the source.
AnswersA, D, E

Correct. DMS supports homogeneous PostgreSQL migrations with minimal downtime.

Why this answer

A typical migration uses Database Migration Service (DMS) with continuous replication for minimal downtime. Setting up replication and then promoting the Cloud SQL instance is standard.

1216
MCQhard

A financial services company uses Cloud Spanner for a global transaction processing system. They notice that certain read queries on a table with frequent writes are returning stale data even though they use strong reads. The table has a primary key of (user_id, transaction_id) and a secondary index on (timestamp). What is the most likely cause of the stale reads?

A.The query is using a stale read timestamp.
B.The query is using a secondary index that has not yet been updated with the latest write.
C.The query is reading from a read-only replica.
D.Cloud Spanner is using eventual consistency for this query.
AnswerB

Secondary indexes can lag behind the base table; a strong read on the index may return stale data if the write committed after the index was last updated.

Why this answer

In Cloud Spanner, secondary indexes are implemented as separate tables that are updated asynchronously relative to the base table. When a strong read uses a secondary index, the read may still see a stale version of the index if the write has not yet been fully replicated to the index table. This is a known behavior: strong reads guarantee consistency only when reading from the base table using the primary key, not when using a secondary index.

Exam trap

The trap here is that candidates assume 'strong reads' guarantee consistency for all queries, but Cloud Spanner's strong consistency guarantee applies only to reads that use the primary key; secondary index reads may return stale data because the index is updated asynchronously.

How to eliminate wrong answers

Option A is wrong because the question explicitly states that strong reads are used, which means the read timestamp is automatically set to the current timestamp, not a stale one. Option C is wrong because Cloud Spanner does not have read-only replicas; all replicas can serve reads, but strong reads are always served from the leader replica, so reading from a non-leader replica would not occur with strong reads. Option D is wrong because Cloud Spanner provides strong consistency for all reads by default; eventual consistency is not a mode that can be selected, and the issue is specific to secondary index staleness, not a general consistency model.

1217
MCQeasy

You are monitoring Cloud Bigtable replication lag. Which metric should you use to determine if replicas are up to date, and what consistency level is typical for Bigtable replication?

A.Use 'replication_lag' metric; consistency is eventually consistent.
B.Use 'cluster_lag' metric; consistency is read-your-writes consistent.
C.Use 'replica_lag' metric; consistency is strongly consistent.
D.Use 'replication_lag' metric; consistency is strongly consistent.
AnswerA

Bigtable replication is asynchronous and eventually consistent; the 'replication_lag' metric measures the delay.

1218
MCQeasy

An engineer wants to trigger a Cloud Build pipeline automatically whenever a pull request is created against the main branch of a GitHub repository. Which type of build trigger should they configure?

A.Scheduled trigger
B.Pull request trigger
C.Manual trigger
D.Push to branch trigger
AnswerB

Pull request triggers fire when a PR is created or updated.

Why this answer

Cloud Build supports push-to-branch and pull request triggers. For pull requests, the 'Pull Request' trigger type is used, which can be scoped to a specific branch like main.

1219
MCQhard

You are planning a Cloud Bigtable cluster for a workload requiring 100,000 reads per second and 50,000 writes per second. The data will be stored on HDD. How many nodes are needed for the projected throughput? (Assume each node provides 10,000 QPS for reads or writes.)

A.20 nodes
B.5 nodes
C.15 nodes
D.10 nodes
AnswerD

10 nodes provide 100,000 reads/s and 100,000 writes/s, covering both.

Why this answer

Each Bigtable node can handle 10,000 QPS for reads or writes. For 100,000 reads/s, need 10 nodes. For 50,000 writes/s, need 5 nodes.

The node count must satisfy both: max(10,5)=10 nodes. Also storage capacity may be a factor but the question focuses on throughput.

1220
MCQmedium

A Cloud SQL for PostgreSQL instance is experiencing high CPU usage during peak hours. Query Insights shows that a complex reporting query is causing full table scans on a large table. The query filters on a column used in JOINs. Which optimization should be applied first?

A.Increase the instance size.
B.Create a read replica for reporting.
C.Use query rewriting with materialized views.
D.Add a composite index on the filtered column and join columns.
AnswerD

Adding an index on the filtered and join columns allows the query to use index seek instead of full table scan, reducing CPU usage.

Why this answer

Adding a composite index on the filtered column and the join columns directly addresses the root cause of the full table scans. Query Insights indicates the query filters on a column used in JOINs; a composite index covering both the filter and join columns allows PostgreSQL to perform an Index Scan instead of a sequential scan, reducing CPU usage without requiring additional infrastructure or data duplication.

Exam trap

Google Cloud often tests the misconception that scaling up or offloading is the first optimization step, when in fact index tuning is the cheapest and most effective initial action for query performance issues caused by full table scans.

How to eliminate wrong answers

Option A is wrong because increasing the instance size (vertical scaling) only masks the symptom of high CPU usage without fixing the inefficient query plan; the full table scans will continue to consume resources, and costs increase without performance guarantee. Option B is wrong because creating a read replica for reporting offloads the query to another instance but does not eliminate the full table scan on the replica; the same inefficient query will still cause high CPU on the replica. Option C is wrong because query rewriting with materialized views pre-computes and stores the result set, which can improve performance for repeated complex queries, but it does not address the immediate full table scan caused by missing indexes; materialized views also require maintenance and may become stale.

1221
MCQeasy

A data engineer needs to design a table to store time-series sensor data arriving every second. The data will be queried mainly for the last hour over a specific device. Which table design minimizes query costs?

A.Partition by ingestion_time, cluster by timestamp
B.Partition by ingestion_time, no clustering
C.No partitioning, cluster by device_id
D.Partition by ingestion_time, cluster by device_id
AnswerD

Partitioning enables time-range pruning; clustering on device_id speeds up per-device lookups.

Why this answer

Minimizes query costs because partitioning by ingestion_time allows the query engine to skip partitions outside the last hour, while clustering by device_id further narrows the scan to only the relevant device's data within those partitions. This combination reduces the amount of data read and the number of files scanned, which is critical for high-frequency time-series data.

Exam trap

Google Cloud often tests the misconception that clustering by the same column as partitioning provides extra benefit, but in reality it is redundant and can increase maintenance overhead without improving query performance.

How to eliminate wrong answers

Option A is wrong because clustering by timestamp within a partition by ingestion_time is redundant—since the partition already organizes data by time, clustering by the same column adds no additional pruning benefit and wastes clustering resources. Option B is wrong because without clustering, queries filtering on device_id must scan all rows in the relevant partitions, leading to full partition scans and higher query costs. Option C is wrong because no partitioning means every query must scan the entire table, even when filtering on the last hour, resulting in maximum data read and cost.

1222
MCQmedium

A DevOps engineer is setting up a new Google Cloud organization for their company. They need to ensure that all projects are created within a structured hierarchy that separates production, staging, development, and sandbox environments. Which folder structure BEST supports this requirement?

A.Create a folder for each product under the organization node, and within each product folder, create subfolders for environments.
B.Create a flat folder structure under the organization node with one folder per team, and place all projects in their team folder regardless of environment.
C.Create a folder for each environment (prod, staging, dev, sandbox) directly under the organization node. Within each environment folder, create subfolders for teams or products, and place projects in those subfolders.
D.Create a flat folder structure with one folder per project type (shared VPC, logging, security) and place all projects in those folders.
AnswerC

This is the standard landing zone design that separates environments and allows inheritance.

Why this answer

The recommended landing zone design uses top-level folders for environments (prod, staging, dev, sandbox) under the organization node, with team/product subfolders inside each environment folder. This allows IAM and org policies to be inherited appropriately.

1223
MCQmedium

A company needs to store petabytes of time-series IoT sensor data and query it with single-digit millisecond latency at millions of reads per second. The data has a simple key-value structure with timestamps. Which Google Cloud database is MOST appropriate?

A.Firestore
B.Cloud Bigtable
C.Cloud Spanner
D.BigQuery
AnswerB

Bigtable is the correct choice: wide-column NoSQL, designed for time-series and IoT workloads, single-digit ms latency, and scales to millions of QPS with additional nodes.

Why this answer

Cloud Bigtable is designed for exactly this use case — petabyte-scale, low-latency (single-digit ms), high-throughput NoSQL storage for time-series, IoT, and financial data. It scales horizontally by adding nodes. BigQuery is optimised for analytics (seconds-to-minutes latency), Cloud SQL is for OLTP (limited to tens of thousands of QPS), and Firestore is for document data with hierarchical structure.

1224
MCQmedium

Your Cloud Run service processes requests from an external API that sends a burst of up to 100 requests per second. You want to maximize throughput while minimizing instances. The service is CPU-bound. What configuration should you use?

A.Use the Gen2 execution environment with higher memory.
B.Set concurrency to 1 to give each request full CPU, and enable CPU always-on.
C.Set concurrency to 1000 to handle burst efficiently.
D.Set concurrency to 80 (default) and CPU always-on.
AnswerB

Concurrency 1 ensures each instance handles one request at a time, maximizing CPU per request.

Why this answer

For CPU-bound services, the default concurrency of 80 may be too high, causing resource contention and slowing down each request. Reducing concurrency to a lower value, such as 1, dedicates the entire CPU to each request, potentially improving throughput per instance. CPU always-on is needed for background tasks but not necessarily for request handling.

Gen2 execution environment can help with higher memory but not CPU-bound throughput directly.

1225
MCQhard

A social media platform uses Cloud SQL for PostgreSQL for its user and post data. The schema has a normalized design with separate 'users' and 'posts' tables. Queries that fetch a user's timeline (joining users and posts) are slow due to heavy read volume. The team wants to optimize the schema for this read-heavy workload without changing the application logic significantly. What schema design change is most appropriate?

A.Migrate to a NoSQL database like Firestore for better read performance.
B.Create a materialized view that joins users and posts, refreshed periodically.
C.Add GIN indexes on the posts table for faster full-text search.
D.Denormalize by embedding commonly accessed user fields (e.g., username, avatar URL) into the posts table.
AnswerD

Denormalizing by embedding commonly accessed user fields (e.g., username, avatar URL) into the posts table reduces the need for JOINs, significantly improving read performance.

Why this answer

Denormalizing by storing relevant user data (e.g., username, avatar) directly in the posts table reduces the need for JOINs, significantly improving read performance. Option A (Migrate to NoSQL like Firestore) is a major architectural change that may not be worth the effort. Option B (Create a materialized view) could help but may introduce staleness and overhead.

Option C (GIN indexes) are for full-text search, not join performance.

1226
Multi-Selecteasy

A company wants to create a BI dashboard that shows daily active users. The data is stored in a BigQuery table with columns: user_id, activity_date, and event_type. Which two optimizations would help reduce query costs? (Choose two.)

Select 2 answers
A.Cluster the table by event_type.
B.Use SELECT * and filter in the BI tool.
C.Use a materialized view with COUNT(DISTINCT user_id) grouped by activity_date.
D.Avoid using the LIMIT clause.
E.Partition the table by activity_date.
AnswersC, E

A materialized view caches the aggregation, avoiding repeated computation.

Why this answer

A materialized view precomputes the COUNT(DISTINCT user_id) grouped by activity_date, so queries against it read only the pre-aggregated results rather than scanning the entire base table. This drastically reduces the amount of data processed, lowering query costs in BigQuery's on-demand pricing model where cost is proportional to bytes processed.

Exam trap

Google Cloud often tests the misconception that clustering alone reduces query cost for any aggregation, but clustering only reduces cost when the query filters or groups by the cluster key, not when the aggregation is on a different column like activity_date.

1227
Multi-Selecthard

A team uses Cloud Build to build and push Docker images to Artifact Registry. They need to ensure that only images built from the main branch and signed by a trusted key can be deployed to GKE using Binary Authorization. Which THREE components must be in place?

Select 3 answers
A.A Binary Authorization attestor configured to verify the attestation key
B.A Cloud Build step that creates a signed attestation using KMS
C.A Cloud Deploy delivery pipeline with a canary strategy
D.An Artifact Registry repository configured with vulnerability scanning
E.A Binary Authorization policy that requires at least one attestation
AnswersA, B, E

The attestor holds the public key to verify attestations.

Why this answer

A Binary Authorization attestor is the component that defines the trusted key(s) used to verify that an image has been signed. Without an attestor configured with the correct public key, Binary Authorization cannot validate the attestation signature, and the policy cannot enforce that only signed images are deployed.

Exam trap

A common misconception is that vulnerability scanning or deployment strategies are part of Binary Authorization enforcement, when in fact only attestors, signed attestations, and a policy requiring attestations are the mandatory components.

1228
MCQmedium

A company runs a Cloud SQL PostgreSQL instance for a SaaS application. They notice that the database CPU is consistently above 90% during peak hours, and queries slow down. The application is read-heavy and can tolerate some replication lag. Which action would MOST effectively reduce CPU load on the primary?

A.Use EXPLAIN ANALYZE to optimize the slowest queries
B.Create read replicas and route read-only queries to them
C.Increase the number of vCPUs on the primary instance
D.Enable connection pooling with PgBouncer via Cloud SQL Auth Proxy
AnswerB

Read replicas offload read traffic from the primary, reducing its CPU utilization effectively.

Why this answer

Creating one or more read replicas and offloading SELECT queries to them reduces CPU load on the primary instance. Adding more vCPU to the primary (scaling up) increases capacity but is more expensive and may not be as cost-effective as read replicas. PgBouncer helps with connection overhead but not CPU load from queries.

Query optimization helps but may not reduce load enough if the volume is high.

1229
MCQhard

A company's BI dashboard queries a BigQuery table that is 20 TB and uses clustering on date and country. The query filters on date and country and also aggregates by category. The query takes 30 seconds. They want to reduce latency to under 5 seconds. What should they do?

A.Partition the table by date.
B.Add clustering by category.
C.Increase query priority.
D.Create a materialized view that aggregates by date, country, and category.
AnswerD

Materialized view stores the aggregated result, so query scans only the view.

Why this answer

A materialized view precomputes and stores the aggregation by date, country, and category, eliminating the need to scan the full 20 TB table on every query. This reduces query latency dramatically by serving pre-aggregated results, directly addressing the filter and aggregation requirements. Partitioning or clustering alone cannot achieve sub-5-second latency on a 20 TB table because they still require scanning all matching partitions or clusters and performing the aggregation at query time.

Exam trap

The trap here is that candidates often assume partitioning or clustering alone can achieve drastic latency reductions, but they overlook that aggregation over a large dataset still requires significant computation, whereas a materialized view precomputes the result, which is the only way to guarantee sub-5-second latency for this workload.

How to eliminate wrong answers

Option A is wrong because partitioning by date only limits the scan to the relevant date range, but the query still must aggregate 20 TB of data across all countries and categories, which cannot reduce latency to under 5 seconds. Option B is wrong because adding clustering by category improves the efficiency of the aggregation step by co-locating data, but it does not precompute the aggregation; the query still must scan and aggregate all rows in the filtered partition, which is too slow for a 20 TB table. Option C is wrong because increasing query priority does not change the amount of data scanned or the computational work required; it only affects scheduling and resource allocation, not the fundamental latency of scanning and aggregating 20 TB.

1230
MCQmedium

A Firestore application stores user profiles that must be queried by any of multiple attributes (age, city, last_login). What is the best schema design to support these queries efficiently?

A.Store attributes in an array field and query with array-contains
B.Create a composite index on the attributes in a single collection
C.Use subcollections per attribute value
D.Create separate documents for each attribute value
AnswerB

Composite indexes enable efficient multi-attribute queries in Firestore.

Why this answer

Firestore requires composite indexes to efficiently query documents across multiple fields (age, city, last_login) in a single collection. Without a composite index, Firestore would need to perform a full collection scan or merge results from separate index scans, which is inefficient and can lead to high latency or query failures. Creating a composite index on the three attributes allows Firestore to use a single index scan to satisfy queries filtering on any combination of these fields.

Exam trap

A common misconception is that array-contains or subcollections can replace composite indexes for multi-attribute filtering, but Firestore's query engine requires explicit composite indexes for any query that combines fields with inequality or equality filters.

How to eliminate wrong answers

Option A is wrong because array-contains queries only check for the presence of a single value in an array field, not for equality or range comparisons on multiple distinct attributes; it cannot support queries like 'age > 30 AND city == 'NYC''. Option C is wrong because using subcollections per attribute value would require multiple queries and client-side merging to filter on multiple attributes, leading to poor performance and complexity; Firestore subcollections are designed for hierarchical data, not multi-attribute filtering. Option D is wrong because creating separate documents for each attribute value would require multiple reads and client-side joins to reconstruct a user profile, violating Firestore's document-oriented model and causing excessive read costs and latency.

1231
MCQhard

A Cloud Spanner instance is experiencing increased latency during peak hours. Monitoring shows CPU utilization nearing 70%. How should they scale?

A.Add more nodes.
B.Change to a higher-tier machine type.
C.Increase the number of splits.
D.Add more processing units.
AnswerA

Adding nodes increases CPU capacity and reduces latency due to high CPU.

Why this answer

Adding more nodes is the correct scaling approach for a Cloud Spanner instance experiencing high CPU utilization and latency. Cloud Spanner distributes data and query processing across nodes; each node provides a fixed amount of compute and storage capacity. Increasing the number of nodes directly increases the available CPU resources, reducing per-node utilization and improving query throughput and latency.

Exam trap

The trap here is that candidates confuse Cloud Spanner's node-based scaling with the machine type scaling used in other Google Cloud services like Cloud SQL or Compute Engine, leading them to select 'Change to a higher-tier machine type' instead of adding nodes.

How to eliminate wrong answers

Option B is wrong because changing to a higher-tier machine type is not a valid scaling mechanism in Cloud Spanner; Spanner uses homogeneous nodes, not machine tiers, and scaling is done by adding or removing nodes. Option C is wrong because increasing the number of splits does not directly add CPU capacity; splits are automatically managed by Spanner for load distribution, and manually increasing them without adding nodes can lead to inefficiency and does not address high CPU utilization. Option D is wrong because 'processing units' is a concept from Cloud Spanner's serverless configuration (fine-grained scaling), but the question describes a standard instance with nodes; adding processing units is not applicable to node-based instances, and even in serverless mode, processing units are a capacity unit, not a direct scaling action for CPU utilization.

1232
MCQmedium

An SRE team wants to reduce toil associated with manual database schema migrations. They currently run SQL scripts manually during maintenance windows. Which Google Cloud service is most appropriate to automate this process in a repeatable way?

A.Cloud Scheduler
B.Cloud Build
C.Workflows
D.Cloud Functions
AnswerB

Cloud Build can run custom steps (e.g., SQL scripts) and is designed for automated, repeatable tasks.

Why this answer

Cloud Build is a CI/CD platform that can execute SQL migration scripts as part of a build pipeline. It integrates with Cloud Source Repositories and can trigger on schema changes. Cloud Functions and Workflows are more for event-driven workflows, not typical for database migrations.

1233
MCQeasy

An organization is deploying a containerized application to Cloud Run. They want to gradually roll out a new revision to 10% of traffic, monitor for errors, and then fully promote if stable. Which Cloud Run feature should they use?

A.Use the --to-revisions flag with gcloud run deploy to assign traffic percentages.
B.Deploy two separate Cloud Run services and use a global load balancer.
C.Use Cloud Deploy with a canary strategy.
D.Use Cloud Load Balancing with a backend bucket to split traffic.
AnswerA

This allows sending a percentage of traffic to the new revision for canary testing.

Why this answer

The `--to-revisions` flag with `gcloud run deploy` allows you to specify traffic percentages for revisions in a single Cloud Run service. This enables a gradual rollout by sending 10% of traffic to the new revision, monitoring for errors, and then promoting it to 100% without deploying a separate service or using external load balancers.

Exam trap

Google Cloud often tests the distinction between native Cloud Run traffic splitting and external tools like Cloud Deploy or Load Balancers, expecting candidates to recognize that Cloud Run's built-in `--to-revisions` flag is the simplest and most direct method for gradual rollouts.

How to eliminate wrong answers

Option B is wrong because deploying two separate Cloud Run services and using a global load balancer adds unnecessary complexity and cost; Cloud Run natively supports traffic splitting between revisions within a single service, making this approach overengineered. Option C is wrong because Cloud Deploy is designed for continuous delivery to GKE or GKE Autopilot clusters, not for Cloud Run; it does not directly manage Cloud Run revision traffic splits. Option D is wrong because Cloud Load Balancing with a backend bucket is used for serving static content (e.g., from Cloud Storage), not for splitting traffic between application revisions in Cloud Run.

1234
MCQeasy

What is the primary purpose of including a runbook URL in an alert policy's documentation?

A.To link to a dashboard that shows the alert's metric
B.To automatically trigger a Cloud Function when the alert fires
C.To provide a direct link to the source code repository
D.To give responders immediate access to troubleshooting steps and escalation procedures
AnswerD

Runbook URL provides actionable guidance for alert responders.

1235
MCQeasy

An organization needs to store backup copies of a Cloud Spanner database for a minimum of 365 days to comply with regulatory requirements. Which backup option should they use?

A.Create a Spanner backup and set the expiration to 365 days
B.Enable point-in-time recovery (PITR) with a 365-day retention period
C.Export the database to Cloud Storage using the gcloud command and set a lifecycle policy
D.Use Cloud SQL for PostgreSQL with automated backups set to 365 days
AnswerA

Spanner backups support expiration up to 365 days, meeting the regulatory requirement.

Why this answer

Cloud Spanner backups can be configured with expiration up to 365 days (max). Import/export to Cloud Storage is not a managed backup solution and does not support PITR. Bigtable backups are for Bigtable, not Spanner.

Cloud SQL backups are for Cloud SQL.

1236
MCQmedium

You are designing a Cloud SQL for PostgreSQL database. The application has a table with 1 million rows that is frequently queried using equality on the 'email' column and range queries on the 'created_at' column. Which index strategy minimizes query latency?

A.Create a full-text index on email.
B.Create a composite B-tree index on (email, created_at).
C.Create a B-tree index on email only.
D.Create separate B-tree indexes on email and created_at.
AnswerB

This index supports the exact query pattern.

Why this answer

A composite B-tree index on (email, created_at) allows the database to satisfy both the equality condition on 'email' and the range condition on 'created_at' in a single index scan. PostgreSQL can use the leftmost column for equality filtering and then traverse the index tree to retrieve the range portion efficiently, minimizing random I/O and query latency.

Exam trap

A common misconception is that separate single-column indexes are equivalent to a composite index, but in PostgreSQL, separate indexes require bitmap scans or residual filtering, which are slower than a single composite index that matches the query's equality and range predicates.

How to eliminate wrong answers

Option A is wrong because a full-text index is designed for text search (e.g., tsvector/tsquery) and does not support equality or range comparisons on a plain 'email' column; it would be ignored by the query planner for these operations. Option C is wrong because a B-tree index on email only can filter by email efficiently, but then PostgreSQL must perform a separate filter on created_at for each matching row, which can be expensive for large result sets. Option D is wrong because separate B-tree indexes on email and created_at would force the planner to choose one index (likely email) and then apply a residual filter on created_at, or attempt a bitmap scan combining both indexes, which is less efficient than a single composite index that directly supports the query pattern.

1237
MCQmedium

An organization uses Config Sync to manage Kubernetes resources across multiple GKE clusters. They want to automatically remediate configuration drift. What must they ensure?

A.Set the Config Sync policy to 'allow-drift'
B.Enable 'sync' and set 'sync-repo' to the desired repository
C.Configure 'source-format' as 'structured'
D.Use a GitOps tool like Config Sync with 'sync-mode' set to 'force'
AnswerD

Config Sync's force mode automatically reverts any manual changes to match the repo.

Why this answer

Config Sync's 'sync-mode' set to 'force' ensures that any manual changes to the cluster (configuration drift) are automatically reverted to match the desired state defined in the Git repository. This mode overwrites any modifications made outside of Config Sync, enforcing strict reconciliation. Without 'force', Config Sync may detect drift but not automatically correct it, leaving the cluster in a non-compliant state.

Exam trap

Google Cloud Platform (GCP) often tests the misconception that simply enabling Config Sync with a repository (Option B) is sufficient for drift remediation, but candidates must recognize that the 'sync-mode' parameter must be explicitly set to 'force' to enforce automatic correction of unauthorized changes.

How to eliminate wrong answers

Option A is wrong because 'allow-drift' is not a valid Config Sync policy; Config Sync does not have such a setting, and allowing drift would defeat the purpose of automatic remediation. Option B is wrong because enabling 'sync' and setting 'sync-repo' only establishes the initial synchronization source but does not specify how drift should be handled; it lacks the enforcement mechanism needed for automatic remediation. Option C is wrong because 'source-format' as 'structured' refers to the format of the configuration files (e.g., using Namespace configs) and has no impact on drift remediation behavior.

1238
MCQeasy

Refer to the exhibit. The BI team creates a view to summarize sales. When they query the view with an additional WHERE clause on region, they notice that the underlying query still processes the same amount of data regardless of the filter. What is the most likely reason?

A.The view is a materialized view that refreshes every 30 minutes.
B.The view's WHERE clause on date is too restrictive, causing a full scan.
C.The view uses authorized views, which prevent predicate pushdown.
D.The view is a logical view, not a materialized view, so filters on the view do not reduce the scanned data.
AnswerD

Logical views execute the defining query each time; filters are applied after the view query.

Why this answer

A logical view (also known as a standard or non-materialized view) in BigQuery does not store data; it merely stores the SQL query definition. When you query a logical view with an additional WHERE clause, BigQuery does not automatically push that filter down into the view's underlying query unless the view is defined with a specific optimization like a parameterized view or uses a scripting approach. By default, the view's query is executed first, and then the outer filter is applied to the result set, meaning the same amount of underlying data is scanned regardless of the outer filter.

Exam trap

The trap here is that candidates confuse logical views with materialized views, assuming that any view automatically reduces scanned data when filtered, but in Google Cloud BigQuery, only materialized views or tables with partitioning/clustering support efficient predicate pushdown.

How to eliminate wrong answers

Option A is wrong because a materialized view stores precomputed results and refreshes periodically; querying a materialized view with an additional WHERE clause can reduce scanned data if the filter matches the partitioning or clustering of the materialized view, so this would not cause the same amount of data to be processed. Option B is wrong because a restrictive WHERE clause on date would typically reduce the data scanned, not cause a full scan; a full scan is more likely due to missing partitioning or clustering, not because the filter is too restrictive. Option C is wrong because authorized views in BigQuery are used for sharing data with specific users without granting direct table access; they do not inherently prevent predicate pushdown—predicate pushdown is a query engine optimization that is independent of view authorization.

1239
MCQmedium

A team is migrating a large on-premise Oracle database to Cloud SQL for PostgreSQL. They need to minimize downtime and ensure data consistency. Which migration approach is recommended?

A.Use pg_dump and pg_restore
B.Use Database Migration Service with continuous replication
C.Export data as CSV, import to Cloud SQL
D.Create a Cloud SQL read replica from on-premise
AnswerB

Database Migration Service (DMS) supports heterogeneous migrations such as Oracle to Cloud SQL for PostgreSQL. With continuous replication, it provides near-zero downtime and ensures data consistency.

Why this answer

Using Database Migration Service (DMS) with continuous replication provides near-zero downtime and maintains consistency.

1240
Multi-Selectmedium

A company uses BigQuery for BI analytics. They want to improve query performance for a table with 10 TB of data. Which two actions should they take? (Choose two.)

Select 2 answers
A.Limit the number of columns queried using SELECT * with EXCEPT.
B.Use a wildcard table to combine multiple tables.
C.Partition by a column with a high granularity.
D.Cluster on columns used in filters and aggregations.
E.Use a clustered column as the partition key.
AnswersA, D

Reducing columns scanned decreases processed bytes and cost.

Why this answer

Using SELECT * with EXCEPT limits the number of columns scanned, reducing I/O and improving query performance in BigQuery. BigQuery charges by the amount of data processed, so reading fewer columns directly lowers both cost and query execution time.

Exam trap

Google Cloud often tests the distinction between partitioning and clustering, where candidates mistakenly think that high-granularity partitioning or using a clustered column as a partition key improves performance, when in fact it introduces overhead and defeats the purpose of each feature.

1241
MCQhard

A developer reports that an application cannot connect to a Cloud SQL SQL Server instance. The error log shows the message in the exhibit. The instance exists and the user credentials are correct. What is the most likely cause?

A.The Cloud SQL instance has reached its maximum number of connections.
B.The database name specified in the connection string is incorrect.
C.The Cloud SQL proxy is not running.
D.The Cloud SQL instance is not in the same VPC network as the application.
AnswerB

This error commonly occurs when the database name is misspelled or does not exist.

Why this answer

The error message in the exhibit indicates that the login failed for the user, which is a common symptom when the database name in the connection string does not match an existing database on the Cloud SQL SQL Server instance. Even though the user credentials are correct, SQL Server requires a valid database context to establish the connection; an incorrect database name causes the server to reject the login attempt. This is a configuration issue, not an authentication or network problem.

Exam trap

Google Cloud often tests the distinction between authentication errors and database context errors, leading candidates to incorrectly blame network or proxy issues when the actual problem is a simple misconfiguration in the connection string's database name.

How to eliminate wrong answers

Option A is wrong because reaching the maximum number of connections would produce a different error, such as 'Cannot open server connection' or 'Connection limit exceeded', not a login failure for a specific database. Option C is wrong because if the Cloud SQL proxy were not running, the application would not be able to reach the Cloud SQL instance at all, resulting in a network timeout or connection refused error, not a SQL Server login error. Option D is wrong because if the instance were not in the same VPC network, the application would experience a network connectivity failure (e.g., timeout or unreachable host), not a SQL Server authentication error that includes a database name reference.

1242
Multi-Selectmedium

A company is migrating an Oracle database to Cloud SQL for PostgreSQL. They need to convert data types. Which TWO data type mappings are correct?

Select 3 answers
A.NUMBER(10,2) → NUMERIC(10,2)
B.CLOB → VARCHAR
C.BLOB → BYTEA
D.DATE → DATE
E.NUMBER(10) → INTEGER
AnswersA, C, E

This mapping is correct. Oracle NUMBER(10,2) maps directly to NUMERIC(10,2) in Cloud SQL for PostgreSQL, preserving the exact numeric type.

Why this answer

Oracle NUMBER(10,2) maps to NUMERIC(10,2) in Cloud SQL for PostgreSQL because both store exact numeric values with precision and scale. Oracle NUMBER(10) maps to INTEGER because it stores whole numbers without scale. The other options are incorrect: CLOB maps to TEXT, BLOB maps to BYTEA, and Oracle DATE maps to TIMESTAMP (since Oracle DATE includes time).

1243
MCQhard

Your company runs a large e-commerce application on Google Cloud using Cloud SQL for MySQL (version 8.0) with 2 TB of data. The database experiences intermittent performance degradation during peak hours (10am-2pm). Cloud Monitoring shows a spike in CPU utilization to 90% and increased query latency. The database has been running for 6 months with default settings. You notice many slow queries like "SELECT * FROM orders WHERE customer_id=12345 ORDER BY order_date DESC LIMIT 10" that take 5-10 seconds. The orders table has 50 million rows, customer_id has a B-tree index, and order_date is not indexed. The query execution plan indicates a full table scan and a filesort. What is the most effective course of action to resolve the performance issue?

A.Add a composite index on (customer_id, order_date)
B.Create multiple read replicas to offload read traffic
C.Partition the orders table by month using range partitioning
D.Increase the memory size of the Cloud SQL instance to 30 GB
AnswerA

A composite index on both columns enables the query to use index for filtering and sorting, eliminating the full table scan and filesort.

Why this answer

The slow query uses a WHERE clause on customer_id (which is indexed) and an ORDER BY on order_date (not indexed). The index on customer_id alone is insufficient because the query still requires sorting, leading to a filesort. Adding a composite index on (customer_id, order_date) allows the database to retrieve rows for a specific customer in sorted order without a full scan or filesort.

Option B (increasing memory) may help but does not address the root cause. Option C (read replicas) offloads read traffic but does not fix the query plan. Option D (partitioning) might help with data management but is not as direct or efficient as adding the appropriate index.

1244
Multi-Selecthard

A company runs a global application on Cloud Spanner with a multi-region configuration. They need to test their DR procedures without impacting production. Which THREE actions should they perform? (Choose 3)

Select 3 answers
A.Delete the production instance and recreate it from a backup.
B.Simulate a zone failure by modifying IAM permissions to restrict access to replicas in a zone.
C.Create a backup of the production database and restore it to a separate instance for validation.
D.Promote a read replica to a writable instance in a different region.
E.Perform a failover test by initiating a planned regional outage using Spanner's API.
AnswersB, C, E

This allows testing failover behavior without actual outage.

Why this answer

Non-destructive tests include creating a backup and restoring it to a separate instance for validation, simulating a zone failure by restricting replica access, and performing regular failover drills via backup/restore to test RTO.

1245
MCQhard

A company has multiple GCP projects and wants to audit all IAM policy changes. They need a solution that captures who made the change, what was changed, and when. The solution should be cost-effective and require minimal setup. What should they use?

A.Enable Access Transparency logs.
B.Use Cloud Asset Inventory to export IAM policies daily.
C.Set up Stackdriver (now Cloud Monitoring) alerts on IAM changes.
D.Enable Cloud Audit Logs for Admin Activity for all projects.
AnswerD

Admin Activity logs are enabled by default and capture IAM changes.

Why this answer

Cloud Audit Logs for Admin Activity automatically captures all API calls that modify IAM policies, including the identity of the caller, the change made, and the timestamp. This is enabled by default for all GCP projects at no additional cost, making it the most cost-effective and minimal-setup solution for auditing IAM changes.

Exam trap

The trap here is that candidates confuse Access Transparency (for Google support actions) with Cloud Audit Logs (for user actions), or think that monitoring alerts provide an audit trail when they only provide real-time notifications.

How to eliminate wrong answers

Option A is wrong because Access Transparency logs are designed to show actions taken by Google support personnel on your data, not internal IAM policy changes made by your own users. Option B is wrong because Cloud Asset Inventory exports are snapshots of current IAM policies, not a real-time audit trail of who made changes and when; they also require additional setup and incur costs for export operations. Option C is wrong because Stackdriver (Cloud Monitoring) alerts can notify you of IAM changes but do not provide a historical audit log of who made the change and what exactly was changed; they are for alerting, not auditing.

1246
MCQhard

An online advertising platform uses Cloud Spanner for ad impression tracking. The table 'ad_impressions' has a primary key (ad_id, timestamp). The table receives millions of writes per minute. A secondary index on (campaign_id, timestamp) was created to support queries that sum impressions per campaign. During high traffic, the team notices increased write latency and hotspotting on the index (the campaign_id has low cardinality, causing all writes to a campaign to hit the same index split). They need to redesign the schema to avoid hotspotting on the index while still supporting the campaign aggregation queries. What is the best solution?

A.Modify the secondary index to include a hash prefix (e.g., use 'hash(campaign_id)' as the first column of the index).
B.Migrate the ad_impressions table to Cloud Bigtable with row key 'campaign_id#timestamp'.
C.Change the primary key of the base table to include campaign_id as the first column.
D.Create a separate table that stores per-campaign aggregations, updated in real time.
AnswerA

A hash prefix distributes index writes evenly across splits, preventing hotspotting.

Why this answer

Adding a hash prefix to the index key (e.g., using a hash of campaign_id as the leading column) distributes index writes across multiple splits, eliminating the hotspotting on the secondary index. Option B (migrating to Bigtable) introduces operational complexity and does not leverage Spanner's existing capabilities. Option C (changing the base table's primary key to start with campaign_id) would not fix the index hotspot because the secondary index on (campaign_id, timestamp) would still concentrate writes on a single split due to low cardinality of campaign_id.

Option D (creating a separate aggregation table) adds complexity and would require additional mechanisms to keep it updated, which can be error-prone and may not solve the underlying index hotspot.

1247
MCQmedium

Refer to the exhibit. You are reviewing the following Cloud Spanner DDL statement for a table storing customer orders. What potential performance issue will arise with this schema?

A.The primary key includes two columns which reduces insert performance
B.The TotalAmount column should be INTEGER for performance
C.The table lacks a foreign key constraint
D.The OrderId is likely to be sequentially generated, causing write hotspots
AnswerD

Sequential keys lead to hotspotting; consider using a hash prefix or UUID.

Why this answer

Cloud Spanner uses a distributed architecture that splits data across splits based on the primary key range. If OrderId is sequentially generated (e.g., auto-increment), all new inserts will target the same split, creating a write hotspot that degrades throughput and latency. This is a well-known anti-pattern in Spanner; the recommended approach is to use a UUID or a monotonically increasing key with a hash prefix to distribute writes evenly.

Exam trap

A common misconception tested in this exam is that composite primary keys or missing foreign keys are the main performance culprits, when in fact the critical issue is write hotspotting caused by monotonically increasing primary keys in a distributed database like Cloud Spanner.

How to eliminate wrong answers

Option A is wrong because having two columns in the primary key does not inherently reduce insert performance; Spanner can efficiently handle composite primary keys as long as they are not monotonically increasing. Option B is wrong because using INTEGER vs FLOAT64 for TotalAmount is a data type choice, not a performance issue; Spanner handles both efficiently, and the real concern is write distribution, not column type. Option C is wrong because foreign key constraints are optional in Spanner and their absence does not cause performance issues; they are used for data integrity, not write throughput.

1248
MCQeasy

You want to ensure that a critical deployment on GKE has minimal downtime during rolling updates. You also want to ensure that at least 2 pods are always available. Which Kubernetes resource should you configure?

A.Cluster autoscaler with minNodes: 2
B.HorizontalPodAutoscaler with minReplicas: 2
C.VerticalPodAutoscaler with updateMode: Auto
D.PodDisruptionBudget with minAvailable: 2
AnswerD

PDB ensures at least 2 pods remain available during voluntary disruptions.

Why this answer

PodDisruptionBudget (PDB) specifies the minimum number or percentage of pods that must be available during voluntary disruptions like rolling updates. Setting minAvailable: 2 ensures at least 2 pods are running during updates. HPA, VPA, and cluster autoscaler do not control pod availability during updates.

1249
MCQmedium

A team is migrating a 2 TB MySQL database from on-premises to Cloud SQL. They want to minimize downtime. The source is MySQL 8.0 with InnoDB tables, and the application can be read-only during cutover. Which approach provides the lowest downtime while ensuring data consistency?

A.Use mysqldump with --single-transaction to export, then import to Cloud SQL using mysql client.
B.Use Cloud Dataflow to stream data from MySQL to Cloud SQL.
C.Use gcloud sql import command with a compressed dump file from Cloud Storage.
D.Use Database Migration Service with continuous CDC and promote when lag is zero.
AnswerD

DMS CDC minimizes downtime by replicating changes in real time.

Why this answer

DMS with continuous CDC provides near-zero downtime by replicating ongoing changes. After the initial dump, the source continues to replicate changes, allowing a quick cutover with minimal downtime.

1250
Multi-Selectmedium

A company uses Cloud Bigtable with replication across two regions. They want to implement a DR plan that minimizes RPO and RTO. Which TWO steps should they take? (Choose 2)

Select 2 answers
A.Configure multi-cluster routing with read-failover.
B.Regularly perform failover drills using Cloud DNS health checks to update routing.
C.Enable automatic failover for writes in the Bigtable cluster configuration.
D.Set the replication routing policy to any-replica.
E.Set the replication routing policy to single-cluster with failover priority.
AnswersA, B

This ensures reads fail over automatically while writes remain in primary, minimizing RPO.

Why this answer

Using multi-cluster routing with read-failover ensures reads automatically switch to the secondary cluster when primary is unhealthy, minimizing RPO by directing writes to primary. Regularly testing failover validates the process and updates runbooks.

1251
MCQmedium

A retail company uses BigQuery to store sales transactions. The BI team needs to create a monthly customer lifetime value (CLV) report that aggregates purchase history across multiple tables. Which BigQuery feature should they use to define the data structure for this report?

A.Create a materialized view with the aggregation query
B.Create a view that joins and aggregates the tables
C.Create an external table pointing to the raw data files
D.Create a new table to store the aggregated data using INSERT SELECT
AnswerB

A view provides a logical virtual table that hides complexity and ensures the BI team always sees the latest data.

Why this answer

A view in BigQuery allows the BI team to define a logical data structure that joins and aggregates multiple tables without storing the results. This ensures the monthly CLV report always reflects the latest data, as views are re-evaluated at query time, which is ideal for recurring reports that need up-to-date aggregations.

Exam trap

Google Cloud often tests the distinction between views and materialized views, trapping candidates who assume materialized views are always better for performance without considering the need for real-time data freshness in recurring reports.

How to eliminate wrong answers

Option A is wrong because a materialized view stores pre-computed results, which can become stale and require manual or automatic refreshes, making it unsuitable for a report that must reflect the most recent purchase history without latency. Option C is wrong because an external table points to raw data files (e.g., in Cloud Storage) and does not support SQL joins or aggregations natively; it is designed for querying external data without loading it into BigQuery, not for defining a structured report. Option D is wrong because creating a new table with INSERT SELECT stores a static snapshot of the data, which would require manual re-execution to update the CLV report, defeating the purpose of a dynamic, recurring report.

1252
MCQmedium

A data analyst runs a query joining several large tables and gets 'Resources exceeded' error. They need to reduce memory usage without changing the query logic. What should they do?

A.Use a subquery to pre-aggregate the largest table before joining
B.Use APPROX_COUNT_DISTINCT for counting distinct values
C.Increase the slot reservation
D.Use SELECT * in the subquery to ensure all columns are available
AnswerA

Pre-aggregation reduces the row count and columns, decreasing shuffle and memory.

Why this answer

Pre-aggregating the largest table in a subquery reduces the amount of data that needs to be shuffled and joined in memory. In BigQuery, this minimizes the bytes processed and the memory footprint of the join operation, directly addressing the 'Resources exceeded' error without altering the overall query logic.

Exam trap

The trap here is that candidates often confuse increasing resources (slots) with reducing memory usage, or they think that approximate functions like APPROX_COUNT_DISTINCT can fix join memory errors, when in fact they only affect aggregation accuracy.

How to eliminate wrong answers

Option B is wrong because APPROX_COUNT_DISTINCT reduces the accuracy of distinct counts but does not reduce the memory usage of a join operation; it only optimizes a specific aggregation function. Option C is wrong because increasing the slot reservation increases the available compute resources (slots) but does not reduce the memory usage per query; it may delay the error but does not fix the underlying memory bottleneck. Option D is wrong because using SELECT * in a subquery retrieves all columns, which increases the data volume and memory consumption, making the 'Resources exceeded' error worse.

1253
Multi-Selectmedium

Which TWO metrics are appropriate for defining a request-based SLI for a web service? (Choose 2)

Select 2 answers
A.Latency: proportion of requests under a threshold
B.Throughput: requests per second
C.Error count: number of 5xx responses
D.Availability: successful requests / total requests
E.Uptime: minutes service is up
AnswersA, D

Standard latency SLI.

Why this answer

Request-based SLIs include availability (successful/total) and latency (proportion under threshold). Throughput and error count are not SLIs themselves but can be used in SLO definitions. Uptime is a window-based metric.

1254
MCQhard

A company has a Spanner instance with 5 nodes serving a global application. They receive alerts that write latency has increased significantly during business hours in the Asia-Pacific region. The team confirms that no application changes have been made. What is the most likely cause and recommended action?

A.Writes are hitting a hot spot due to monotonically increasing keys; consider using a hash prefix or bit-reversed key
B.CPU utilization is above 70%; enable Spanner fine-grained access control
C.Set up interleaved indexes to speed up writes
D.The instance is under-provisioned; increase the number of nodes
AnswerA

Using a hash prefix or bit-reversed key distributes writes across splits, reducing hot spots.

Why this answer

Monotonically increasing keys (e.g., timestamps or auto-increment IDs) cause all new writes to target the same tablet leader in Spanner, creating a hot spot. This increases write latency because the single node becomes a bottleneck, especially during peak business hours in the Asia-Pacific region. Using a hash prefix or bit-reversed key distributes writes evenly across nodes, resolving the contention.

Exam trap

Google Cloud often tests the misconception that adding nodes (scaling out) always fixes write latency, but the real issue is often a hot spot from poor key design, which requires schema-level changes rather than infrastructure scaling.

How to eliminate wrong answers

Option B is wrong because CPU utilization above 70% is a symptom, not a root cause, and enabling fine-grained access control does not reduce write latency. Option C is wrong because interleaved indexes optimize read performance by colocating parent and child rows, but they do not speed up writes; in fact, they can add overhead to write operations. Option D is wrong because the instance has 5 nodes and no application changes were made, so under-provisioning is unlikely; the issue is a hot spot from key design, not insufficient capacity.

1255
Multi-Selectmedium

An application is emitting custom metrics using OpenTelemetry. You want to collect and export these metrics to Cloud Monitoring. Which TWO components are required? (Select 2)

Select 2 answers
A.Cloud Logging Agent
B.Cloud Monitoring Agent
C.Pub/Sub topic
D.OpenTelemetry SDK in the application
E.OpenTelemetry Collector
AnswersD, E

The SDK instruments the application to emit metrics.

Why this answer

The OpenTelemetry Collector can receive metrics from the application and export them to Cloud Monitoring using the Google Cloud Monitoring exporter.

1256
Multi-Selecteasy

A retail company is designing a new inventory management system on Cloud Spanner. They need to ensure high write throughput for order processing. Which two schema design practices help avoid write hotspots? (Choose TWO.)

Select 2 answers
A.Create secondary indexes on frequently queried columns.
B.Avoid using a monotonically increasing primary key.
C.Store all data in a single table with no interleaving.
D.Use foreign keys to enforce referential integrity.
E.Add a hash prefix to the primary key to distribute writes.
AnswersB, E

Monotonically increasing keys cause hotspotting.

Why this answer

Monotonically increasing primary keys (e.g., auto-increment integers or timestamps) cause all new writes to be directed to the same tablet server, creating a hot spot. Cloud Spanner splits data by key range, so sequential keys concentrate load on a single split. Option E is correct because adding a hash prefix to the primary key distributes writes uniformly across splits, preventing any single node from becoming a bottleneck.

Exam trap

Candidates often mistakenly think that secondary indexes or foreign keys improve write throughput in Cloud Spanner, but these features only assist reads or data integrity, not write distribution. The key is to avoid monotonically increasing primary keys and use hash prefixes to distribute writes.

1257
MCQmedium

A GKE cluster runs a stateful workload that requires persistent volumes. The nodes are managed by a node pool with autoscaling enabled. During scale-down, the cluster autoscaler sometimes removes nodes that host critical pods with local data. How can the team prevent this?

A.Set a PodDisruptionBudget with maxUnavailable=0 for the critical workloads
B.Use node taints and tolerations to pin pods to specific nodes
C.Set the cluster autoscaler flag --scale-down-delay to a high value
D.Configure Vertical Pod Autoscaler to increase pod resources
AnswerA

A PDB ensures that the cluster autoscaler does not remove nodes that would cause too many pods to be unavailable.

Why this answer

PodDisruptionBudgets (PDB) allow specifying the minimum number of available pods during voluntary disruptions like cluster autoscaler scale-down. By setting a PDB with maxUnavailable=0, the autoscaler will not drain nodes that would violate the budget. Node taints and tolerations control scheduling but not disruption.

Cluster autoscaler flags like scale-down-delay only delay scale-down, not prevent it for specific pods. VPA does not affect node selection.

1258
MCQeasy

A company wants to use Cloud Monitoring dashboards to display real-time metrics for their application, but they also need to version control the dashboard configurations. Which approach should they use?

A.Define dashboards as code using the Cloud Monitoring API and store the configuration in a Git repository.
B.Manually create dashboards in the Cloud Monitoring console and export them periodically.
C.Use Grafana with the Cloud Monitoring data source and export dashboard JSON.
D.Use Cloud Monitoring's built-in 'Clone' feature to backup dashboards.
AnswerA

This allows declarative management, review, and version control of dashboard configurations.

Why this answer

Cloud Monitoring dashboards can be defined as JSON or YAML and managed via the Monitoring API or Terraform. This allows version control and CI/CD. Manually creating dashboards in the console is not reproducible.

1259
MCQeasy

A Cloud SQL for MySQL instance is running low on disk space. You have enabled automatic storage increase, but you also want to be proactively alerted when disk usage exceeds 80%. Which steps should you take?

A.Set the storage size to a fixed large value to avoid alerts.
B.Create a Cloud Logging sink for disk usage logs and set up a Pub/Sub notification.
C.Create a Cloud Monitoring alert on the metric 'disk/utilization' with a threshold of 80%.
D.Use Cloud SQL's built-in email notifications for disk usage.
AnswerC

This is the correct way to get an alert when disk usage exceeds 80%.

Why this answer

Cloud Monitoring allows you to create alerting policies based on metrics. The disk usage metric for Cloud SQL is available, and you can set a threshold of 80%. Automatic storage increase is a separate setting that automatically increases storage when needed.

1260
MCQmedium

A Pub/Sub subscription is processing messages but the subscriber cannot keep up. The team notices that many messages are being resent. Which parameter should they adjust to reduce duplicate processing?

A.Decrease the acknowledgement deadline
B.Increase the retention duration
C.Enable ordering keys
D.Increase the acknowledgement deadline
AnswerD

A longer deadline allows subscribers more time to process, reducing redelivery.

Why this answer

Increasing the acknowledgement deadline gives the subscriber more time to process and ack messages, reducing the chance that they expire and are redelivered.

1261
Multi-Selectmedium

A company wants to implement a CI/CD pipeline for a multi-service application where each service is built from a separate repository. They need to run unit tests, build container images, and deploy to both Cloud Run and GKE. Which two Google Cloud services should be combined to achieve this?

Select 2 answers
A.Config Sync
B.Artifact Registry
C.Cloud Build
D.Cloud Source Repositories
E.Cloud Deploy
AnswersC, E

Cloud Build can be configured with triggers from multiple repos to build and test.

Why this answer

Cloud Build is correct because it is a fully managed CI/CD platform that can pull source code from multiple repositories (including Cloud Source Repositories, GitHub, or Bitbucket), run unit tests, build container images, and push them to Artifact Registry. Cloud Deploy is correct because it provides managed continuous delivery to both Cloud Run and GKE, supporting progressive delivery strategies like canary and blue-green deployments, and integrates directly with Cloud Build as a delivery pipeline target.

Exam trap

A common trap is selecting Artifact Registry (B) or Cloud Source Repositories (D) because they are related to storing artifacts or source code. However, the question asks for services that form the CI/CD pipeline itself. Artifact Registry is a repository for container images, not a pipeline service, and Cloud Source Repositories is a source code hosting service.

The correct combination is Cloud Build for continuous integration (testing and building) and Cloud Deploy for continuous delivery (deploying to Cloud Run and GKE).

1262
Multi-Selecthard

A company is migrating a large relational database to Bigtable. The database has a table with columns: user_id (string), event_type (string), timestamp (timestamp), and details (JSON). The access patterns include retrieving all events for a user in a time range, and filtering by event_type. Which THREE row key design strategies should they apply? (Choose 3)

Select 3 answers
A.Include event_type as a column qualifier instead of row key
B.Store all events for a user in a single row
C.Use a hash prefix of user_id to distribute writes
D.Use a monotonically increasing timestamp as the row key
E.Use reverse timestamp to enable recent data first scans
AnswersA, C, E

Column qualifiers can be used to filter, and including event_type in row key may cause wide rows.

Why this answer

A row key like hash(user_id) + user_id + reverse_timestamp + event_type distributes writes (hash), allows user-level scans (user_id), orders by time (reverse_timestamp), and enables filtering on event_type by using it as a column qualifier or part of key.

1263
Drag & Dropmedium

Arrange the steps to configure high availability for a Cloud SQL for MySQL instance.

Drag steps to the numbered slots on the right, or tap a step then tap a slot.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

Create instance first, then enable HA and set standby zone, then verify and test.

1264
MCQhard

A team uses Cloud Deploy with a delivery pipeline that deploys to GKE clusters across dev, staging, and prod targets. They want to automatically roll back a release if the canary deployment in staging fails to meet a defined service-level objective (SLO) for error rate. Which Cloud Deploy feature enables this?

A.Use preDeploy and postDeploy hooks to run Cloud Run jobs that check error rate and roll back.
B.Configure canary deployment with the '--canary-percentage' flag and enable SLO verification in the delivery pipeline.
C.Use Binary Authorization with a custom attestor that checks error rate.
D.Set an approval gate on the staging target that requires manual review.
AnswerB

Cloud Deploy supports metrics-based canary verification and automatic rollback when SLOs are not met.

Why this answer

Cloud Deploy's canary deployment strategy supports SLO verification via the `--canary-percentage` flag combined with a `canaryDeployment` configuration that includes a `verify` phase. This allows the pipeline to automatically roll back the release if the canary fails to meet the defined error rate SLO, without manual intervention or external services.

Exam trap

Google Cloud often tests the distinction between Cloud Deploy's built-in canary SLO verification and external mechanisms like hooks or Binary Authorization, leading candidates to overcomplicate the solution when a native feature exists.

How to eliminate wrong answers

Option A is wrong because preDeploy and postDeploy hooks are designed for custom actions like running Cloud Run jobs, but they do not natively integrate with canary SLO verification or automatic rollback; they require custom scripting and lack the built-in SLO monitoring and rollback logic of Cloud Deploy's canary strategy. Option C is wrong because Binary Authorization with a custom attestor is used for verifying container image provenance and enforcing deployment policies based on attestations, not for monitoring real-time error rates during a canary deployment or triggering automatic rollbacks. Option D is wrong because an approval gate on the staging target requires manual review, which contradicts the requirement for an automatic rollback based on SLO failure; it introduces human delay and does not provide automated SLO verification.

1265
MCQhard

A BI manager needs to restrict access to sensitive sales data so that salespeople can only see their own region's data. Which BigQuery feature should be used to implement row-level security without duplicating tables?

A.Use column-level security to hide sensitive columns
B.Use BigQuery row-level access policies
C.Create an authorized view that uses SESSION_USER() in a WHERE clause to filter rows
D.Create separate IAM roles for each region
AnswerB

BigQuery row-level access policies are the native feature for restricting row access based on user attributes, such as region, without duplicating tables. This is the correct answer.

Why this answer

BigQuery row-level access policies are a native feature that allows restricting access to specific rows in a table without duplicating data. They provide a direct, scalable, and efficient way to implement row-level security based on user attributes like region. While authorized views with SESSION_USER() can also achieve similar functionality, they are not the native feature and require additional management overhead.

Therefore, Option B is the correct answer.

Exam trap

The trap is that candidates may think BigQuery lacks native row-level security and rely on authorized views as the only option. However, BigQuery does offer row-level access policies as a built-in feature, making them the most direct and appropriate solution.

How to eliminate wrong answers

Option A is wrong because column-level security hides entire columns (e.g., salary), not rows, so it cannot restrict which rows a salesperson sees based on region. Option B is wrong because BigQuery does not have a native 'row-level access policies' feature; the correct term is row-level security implemented via authorized views or row-level access policies (which are not a distinct BigQuery feature). Option D is wrong because IAM roles control access at the dataset or table level, not at the row level, and creating separate roles per region would require duplicating tables or complex, unscalable management.

1266
MCQeasy

Which Cloud Monitoring metric indicates the number of queries waiting for locks in Cloud SQL?

A.Lock waits
B.Active connections
C.CPU utilization
D.Queries
AnswerA

This metric measures the number of queries waiting for locks.

Why this answer

The 'Lock waits' metric in Cloud SQL (for MySQL, PostgreSQL, or SQL Server) directly tracks the number of queries that are blocked because they are waiting for a lock held by another transaction. This is the correct indicator of query contention, as it measures the count of statements currently in a lock-wait state, not the total queries or connections.

Exam trap

The trap here is that candidates confuse 'Queries' (total throughput) with 'Lock waits' (blocked queries), assuming that a high query count implies lock contention, when in fact lock waits are a specific subset of queries that are actively waiting for locks.

How to eliminate wrong answers

Option B is wrong because 'Active connections' shows the total number of open connections to the database, not queries waiting for locks; a high active connection count does not necessarily indicate lock contention. Option C is wrong because 'CPU utilization' measures processor usage, which may be high due to many reasons (e.g., heavy queries, indexing issues) but does not specifically indicate queries waiting for locks. Option D is wrong because 'Queries' typically refers to the total number of queries executed per second, not the subset of queries that are blocked waiting for locks.

1267
MCQeasy

A startup is building a mobile application and needs a real-time database that automatically scales to handle sudden spikes in user traffic. They want to minimise operational overhead and only pay for the resources they use. Which Google Cloud database should they choose?

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

Firestore is serverless, auto-scaling, and pay-per-use, ideal for mobile apps.

Why this answer

Firestore is a fully managed, serverless NoSQL document database that automatically scales horizontally to handle sudden traffic spikes without manual intervention. It offers real-time data synchronization via listeners, and its pay-per-use billing model aligns with the startup's requirement to minimize operational overhead and only pay for consumed resources.

Exam trap

A common misconception is that Cloud Spanner is always the best scalable database, but candidates overlook that Spanner requires provisioned capacity and is not serverless, while Firestore's auto-scaling and pay-per-use model directly address the startup's requirements for minimizing operational overhead and handling sudden spikes.

How to eliminate wrong answers

Option B is wrong because Cloud Spanner is a globally distributed, strongly consistent relational database designed for high-throughput OLTP workloads, but it requires upfront capacity planning and incurs costs for provisioned nodes, not a pay-per-use model, making it unsuitable for a startup wanting to minimize overhead and pay only for usage. Option C is wrong because Cloud SQL is a managed relational database (MySQL, PostgreSQL, SQL Server) that does not auto-scale for sudden spikes; it requires manual or scheduled scaling of read replicas and has a fixed instance size billing model, not a consumption-based model. Option D is wrong because Cloud Bigtable is a wide-column NoSQL database optimized for large-scale analytical and operational workloads (e.g., time-series, IoT) with high throughput, but it requires manual cluster sizing and pays for provisioned nodes per hour, not a serverless pay-per-use model, and lacks real-time data synchronization features.

1268
MCQeasy

A developer runs the command shown in the exhibit and wants to verify that replication is enabled on the Bigtable instance. Where should they look for this information in the output?

A.Examine the 'instanceType' field for 'MULTI_CLUSTER'.
B.Look for a 'replication' field in the JSON.
C.View the 'clusters' list within the instance description.
D.Check the 'state' field for 'REPLICATED'.
AnswerC

Clusters indicate replication if multiple clusters exist.

Why this answer

The `gcloud bigtable instances describe` command returns a JSON representation of the instance, which includes a `clusters` list. Each cluster object in that list contains a `replication` field (e.g., `defaultStorageType` and `nodes`), and the presence of multiple clusters in the list indicates that replication is configured. Replication in Cloud Bigtable is enabled by adding more than one cluster to the instance, so examining the `clusters` list directly shows whether replication is active.

Exam trap

The trap here is that candidates confuse the `instanceType` field (which is `PRODUCTION` or `DEVELOPMENT`) with replication status, or expect a dedicated `replication` boolean field, when in fact replication is indicated by the presence of multiple clusters in the `clusters` list.

How to eliminate wrong answers

Option A is wrong because `instanceType` in Cloud Bigtable is either `PRODUCTION` or `DEVELOPMENT`, not `MULTI_CLUSTER`; the term 'MULTI_CLUSTER' is used for routing options, not instance type. Option B is wrong because there is no top-level `replication` field in the JSON output of `gcloud bigtable instances describe`; replication status is derived from the number of clusters in the `clusters` list. Option D is wrong because the `state` field in the instance description indicates the lifecycle state (e.g., `READY`, `CREATING`), not replication status; there is no `REPLICATED` state value.

1269
Multi-Selectmedium

A DevOps team is designing a landing zone on GCP. They want to centralize networking, logging, and security. Which TWO projects should they create? (Choose 2)

Select 2 answers
A.A project for IAM roles
B.A central Logging project
C.A Shared VPC project for networking
D.A project for each environment
E.A separate project per application
AnswersB, C

Centralized logging and billing export.

Why this answer

In a GCP landing zone, centralizing logging into a dedicated project ensures that audit logs, VPC flow logs, and other operational logs are aggregated in a single, secure location. This project is used to configure log sinks, export logs to BigQuery or Cloud Storage, and enforce retention policies across the organization, which is a best practice for compliance and troubleshooting.

Exam trap

The trap here is that candidates often confuse the landing zone's centralized infrastructure projects (Shared VPC and Logging) with environment-specific or application-specific projects, which are separate concerns in the GCP resource hierarchy.

1270
Multi-Selecthard

A company is experiencing slow query performance on Cloud Spanner. They have identified a query that joins a parent table with a child table frequently. Which THREE design choices can improve the performance of this join? (Choose three.)

Select 3 answers
A.Split the child table into multiple smaller tables.
B.Create a secondary index on the parent table's primary key.
C.Use interleaved tables to store child rows within the parent row.
D.Use `spanner_interleave_in_parent` option when creating the secondary index on the child table.
E.Add a secondary index on the foreign key of the child table.
AnswersC, D, E

Interleaved tables co-locate parent and child data, improving join performance.

Why this answer

Interleaved tables physically store child rows with the parent, reducing cross-node communication. Secondary indexes help with non-key lookups. Using `spanner_interleave_in_parent` on indexes stores index entries with the parent.

Splitting tables into smaller tables does not help joins. Bit-reversed keys prevent hotspots but not join performance.

1271
MCQmedium

A financial services company runs a Cloud SQL for PostgreSQL instance for transactional data. They need to conduct regular security audits and compliance checks. The database engineer must ensure that all connections to the database are encrypted and that access is restricted to authorized VMs only. The database is currently accessible from the internet via an authorized network with a public IP. What should the database engineer do to meet these requirements?

A.Create a Cloud SQL proxy instance in the same VPC and force all clients to connect through the proxy.
B.Configure SSL/TLS for all connections and use an authorized network with a specific CIDR range.
C.Enable Cloud SQL private IP and disable public IP. Use VPC Service Controls and Cloud Identity-Aware Proxy for access.
D.Enable Cloud SQL public IP with SSL/TLS and restrict access using Cloud Armor.
AnswerC

Private IP eliminates internet exposure; VPC Service Controls and IAP enforce access control.

Why this answer

It addresses both requirements: encryption and access restriction. Enabling Cloud SQL private IP ensures that the database is only reachable from within the VPC, eliminating internet exposure. VPC Service Controls provide a security perimeter to prevent data exfiltration, and Cloud Identity-Aware Proxy (IAP) enables fine-grained, identity-based access to the database without requiring a public IP or VPN.

Exam trap

The trap here is that candidates often confuse Cloud SQL proxy with a network-level access control solution, or they assume that SSL/TLS and authorized networks are sufficient for VM-only access, overlooking the fact that authorized networks still expose a public IP and do not enforce VM identity.

How to eliminate wrong answers

Option A is wrong because Cloud SQL proxy is a client-side tool for encrypting connections and simplifying authentication, but it does not restrict access to authorized VMs only; it still requires a public IP or a private IP with appropriate network configuration, and it does not enforce VM-level authorization. Option B is wrong because while SSL/TLS encrypts connections, using an authorized network with a public IP still exposes the database to the internet, violating the requirement to restrict access to authorized VMs only; authorized networks are IP-based and do not enforce VM-level identity. Option D is wrong because Cloud Armor is a web application firewall for HTTP(S) traffic, not for database connections; it cannot restrict access to Cloud SQL PostgreSQL instances, and using a public IP with SSL/TLS still leaves the database internet-facing.

1272
Multi-Selectmedium

A company wants to enforce that only approved images from Artifact Registry can be deployed to their GKE clusters. They also want to ensure that images are scanned for vulnerabilities. Which TWO services should they use together?

Select 2 answers
A.Cloud IAM
B.Binary Authorization
C.Cloud Build
D.Container Analysis
E.Artifact Registry
AnswersB, D

Enforces that only signed/approved images are deployed.

Why this answer

Binary Authorization enforces deployment policies based on attestations; Container Analysis scans images for vulnerabilities. Artifact Registry stores images; Cloud Build builds them; IAM controls access.

1273
MCQmedium

A global e-commerce company is designing a Cloud Spanner schema for order processing. They need strong consistency across regions and high write throughput. Orders are identified by a globally unique order ID (UUID). Currently, they use the UUID as the primary key, but they observe write hotspots during peak hours. What primary key design change should they make to distribute writes more evenly?

A.Use the timestamp of order creation as the primary key.
B.Use a sequential integer primary key with auto-increment.
C.Use a composite primary key starting with a hash of the order ID, followed by the order ID.
D.Keep UUID as primary key but add a secondary index on a hash of the UUID.
AnswerC

A hash prefix ensures writes are distributed across all splits, avoiding hotspots.

Why this answer

Using a composite primary key starting with a hash of the order ID distributes writes evenly across all Cloud Spanner nodes, preventing hotspots. Cloud Spanner uses the first column of the primary key to determine row distribution; a monotonically increasing UUID as the first column causes all new writes to land on the same tablet, creating a hotspot. By hashing the UUID first, writes are spread uniformly across the key space, while the order ID ensures uniqueness.

Exam trap

The trap here is that candidates often think secondary indexes or adding a hash anywhere in the schema will fix distribution, but Cloud Spanner only distributes rows based on the first column of the primary key, so the hash must be the leading column.

How to eliminate wrong answers

Option A is wrong because using a timestamp as the primary key is monotonically increasing, which causes all new writes to be directed to the same tablet, creating severe write hotspots and defeating the purpose of distribution. Option B is wrong because a sequential integer primary key with auto-increment is also monotonically increasing, leading to the same hotspot problem as timestamps, and it introduces contention on the auto-increment mechanism. Option D is wrong because keeping the UUID as the primary key does not solve the hotspot issue; adding a secondary index on a hash of the UUID does not change the physical distribution of rows, and Cloud Spanner distributes data based on the primary key, not secondary indexes.

1274
MCQmedium

A company uses Cloud Spanner with a multi-region configuration (nam6) for a global user database. They experience a regional outage affecting us-central1, where the leader region is located. What happens to write availability?

A.Writes continue with increased latency because us-central1 is still available for reads
B.The Spanner instance becomes read-only until an operator manually fails over
C.Writes are blocked until the us-central1 region recovers
D.Writes automatically fail over to us-east1 within seconds
AnswerD

Spanner multi-region configurations provide automatic failover to the secondary region with RTO <5 seconds.

Why this answer

In a multi-region Spanner configuration like nam6 (us-central1 and us-east1), if the leader region (us-central1) goes down, Spanner automatically fails over to the other region (us-east1) as the new leader. This failover is automatic and typically completes within 5 seconds (RTO <5 seconds). Write availability is restored once the new leader region is elected.

1275
MCQmedium

A developer needs to manually instrument a Go application with distributed tracing and send traces to Cloud Trace. Which approach should they use?

A.Enable automatic instrumentation by adding a Cloud Trace agent to the application.
B.Write logs with trace IDs and use log-based metric to track traces.
C.Add trace statements using the Cloud Trace API directly.
D.Use the OpenTelemetry Go SDK and configure the Cloud Trace exporter.
AnswerD

OpenTelemetry is the recommended vendor-neutral approach for manual instrumentation.

Page 16

Page 17 of 20

Page 18