Courseiva

Google Professional Cloud Database Engineer (PCDE) — Questions 301375

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

Page 4

Page 5 of 20

Page 6
301
Multi-Selectmedium

An organization needs to design a disaster recovery plan for Cloud SQL for PostgreSQL with an RPO of 10 seconds and an RTO of 5 minutes. Which TWO solutions meet these requirements? (Choose 2)

Select 2 answers
A.Cloud SQL cross-region read replica with manual promotion.
B.Export the database to Cloud Storage and import in another region.
C.Cloud SQL HA with automatic failover to standby in the same region.
D.Cloud SQL point-in-time recovery from backups.
E.Use Cloud SQL automated backups with cross-region copy.
AnswersA, C

If replication lag is under 10 seconds and manual promotion completes within 5 minutes, this meets the RPO and RTO.

Why this answer

Cloud SQL HA provides near-zero RPO and RTO under 60 seconds within the same region. Cross-region read replicas can achieve RPO of seconds if replication lag is low, and manual promotion takes minutes.

302
MCQeasy

A DevOps team has a GKE workload that experiences fluctuating traffic. They want to automatically adjust the number of pods based on CPU utilization. Which resource should they configure?

A.Pod Disruption Budget
B.Vertical Pod Autoscaler
C.Horizontal Pod Autoscaler
D.Cluster Autoscaler
AnswerC

HPA scales the number of pods based on metrics like CPU utilization.

Why this answer

Horizontal Pod Autoscaler (HPA) automatically scales the number of pod replicas based on observed CPU utilization or other metrics, which is exactly what the team needs.

303
MCQmedium

A DevOps team wants to create a custom metric in Cloud Monitoring that counts the number of failed login attempts per user per minute. This metric should be of type DELTA. What is the correct approach?

A.Use the Metrics Explorer to define a new metric with type DELTA
B.Create a log-based metric using the Logs Explorer with a filter for failed logins, which automatically creates a CUMULATIVE metric
C.Use the Cloud Console to manually add a metric entry, setting type to DELTA
D.Create a metric descriptor using gcloud alpha monitoring metrics create with --metric-kind=DELTA and --value-type=INT64
AnswerD

Correct. gcloud alpha monitoring metrics create allows creating custom metric descriptors with specified kind and type.

Why this answer

DELTA metrics represent the change in a value over a time interval. To create such a metric, you must use the monitoring API to define a metric descriptor with metricKind DELTA and valueType INT64. The metric is then written via the API.

OpenTelemetry can also be used, but the direct API call is the most straightforward. Cloud Monitoring does not support direct creation of DELTA metrics via the Metrics Explorer; CLI examples use custom metric descriptors.

304
MCQmedium

A gaming company uses Cloud Bigtable to store player session data. The row key is player_id (UUID) and they have a column family 'sessions' with multiple columns per session. They want to query all sessions for a specific player in a given time range efficiently. Which row key design improvement should they consider?

A.Add a hash prefix to player_id
B.Append a reverse timestamp to the row key
C.Create a secondary index on timestamp
D.Use a separate table for time-range queries
AnswerB

This allows efficient scanning of recent sessions by scanning rows with player_id prefix and then reading sequentially.

Why this answer

Including a timestamp in the row key after the player_id allows scanning rows with a prefix of player_id and then filtering or scanning within a time range. Using a reverse timestamp helps get recent data first.

305
MCQmedium

A company has a Cloud SQL for PostgreSQL instance that experiences high CPU usage during peak hours due to read-heavy queries. Which optimization is most effective for reducing CPU load?

A.Use connection pooling
B.Increase memory size
C.Add read replicas
D.Enable automatic storage increase
AnswerC

Read replicas distribute read queries, reducing CPU on the primary instance.

Why this answer

Adding read replicas offloads read-heavy queries from the primary Cloud SQL for PostgreSQL instance, distributing the query load and reducing CPU utilization on the primary. This is the most direct and effective optimization for read-heavy workloads because replicas handle SELECT traffic while the primary focuses on writes and critical operations.

Exam trap

Google Cloud often tests the misconception that connection pooling or memory increases are universal performance fixes, but for read-heavy CPU spikes, offloading reads to replicas is the targeted solution.

How to eliminate wrong answers

Option A is wrong because connection pooling reduces the overhead of establishing new database connections, but it does not reduce the CPU cost of executing the read-heavy queries themselves; the same number of queries still run on the same instance. Option B is wrong because increasing memory size can improve cache hit ratios and reduce disk I/O, but it does not directly lower CPU usage from query execution; CPU-bound workloads are not resolved by adding memory. Option D is wrong because automatic storage increase only prevents out-of-disk errors by expanding disk capacity; it has no effect on CPU utilization or query processing load.

306
MCQmedium

A company is planning to use Cloud Spanner for a new global application. They estimate a peak write throughput of 10,000 mutations per second. What is the minimum number of processing units (PUs) required, given that each PU supports up to 2000 mutations/second?

A.1 processing unit
B.5 processing units
C.100 processing units
D.10 processing units
AnswerB

5 PUs provide 10,000 mutations/second.

Why this answer

Each PU supports 2000 mutations/second. To get 10,000 mutations/second, you need 10,000 / 2000 = 5 PUs. However, note that Spanner also requires at least 1 node (1000 PUs) for production.

But the question asks for PUs based on write throughput alone.

307
MCQeasy

A company runs a Spanner instance with a single region configuration. They are experiencing increased latency for writes when there is a network disruption between their application and the Spanner instance. The application is deployed in the same region. What should the database engineer do to minimize write latency during such disruptions?

A.Implement client-side retry logic.
B.Enable multi-region configuration.
C.Use a compute engine instance as a proxy.
D.Increase the number of nodes.
AnswerA

Retry logic handles transient disruptions without architectural change.

Why this answer

Client-side retry logic is the correct approach because Spanner's built-in retry mechanisms (e.g., gRPC deadlines and backoff) can automatically re-send failed write requests when transient network disruptions occur. By implementing application-level retry with exponential backoff and jitter, the database engineer ensures that write operations are resilient to short-lived network blips without requiring infrastructure changes. This directly minimizes write latency during disruptions by avoiding manual intervention and leveraging Spanner's session-based retry capabilities.

Exam trap

The trap here is that candidates often confuse infrastructure scaling (nodes or regions) with application-level fault tolerance, assuming that more resources inherently fix transient network issues, when in fact client-side retry is the direct and cost-effective solution for short-lived disruptions.

How to eliminate wrong answers

Option B is wrong because enabling multi-region configuration would increase write latency due to the need for cross-region consensus (Paxos) and does not address transient network disruptions within a single region. Option C is wrong because using a Compute Engine instance as a proxy introduces an additional hop, increasing latency and potential failure points, and does not solve the underlying network disruption issue. Option D is wrong because increasing the number of nodes improves throughput and storage capacity but does not reduce write latency caused by network disruptions; Spanner's write latency is primarily bound by network round-trips and consensus, not node count.

308
MCQeasy

A DevOps engineer is designing a shared VPC topology for a multi-project environment. Which service project permission allows a project to use subnets from a host project?

A.compute.networkUser on the host project
B.resourcemanager.projectIamAdmin on the service project
C.compute.networkAdmin on the host project
D.compute.instanceAdmin on the service project
AnswerA

This role grants permission to use the host project's VPC networks and subnets.

Why this answer

To use shared VPC, the service project must have the compute.networkUser role on the host project's subnets.

309
MCQhard

A team is using Cloud Spanner for a global user database. They frequently run JOIN queries between a Users table and an Orders table. The queries are slow and the team suspects they are causing cross-node fan-out. Which schema design technique would reduce latency by co-locating related data?

A.Add a hash prefix to the primary key of both tables
B.Denormalize the Orders data into the Users table
C.Use interleaved tables (Orders interleaved in Users)
D.Create a secondary index on the foreign key column
AnswerC

Interleaved tables store rows of Users and Orders together, making JOINs local to a single node.

Why this answer

Interleaved tables in Cloud Spanner store child rows physically with the parent row, allowing efficient JOINs without cross-node fan-out. Secondary indexes improve lookup but do not co-locate data. Hash-prefixed keys distribute writes but don't co-locate parent-child data.

Denormalization avoids JOINs but may not be suitable for all cases.

310
MCQmedium

You manage a Cloud SQL for PostgreSQL instance that handles OLTP workloads. Users in a different region report slow query response times. You notice that the database CPU utilization is below 30%, but network latency is high. What is the most cost-effective solution to reduce query latency without migrating the database?

A.Add more memory to the instance to increase cache hit ratio.
B.Increase the instance's vCPUs to handle more concurrent connections.
C.Create cross-region read replicas and route read queries to the nearest replica.
D.Migrate the database to Cloud Spanner using a live migration service.
AnswerC

Read replicas reduce the network distance for read traffic, improving latency without moving the primary database.

Why this answer

The issue is high network latency for users in a different region, not local resource contention. Creating cross-region read replicas allows read queries to be served from a replica closer to the users, reducing network round-trip time without migrating the database. This is the most cost-effective solution as it avoids expensive instance upgrades or a full migration to Cloud Spanner.

Exam trap

The trap here is that candidates often focus on scaling the instance (CPU or memory) when the symptom is high latency, but the root cause is geographic distance, not resource exhaustion.

How to eliminate wrong answers

Option A is wrong because adding more memory to increase the cache hit ratio addresses local cache misses, not high network latency; CPU utilization is below 30%, indicating no memory pressure. Option B is wrong because increasing vCPUs handles more concurrent connections, but the problem is network latency, not CPU or connection bottlenecks. Option D is wrong because migrating to Cloud Spanner is a costly and complex operation that involves changing the database paradigm from relational to globally distributed, which is overkill for a simple latency issue that can be solved with read replicas.

311
MCQeasy

A site reliability engineer defines a service's availability SLI as the percentage of successful requests. Which of the following is the correct formula for this SLI?

A.good-request-count / total-requests (including invalid) * 100
B.error-request-count / valid-request-count * 100
C.valid-request-count / error-request-count * 100
D.good-request-count / valid-request-count * 100
AnswerD

This is the standard formula for request-based availability SLI.

Why this answer

Availability SLI is typically defined as the count of successful requests divided by total valid requests, measured over a rolling window.

312
Multi-Selectmedium

A company is designing a BigQuery data warehouse for sales analytics. They want to minimize query costs when aggregating daily sales by region and product. Which two methods are effective? (Select TWO).

Select 2 answers
A.Creating a materialized view with GROUP BY region, product, day
B.Using a view that queries the raw data with WHERE clause
C.Storing pre-aggregated results in a separate table and updating nightly
D.Creating indexes on the raw table
E.Using a clustered table on (region, product) with partition by day
AnswersA, E

Materialized views store precomputed results and are automatically refreshed, reducing query cost and time.

Why this answer

A materialized view in BigQuery pre-computes and stores the results of the GROUP BY query on region, product, and day. When the underlying data changes, the materialized view is incrementally refreshed, so queries that match the view's aggregation are served directly from the stored results, avoiding full table scans and reducing query costs (bytes processed). This is ideal for recurring aggregation patterns like daily sales summaries.

Exam trap

Google Cloud often tests the distinction between a view (which is just a saved query) and a materialized view (which stores pre-computed results), leading candidates to incorrectly select Option B as a cost-saving measure.

313
MCQmedium

An engineer is manually migrating a MySQL database to Cloud SQL using mysqldump and mysql import. They need to ensure the dump captures a consistent snapshot without locking InnoDB tables. Which mysqldump flags should they use?

A.--single-transaction --lock-tables
B.--lock-tables --skip-lock-tables
C.--single-transaction --skip-lock-tables
D.--all-databases --single-transaction
AnswerC

Correct combination for consistent InnoDB snapshot without locking.

Why this answer

--single-transaction uses a transaction to get a consistent snapshot for InnoDB without locking. --skip-lock-tables prevents table locks. Together they achieve consistent backup without disrupting writes.

314
Multi-Selecteasy

A startup is building a mobile app with a relational database backend. They expect moderate traffic and need strong consistency, automatic backups, and point-in-time recovery. Which two Google Cloud database services meet these requirements? (Choose TWO.)

Select 2 answers
A.Firestore
B.Cloud Spanner
C.Cloud SQL
D.Cloud Bigtable
E.BigQuery
AnswersB, C

Relational, strongly consistent, with backups and PITR.

Why this answer

Cloud Spanner is correct because it provides strong consistency across globally distributed data using TrueTime and synchronous replication, along with automatic backups and point-in-time recovery. Cloud SQL is correct because it offers fully managed relational databases (MySQL, PostgreSQL, SQL Server) with automated backups and point-in-time recovery, meeting the need for strong consistency and moderate traffic.

Exam trap

Google Cloud certifications often test the distinction between relational and NoSQL databases, trapping candidates who assume Firestore or Bigtable can serve as relational backends with strong consistency, when in fact they sacrifice consistency for scalability or are designed for different use cases.

315
MCQeasy

Based on the exhibit from Cloud Spanner Query Insights, what is the most likely performance issue?

A.High network latency
B.Full table scan
C.Inefficient join
D.No index on customer_id
AnswerD

Missing index causes a full scan of the Orders table.

Why this answer

The exhibit shows a query with a filter on `customer_id` that is not indexed, forcing Cloud Spanner to perform a full table scan to find matching rows. This is the most likely performance issue, as indicated by high latency and high row scan counts in Query Insights, which directly points to a missing index on the filtered column.

Exam trap

Google Cloud often tests the distinction between a symptom (full table scan) and its root cause (missing index), tricking candidates into selecting the visible effect rather than the underlying configuration issue.

How to eliminate wrong answers

Option A is wrong because high network latency would manifest as increased client-side wait times and not as high row scan counts or CPU usage within the Spanner backend; Query Insights metrics focus on database-side execution, not network round trips. Option B is wrong because a full table scan is a symptom, not the root cause—the underlying reason for the full scan is the missing index on customer_id, making B a description of the effect rather than the most likely performance issue. Option C is wrong because an inefficient join would show high join-related metrics like rows returned from join operations or skewed distribution, but the exhibit does not indicate any join operations; the query appears to be a simple filter on a single table.

316
MCQhard

Your team uses Cloud Bigtable for a time-series data analytics platform. You observe that the write throughput has dropped significantly, and Cloud Monitoring shows that most of the CPU usage is concentrated on a few nodes. The remaining nodes have low CPU usage. The data model uses sequential timestamps as row keys, and the application writes data for many different sensors. Each sensor ID is part of the row key. What is the most effective action to resolve this hot spotting?

A.Reduce the batch size of writes to decrease the load on each node.
B.Use a different Bigtable cluster and migrate data.
C.Increase the number of nodes in the cluster to provide more CPU capacity.
D.Prepend a hash of the sensor ID to the row key to distribute writes evenly.
AnswerD

This breaks the sequential key pattern and distributes writes across all nodes, eliminating hot spotting.

Why this answer

Hot spotting occurs because sequential timestamps as row keys cause writes to be concentrated on a few nodes. By prepending a hash of the sensor ID to the row key, writes for different sensors are distributed across the entire cluster, eliminating hot spots. Option A (reducing batch size) does not fix the key design issue.

Option B (increasing nodes) might help temporarily but the uneven distribution remains. Option C (using a different cluster) is unnecessary and does not address the root cause.

317
MCQmedium

Your team uses Cloud Monitoring to set up an alerting policy for high CPU utilization. You want the policy to trigger only if CPU usage exceeds 80% for at least 5 minutes. Which condition configuration should you use?

A.Set the alignment period to 300 seconds
B.Set the forecast horizon to 300 seconds
C.Set the duration field to 300 seconds
D.Set the retest window to 300 seconds
AnswerC

Duration specifies how long the metric must be above the threshold before the condition is met.

Why this answer

The 'duration' field in a metric threshold condition specifies how long the metric must violate the threshold before triggering. Setting duration to 300 seconds (5 minutes) achieves the requirement. Alignment period and retest window are separate concepts.

318
MCQmedium

A company uses Cloud Run and wants to deploy a new revision that initially receives 5% of traffic, and only if it's healthy, gradually increase to 100%. Which gcloud command should they use?

A.gcloud run deploy --image ... --canary-percent=5
B.gcloud run deploy --image ... --traffic=5
C.gcloud run deploy --image ... --to-revisions=REVISION_1=95,REVISION_2=5
D.gcloud run deploy --image ... --min-instances=1 --max-instances=10
AnswerB

Correct. The `--traffic` flag sets the percentage of traffic for the newly deployed revision. This command starts a canary deployment with 5% traffic to the new revision.

Why this answer

The `gcloud run deploy` command with the `--traffic` flag allows you to deploy a new revision and immediately set the percentage of traffic it should receive. By specifying `--traffic=5`, the new revision gets 5% of traffic, while the previous revision keeps the remaining 95%. This initiates a canary deployment.

The gradual increase to 100% must be managed separately using `gcloud run services update-traffic` commands or an automated pipeline, but the initial command is correct for starting the canary.

Exam trap

The trap is that candidates may think the `--to-revisions` flag is the correct way to set initial traffic for a new revision, but it requires knowing the revision name beforehand. The `--traffic` flag is specifically designed for deploying a new revision with a controlled traffic split.

How to eliminate wrong answers

Option A is wrong because `--canary-percent` is not a valid flag for `gcloud run deploy`; Cloud Run does not support a direct canary percentage parameter in the deploy command. Option B is wrong because `--traffic=5` would set the entire service's traffic to 5% of the original, not allocate 5% to a new revision, and it does not support gradual rollout. Option D is wrong because `--min-instances` and `--max-instances` control instance scaling, not traffic routing or canary deployment, and have no effect on traffic allocation.

319
MCQmedium

A Memorystore for Redis instance is experiencing out-of-memory errors, causing keys to be evicted. The application relies on all keys being present. The current maxmemory-policy is allkeys-lru. What should the engineer do to prevent evictions?

A.Change the eviction policy to noeviction.
B.Change the eviction policy to volatile-lru.
C.Enable persistence to Cloud Storage to offload memory.
D.Scale up the instance to a higher tier with more memory.
AnswerA

noeviction prevents eviction; writes will fail instead of losing keys.

Why this answer

Changing the eviction policy to noeviction causes Redis to return errors instead of evicting keys when memory is full. This ensures that all existing keys remain present, which is critical for the application. While scaling up (option D) could increase memory capacity, it does not guarantee that evictions will be prevented if memory usage grows to exceed the new limit.

The noeviction policy directly prevents evictions, at the cost of write failures when memory is exhausted.

320
MCQhard

You are designing disaster recovery for a globally distributed application using Cloud Spanner with a multi-region configuration. The application requires an RPO of 0 and an RTO of less than 5 seconds in the event of a full region failure. Which Spanner configuration provides these guarantees?

A.A single-region Spanner instance with a read replica in another region.
B.A multi-region Spanner instance with one read-write region and two read-only regions.
C.A dual-region Spanner instance using default leader placement.
D.A multi-region Spanner instance with two read-write regions and one witness region.
AnswerD

Correct: a multi-region instance with at least two read-write regions can achieve synchronous replication and automatic failover within seconds.

Why this answer

A multi-region configuration with a leader region and at least two voting regions provides synchronous replication and automatic failover. Regional failover occurs within seconds, preserving zero data loss.

321
MCQmedium

A retail company uses Cloud Spanner to store product inventory data. The table structure is: CREATE TABLE Inventory ( ProductId INT64 NOT NULL, WarehouseId INT64 NOT NULL, StockLevel INT64 NOT NULL, LastUpdated TIMESTAMP NOT NULL OPTIONS (allow_commit_timestamp=true) ) PRIMARY KEY (ProductId, WarehouseId); The application frequently runs the query: SELECT ProductId, SUM(StockLevel) AS TotalStock FROM Inventory WHERE WarehouseId = 123 GROUP BY ProductId. The query is slow and scans many rows. The index used is: CREATE INDEX InventoryByWarehouse ON Inventory (WarehouseId); What is the most effective schema change to improve query performance?

A.Change the primary key to (WarehouseId, ProductId) so rows are interleaved by warehouse.
B.Create a materialized view that pre-aggregates stock by warehouse.
C.Modify the index to INCLUDE StockLevel: CREATE INDEX InventoryByWarehouse ON Inventory (WarehouseId) STORING (StockLevel).
D.Add a STORED GENERATED column for total stock per warehouse.
AnswerC

The STORING clause adds StockLevel to the index, making it a covering index for the query, so Cloud Spanner can return results from the index alone without scanning the base table.

Why this answer

The query needs to read StockLevel for every row matching WarehouseId, but the existing index only covers WarehouseId, forcing a back-join to the base table. By using STORING (StockLevel), the index becomes a covering index that includes the StockLevel column, eliminating the need for the back-join and reducing the number of rows scanned to only those matching the warehouse filter.

Exam trap

The trap here is that candidates often think changing the primary key order (Option A) will physically colocate data and speed up the query, but in Cloud Spanner, primary key order does not eliminate the need to scan all rows for a given WarehouseId, and the query still requires aggregation across ProductId groups, so a covering index is the correct optimization.

How to eliminate wrong answers

Option A is wrong because changing the primary key to (WarehouseId, ProductId) would reorder the table's physical storage, but Cloud Spanner does not support interleaving in the same way as Cloud SQL; more importantly, the query still needs to aggregate StockLevel across all rows for each ProductId, and a primary key change does not avoid scanning all rows for the given WarehouseId. Option B is wrong because creating a materialized view that pre-aggregates stock by warehouse would not help this query, which groups by ProductId, not by warehouse; the materialized view would need to be grouped by (WarehouseId, ProductId) to be useful, and even then, maintaining a materialized view adds write overhead and complexity. Option D is wrong because a STORED GENERATED column for total stock per warehouse is not possible in Cloud Spanner—generated columns cannot reference rows from other rows or perform aggregation, and they are computed per row, not across rows.

322
MCQmedium

A retail company uses BigQuery to analyze sales data. They need to create a weekly report showing total sales per product category for the last 4 weeks, but the query is taking too long and exceeding slot resources. The sales table has over 2 billion rows and is partitioned by date. Which design change would most improve query performance and reduce slot consumption?

A.Increase the number of available slots in the reservation.
B.Cluster the table by product_category within the existing date partitions.
C.Create a materialized view that pre-aggregates sales by category and date.
D.Partition the table by product_category instead of date.
AnswerB

Clustering by product_category allows the query to skip irrelevant blocks, reducing data scanned and slot usage.

Why this answer

Clustering the table by product_category within the existing date partitions organizes the data physically so that queries filtering or grouping by product_category can skip irrelevant blocks. This reduces the amount of data scanned and the slot consumption, directly addressing the performance issue without requiring additional resources.

Exam trap

Google Cloud often tests the misconception that adding more slots (Option A) is the primary solution for slow queries, when in reality data skipping techniques like clustering or partitioning are more cost-effective and fundamental to performance optimization in BigQuery.

How to eliminate wrong answers

Option A is wrong because increasing slots only adds more parallel processing capacity but does not reduce the amount of data scanned; the query would still process all 2 billion rows, leading to unnecessary slot consumption. Option C is wrong because a materialized view pre-aggregates by category and date, but it still requires scanning the base table for updates and does not optimize the existing partitioned table's scan efficiency for the weekly report; it also incurs additional storage and maintenance costs. Option D is wrong because partitioning by product_category instead of date would create a large number of small partitions (one per category), which is inefficient for range-based queries (e.g., last 4 weeks) and can lead to partition explosion, increasing metadata overhead and query latency.

323
MCQmedium

A company is deploying a microservice on Cloud Run that needs to handle up to 1000 concurrent requests per instance. The default concurrency setting is 80. How should they configure the service to achieve the desired concurrency?

A.Set the `--execution-environment` to gen2.
B.Set the `--cpu` flag to 4.
C.Set the `--max-instances` flag to 1000.
D.Set the `--concurrency` flag to 1000.
AnswerD

This sets the maximum number of concurrent requests that each container instance can handle.

Why this answer

Cloud Run allows setting max concurrent requests per instance via the `--concurrency` flag. Setting it to 1000 enables the desired throughput.

324
MCQhard

A service has an SLO of 99.9% availability over a 30-day rolling window. The team wants to use Cloud Monitoring to create a request-based SLO. Which configuration is correct?

A.Use an error budget metric: total allowed errors over 30 days
B.Use a request-based metric: good request count / valid request count
C.Use a latency metric: proportion of requests under threshold
D.Use a window-based metric: good minutes / total minutes
AnswerB

Request-based SLOs directly measure the ratio of good requests to total valid requests.

Why this answer

For a request-based SLO, you define two metrics: good request count and valid request count. The SLO is the ratio of good to valid requests.

325
Multi-Selecthard

A multinational corporation uses BigQuery to combine sales data from multiple regions. Each region stores data in separate tables with identical schemas. The BI team needs to create a unified view for a dashboard that queries data by region and product. Which TWO strategies should the data engineer implement to optimize query performance and reduce costs?

Select 2 answers
A.Partition the table by date and cluster by region and product
B.Use a wildcard table with a filter on _TABLE_SUFFIX to query only required region tables
C.Create a view with UNION ALL of all region tables
D.Create materialized views for each region
E.Store all data in a single table with region as a column
AnswersA, B

Reduces data scanned for common filter conditions.

Why this answer

Partitioning the table by date and clustering by region and product enables partition pruning and clustering block elimination, reducing data scanned and costs. Option B is correct because wildcard tables with a filter on _TABLE_SUFFIX allow BigQuery to query only the required region tables, minimizing data read and cost. The other options are not optimal: C (UNION ALL view) does not reduce data scanned unless underlying tables are partitioned/clustered; D (materialized views for each region) adds complexity and cost; E (single table with region column) may still scan all data if not partitioned/clustered properly, and does not leverage region-specific tables.

Exam trap

Google Cloud often tests the misconception that a UNION ALL view alone provides performance benefits, when in fact it does not reduce data scanned unless combined with table-level filters like _TABLE_SUFFIX or underlying partitioned/clustered tables.

326
MCQmedium

A company uses Cloud SQL for PostgreSQL and needs to add a full-text search capability to a table with product descriptions. Which index type should be used?

A.B-tree index
B.GiST index
C.Hash index
D.GIN index
AnswerD

GIN indexes are designed for full-text search and composite types.

Why this answer

PostgreSQL supports full-text search using indexes created with the 'gin' index type on tsvector columns. The question asks for index type. In Cloud SQL for PostgreSQL, you can use the built-in full-text search with GIN indexes.

327
MCQmedium

A healthcare analytics company uses Cloud Bigtable to store time-series data from medical devices. The table has a row key of 'device_id#timestamp' where timestamp is stored in reverse order (max - timestamp) so that recent data is at the top. Queries that fetch data for a specific device over a date range are very fast. However, analysts also need to run queries that aggregate data across all devices for a specific hour (e.g., count of readings between 2023-01-01 10:00 and 11:00). These queries are extremely slow because they require scanning all rows. The team must redesign the schema to support both access patterns without duplicating data unnecessarily. What is the best approach?

A.Use BigQuery to query Bigtable via an external table and run the aggregation there.
B.Increase the number of Bigtable nodes to improve scan throughput.
C.Add a secondary index on the timestamp column.
D.Create a second table with row key 'timestamp#device_id' (with timestamp in natural order) to support time-range queries.
AnswerD

This provides efficient access for the aggregation query by allowing a range scan over the timestamp.

Why this answer

Creating a second table with row key 'timestamp#device_id' (with timestamp in natural order) allows efficient range scans for a given time period across all devices, because Bigtable rows are sorted lexicographically by row key. This enables fast aggregation queries without scanning all rows. Option A (using BigQuery external table) would still require scanning the entire Bigtable for each query, and adds latency.

Option B (increasing nodes) improves throughput but does not change the need to scan all rows, so it does not address the root cause. Option C (secondary index) is not supported in Bigtable.

328
Multi-Selectmedium

A company is running a production Cloud SQL for PostgreSQL instance and wants to implement point-in-time recovery (PITR) with a 7-day retention window. They also need to ensure that automated backups are taken daily. Which two configurations must be enabled? (Choose TWO.)

Select 2 answers
A.Set the database flag 'archive_mode' to 'on' for WAL archiving
B.Enable binary logging by setting 'log_bin' flag
C.Configure automated backups via Cloud SQL backup settings
D.Create a cross-region backup replica
E.Set the backup retention to 7 days using gcloud sql instances patch --backup-start-time
AnswersA, C

WAL archiving is required for PITR in PostgreSQL.

Why this answer

PITR requires WAL archiving, which is enabled by setting the 'archive_mode' to 'on' (or 'always') in the database flags. Automated backups are scheduled via the backup configuration in Cloud SQL. The retention period for PITR is set separately under backup settings.

329
MCQhard

An engineer is configuring a Cloud SQL for PostgreSQL instance for an OLTP workload. The instance has 30 GB of RAM and expects up to 2000 concurrent connections. The default max_connections is 100. The engineer needs to set max_connections appropriately based on Google's recommendation. What should the max_connections be set to?

A.1500
B.1920
C.3072
D.2000
AnswerB

1920 = 30720 MB / 16, following Google's recommendation.

Why this answer

Google Cloud SQL recommends setting max_connections = RAM_MB / 16. With 30 GB RAM = 30720 MB, that gives 1920 connections. This balances connection overhead and available memory.

330
MCQhard

You have a Cloud Spanner table 'Orders' with columns: OrderId, CustomerId, OrderDate, Status. You need to support a query that finds all orders for a customer in the last 30 days, sorted by OrderDate descending, with strong consistency. Using only indexes, what is the best approach?

A.Create a secondary index on (OrderDate) only
B.Create a secondary index on (CustomerId, OrderDate)
C.Use a manual table scan with filter
D.Create a secondary index on (CustomerId, OrderDate DESC) with INCLUDE (OrderId, Status)
AnswerD

Index covers the query completely, providing efficient ordered retrieval.

Why this answer

It creates a covering index with the exact sort order needed (DESC on OrderDate) and includes all required columns (OrderId, Status) to avoid back-to-table lookups. This ensures strong consistency in Cloud Spanner by using a single index scan without needing to read the base table, while the composite key on (CustomerId, OrderDate) efficiently filters by customer and date range.

Exam trap

Google Cloud Spanner requires a composite index with the correct sort order (DESC) and covering columns for optimal query performance. A simple index on OrderDate alone would not efficiently filter by CustomerId, and a table scan is not recommended when an index can satisfy the query.

How to eliminate wrong answers

Option A is wrong because an index on (OrderDate) only cannot efficiently filter by CustomerId, requiring a full scan of the index or table to find orders for a specific customer, which violates the query requirement. Option B is wrong because while (CustomerId, OrderDate) allows filtering by customer and date, it defaults to ascending order on OrderDate, so the query would need an extra sort step or a reverse scan, which is less efficient than a pre-sorted descending index. Option C is wrong because a manual table scan with filter would scan the entire table, incurring high latency and cost, and does not leverage indexes, which contradicts the 'using only indexes' constraint in the question.

331
MCQeasy

Your Cloud Spanner instance is experiencing high write latency and hot spots on a table that uses an auto-incrementing integer as the primary key. Which change would best mitigate the hot spots?

A.Change the primary key to a random UUID.
B.Add a secondary index on the auto-incrementing column.
C.Increase the number of splits by raising the number of nodes.
D.Use interleaved tables to store related data together.
AnswerA

UUIDs are uniformly distributed, preventing hot spots.

Why this answer

Monotonically increasing keys (like auto-incrementing integers) cause all writes to go to the same tablet (hot spot) in Cloud Spanner. Using a key with uniform distribution, such as a random UUID or a hash prefix, spreads writes across splits. Bit-reverse index is an alternative for sequential keys, but a random key is simpler.

Interleaved tables and secondary indexes do not address the root cause.

332
Multi-Selectmedium

A company needs to define backup retention policies for Cloud SQL, Spanner, and Bigtable to meet compliance requirements. Which THREE statements about backup retention are correct? (Choose three.)

Select 3 answers
A.Cloud SQL automated backups can be retained for up to 365 days.
B.Cloud SQL automated backups can be retained for up to 730 days.
C.Bigtable managed backups have a maximum retention of 30 days.
D.Bigtable on-demand backups can be retained indefinitely by using Cloud Storage object lifecycle management.
E.Cloud Spanner backup expiration can be set to a maximum of 365 days.
AnswersA, D, E

Cloud SQL allows setting backup retention up to 365 days for automated backups.

Why this answer

Cloud SQL automated backups can be retained for up to 365 days. Spanner backup expiration is maximum 365 days. Bigtable on-demand backups are stored in Cloud Storage and can be retained indefinitely using lifecycle policies.

The other options are incorrect: Cloud SQL maximum is 365 days, Spanner maximum is 365 days, Bigtable backups are not limited to 30 days.

333
MCQmedium

A company runs an e-commerce platform on Cloud SQL for MySQL. They need to comply with a policy that requires database backups to be retained for 365 days. They also need to restore to any point within the last 30 days. How should they configure their backup settings?

A.Use export to Cloud Storage daily and store exports for 365 days
B.Enable automated backups with retention set to 365 days and enable binary logging for PITR
C.Enable automated backups with retention set to 365 days and set transaction log retention to 365 days
D.Enable automated backups with retention set to 30 days and create on-demand backups daily to cover the 365-day retention
AnswerD

On-demand backups (snapshots) can be retained indefinitely. Automated backups for PITR can be set to 30 days to meet PITR requirement, while on-demand backups meet long-term retention.

Why this answer

Cloud SQL supports automated backups and point-in-time recovery (PITR) using binary logs. The maximum automated backup count is 365, and you can set the transaction log retention for PITR up to 35 days. For 365-day retention, you need to use on-demand backups (snapshots) which can be retained indefinitely.

For PITR within 30 days, enable automated backups and binary logging with a log retention of 30 days.

334
MCQeasy

An organization wants to enforce that all Cloud Run services are not publicly accessible. Which organization policy should they use?

A.`compute.vmExternalIpAccess`
B.`run.allowedIngress`
C.`iam.allowedPolicyMemberDomains`
D.`cloudrun.allowedIngress`
AnswerB

This constraint controls ingress settings for Cloud Run services.

Why this answer

The `run.allowedIngress` organization policy constraint is specifically designed to control ingress settings for Cloud Run services, allowing administrators to enforce that all services restrict traffic to internal sources only (e.g., `internal` or `internal-and-cloud-load-balancing`). This directly prevents public accessibility by blocking external HTTP/S requests at the platform level, overriding any per-service configuration.

Exam trap

The trap here is that candidates confuse the valid constraint prefix `run.allowedIngress` with the non-existent `cloudrun.allowedIngress`, as Cloud Run's resource name in the API is `run` (not `cloudrun`), and they may also mistakenly apply VM-focused constraints like `compute.vmExternalIpAccess` to serverless services.

How to eliminate wrong answers

Option A is wrong because `compute.vmExternalIpAccess` is a constraint for Compute Engine VMs, not Cloud Run; it controls whether VMs can have external IP addresses, not ingress traffic to serverless services. Option C is wrong because `iam.allowedPolicyMemberDomains` restricts which external domains can be members of IAM policies, which is unrelated to network ingress controls for Cloud Run. Option D is wrong because `cloudrun.allowedIngress` is not a valid organization policy constraint name; the correct prefix is `run.allowedIngress` (Cloud Run uses the `run` service prefix in organization policies).

335
MCQeasy

A BI analyst wants to create a report that displays total revenue by product category and month, with ability to drill down to individual products. Which schema design supports this in BigQuery?

A.Denormalized table with repeated fields
B.Single wide table with all dimensions and measures
C.Star schema with fact table and dimension tables
D.Snowflake schema with normalized dimensions
AnswerC

Star schema is optimized for BI: fact table stores measures, dimensions store attributes, enabling flexible aggregation and drill-down.

Why this answer

A star schema with a central fact table (containing revenue measures) and separate dimension tables (for product category, month, and product) is the optimal design for BI reporting in BigQuery. This schema enables efficient aggregation by product category and month, while supporting drill-down to individual products via joins on the product dimension key. BigQuery's columnar storage and query engine are optimized for star schema joins, making this both performant and cost-effective.

Exam trap

A common misconception is that denormalized or wide tables (Options A or B) are always faster for BI queries. However, in BigQuery, star schemas with proper clustering and partitioning outperform wide tables due to reduced I/O and better use of columnar pruning. The drill-down requirement from category to product is naturally supported by star schema joins.

How to eliminate wrong answers

Option A is wrong because denormalized tables with repeated fields (e.g., ARRAY<STRUCT>) are designed for nested data, not for drill-down reporting; they complicate aggregation and filtering across multiple granularities. Option B is wrong because a single wide table with all dimensions and measures leads to data redundancy, increased storage costs, and slower queries due to scanning unnecessary columns when aggregating at different levels. Option D is wrong because a snowflake schema with normalized dimensions adds extra join layers (e.g., sub-dimensions for product sub-categories) that increase query complexity and latency in BigQuery without providing significant benefit for this simple drill-down requirement.

336
Multi-Selectmedium

A company uses Cloud Bigtable with two clusters in different regions for disaster recovery. They need to ensure that if the primary cluster becomes unavailable, read traffic is automatically redirected to the secondary cluster with minimal manual intervention. Which three actions should they take? (Choose THREE)

Select 3 answers
A.Enable multi-cluster replication between the clusters
B.Set up Cloud DNS with a health check to detect cluster health and update DNS records accordingly
C.Configure the Bigtable routing policy to 'any-replica' or 'read-failover'
D.Add read-only replicas to the secondary cluster
E.Configure a write failback policy to switch write clusters
AnswersA, B, C

Multi-cluster replication is necessary to keep data in sync across regions.

Why this answer

To achieve automatic failover for Bigtable reads, you need: (1) multi-cluster replication enabled, (2) a routing policy that supports failover (read-failover or any-replica with health checking), and (3) an external health check mechanism (like Cloud DNS health checks) to redirect client traffic if the primary cluster is unhealthy. Option D (write failback) is not relevant for reads. Option E (read-only replicas) is not applicable as Bigtable doesn't have that concept.

337
Multi-Selectmedium

A team wants to reduce toil by automating a recurring cloud resource update. Which THREE Google Cloud services can be used together to build an automated pipeline? (Choose 3 answers)

Select 3 answers
A.Cloud Pub/Sub
B.Cloud Deployment Manager
C.Cloud Scheduler
D.Cloud Functions
E.Cloud Build
AnswersC, D, E

Can trigger periodic jobs.

Why this answer

Cloud Build can run automation scripts, Cloud Functions can be triggered by events, and Cloud Scheduler can trigger periodic jobs. Together they can form a pipeline. Pub/Sub and Deployment Manager are also possible but the question asks for THREE from the given set that are commonly used together.

338
MCQeasy

A team is using Cloud SQL for PostgreSQL and wants to monitor replication lag on their read replicas. Which metric should they use?

A.cloudsql.googleapis.com/database/replication/lag
B.cloudsql.googleapis.com/database/network/received_bytes_count
C.cloudsql.googleapis.com/database/disk/bytes_used
D.cloudsql.googleapis.com/database/cpu/utilization
AnswerA

This metric directly shows the replication lag in seconds.

Why this answer

Cloud SQL provides a metric called 'replication_lag' for read replicas, which measures the time (in seconds) the replica is behind the primary. CPU utilisation and disk usage are for performance, not replication. For PostgreSQL, the metric is valid.

339
MCQmedium

A DevOps engineer is bootstrapping a new organization. They need to set up a centralized logging project to collect audit logs from all projects. What is the required step to enable cross-project log sinks?

A.Create a log sink in the central project that pulls logs from other projects.
B.Use Cloud Audit Logs API to stream logs to the central project.
C.Create a log sink in each source project with the destination set to the central project's BigQuery dataset.
D.Grant the central project's logging service account the `roles/logging.admin` role in each source project.
AnswerC

This is the correct method to aggregate logs cross-project.

Why this answer

To send logs from one project to another, you create a sink in the source project with a destination in the central project. The sink can be configured to include all logs or specific ones (e.g., audit logs). The destination must be a BigQuery dataset, Cloud Storage bucket, or Pub/Sub topic in the central project.

340
MCQhard

During an Oracle to PostgreSQL migration using Ora2Pg, a NUMBER(10,2) column is being mapped. Which PostgreSQL data type should be used to preserve precision and scale?

A.TEXT
B.INTEGER
C.FLOAT
D.NUMERIC(10,2)
AnswerD

NUMERIC(10,2) exactly matches the Oracle NUMBER(10,2) precision and scale.

Why this answer

NUMBER(10,2) maps directly to NUMERIC(10,2) in PostgreSQL, which preserves the exact precision and scale. INTEGER does not support scale, TEXT is for strings, and FLOAT may introduce rounding errors.

341
MCQeasy

A team's SLO for availability is 99.9% over a 30-day window. They have consumed 80% of their error budget halfway through the month. What is the remaining allowed downtime for the rest of the month?

A.About 17 minutes 17 seconds
B.About 34 minutes 34 seconds
C.About 43 minutes 12 seconds
D.About 8 minutes 38 seconds
AnswerD

20% of 43.2 minutes = 8.64 minutes = 8 minutes 38 seconds.

Why this answer

Total error budget = 100% - 99.9% = 0.1% of 30 days = 43.2 minutes (0.1% * 30 * 1440). 80% consumed means 20% remains: 0.2 * 43.2 = 8.64 minutes, approximately 8 minutes 38 seconds.

342
MCQmedium

An engineer needs to build a Docker image using Cloud Build and ensure the image is cached across builds to speed up subsequent runs. The build uses Kaniko. What should the engineer add to the cloudbuild.yaml to enable layer caching?

A.Use the 'kaniko' builder and set '--cache=true' and '--cache-repo'
B.Configure a build pool with a persistent disk for caching
C.Add step using 'docker build' with '--cache-from'
D.Set the 'images' field in cloudbuild.yaml to enable automatic caching
AnswerA

Kaniko supports caching via --cache=true and --cache-repo to specify where cached layers are stored in Artifact Registry or Container Registry.

Why this answer

Cloud Build with Kaniko supports caching by specifying a destination for cached layers. The --cache=true flag enables caching, and --cache-repo sets the repository where cached layers are stored. --destination is used for the final image but not for cache configuration alone.

343
MCQmedium

A team is planning a migration from PostgreSQL to Cloud SQL with minimal downtime. They have set up DMS continuous migration. At cutover time, they need to ensure no data loss. What should they verify before promoting the destination?

A.The DMS job status is 'Running'
B.The destination has been promoted already
C.The source database is still accepting writes
D.The DMS replication lag is 0 seconds
AnswerD

This ensures all changes have been replicated and there is no data loss.

Why this answer

Confirming DMS replication lag is 0 ensures all changes from the source have been applied to the destination. DMS status 'Running' is not enough. Source reads disabled would cause issues.

DMS should be in a healthy state, but lag = 0 is the key.

344
Multi-Selectmedium

A team is designing a Bigtable schema for a real-time fraud detection system. The row key includes device ID and timestamp. They need to avoid hotspotting during high write periods. Which two row key design patterns help achieve this? (Choose TWO.)

Select 2 answers
A.Add a hash prefix or salt to the beginning of the row key.
B.Put the most frequently filtered fields first in the row key.
C.Use reverse timestamp to keep recent data first.
D.Use device ID as the sole row key prefix to group data by device.
E.Use a hash of the device ID to randomize the row key.
AnswersA, E

Salting distributes writes across tablets.

Why this answer

Adding a hash prefix or salt to the beginning of the row key distributes writes across multiple tablet servers, preventing hotspotting on a single node. In Bigtable, row keys are sorted lexicographically, so sequential device IDs or timestamps would cause all writes to hit the same tablet. A hash prefix ensures even distribution of write load.

Exam trap

Google Cloud often tests the distinction between patterns that optimize reads (like putting filtered fields first) versus patterns that prevent write hotspotting (like salting or hashing), and candidates mistakenly choose read-optimization patterns for a write-heavy scenario.

345
Multi-Selectmedium

You are designing a monitoring strategy for a GKE cluster. You need to collect application metrics, traces, and logs in a vendor-neutral way, and export them to Google Cloud. Which TWO components should you use? (Choose two.)

Select 2 answers
A.Cloud Logging agent
B.Stackdriver Monitoring agent
C.OpenCensus agent
D.OpenTelemetry SDK
E.OpenTelemetry Collector
AnswersD, E

OpenTelemetry SDK provides a vendor-neutral instrumentation layer that collects metrics, traces, and logs using a single, unified API, directly satisfying the stem’s requirement to avoid vendor lock-in while exporting to Google Cloud. Its exporter pipeline can send telemetry to Google Cloud Monitoring, Cloud Trace, and Cloud Logging without requiring proprietary agents.

Why this answer

OpenTelemetry SDK is the vendor-neutral instrumentation library. The OTel Collector can receive data from SDKs and export to multiple backends including Cloud Monitoring, Cloud Trace, and Cloud Logging. Stackdriver agent is deprecated, and OpenCensus is legacy.

346
MCQhard

A company uses Firestore in Native mode. They have a collection with 1 million documents and frequently run queries that filter on two fields: status and createdAt. The queries are slow. What should the team do?

A.Create a composite index on (status, createdAt)
B.Create an index exemption for the status field
C.Use the Datastore mode instead
D.Add an index exemption for the createdAt field
AnswerA

Composite indexes are required for queries on multiple fields to be efficient.

Why this answer

Firestore creates single-field indexes automatically but for multi-field queries, a composite index must be created manually. Without it, queries may be slow or fail.

347
MCQmedium

Your application uses Firestore for real-time updates. You notice increasing read latency during peak hours. The database is in Native mode with a single-location (us-central1). After reviewing metrics, you see that the number of document reads has not changed significantly, but the database size has grown. What is the most likely cause and solution?

A.Enable multi-region replication to distribute read traffic.
B.The database needs to be defragmented periodically; run a compaction command.
C.Migrate the database to Datastore mode for better performance.
D.Review and create composite indexes for common query patterns.
AnswerD

Missing indexes cause full scans, increasing latency as data grows.

Why this answer

As the database size grows, Firestore's query performance can degrade if queries rely on automatic index scanning without composite indexes. Composite indexes allow Firestore to serve queries without scanning all documents, reducing read latency. The unchanged read count but increased latency indicates that queries are scanning more data due to missing indexes.

Exam trap

Google Cloud often tests the misconception that database growth always requires scaling or replication, when in fact the root cause is often missing composite indexes that force full scans, especially in Firestore's automatic indexing model.

How to eliminate wrong answers

Option A is wrong because multi-region replication improves availability and latency for global reads, but the database is single-location (us-central1) and read count hasn't changed; the issue is query efficiency, not geographic distribution. Option B is wrong because Firestore is a NoSQL document database that does not require defragmentation or compaction; such operations are for traditional relational databases or storage engines like LevelDB. Option C is wrong because Datastore mode is a legacy mode with different consistency and scaling characteristics; migrating would not resolve latency caused by missing composite indexes and could introduce compatibility issues.

348
MCQeasy

A startup is building a BI stack on Google Cloud. They have moderate data volumes and need to run ad-hoc analytical queries and real-time dashboards. Which Google Cloud database service is most appropriate for this workload?

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

BigQuery is purpose-built for analytical queries and BI.

Why this answer

BigQuery is a serverless, highly scalable data warehouse designed for analytical queries and real-time dashboards. It supports ad-hoc SQL queries on large datasets with fast execution via its columnar storage and distributed query engine, making it ideal for BI workloads with moderate data volumes.

Exam trap

The trap here is confusing transactional databases (Cloud Spanner, Cloud SQL) or NoSQL databases (Firestore) with analytical data warehouses, leading candidates to pick a familiar OLTP service instead of recognizing BigQuery's specific suitability for ad-hoc analytics and BI dashboards.

How to eliminate wrong answers

Option B is wrong because Cloud Spanner is a globally distributed, strongly consistent relational database optimized for transactional (OLTP) workloads, not ad-hoc analytical queries or real-time dashboards. Option C is wrong because Firestore is a NoSQL document database designed for mobile and web app real-time synchronization, not for complex analytical SQL queries or BI dashboards. Option D is wrong because Cloud SQL is a managed relational database for traditional OLTP workloads (e.g., MySQL, PostgreSQL) and lacks the columnar storage and massive parallelism needed for efficient ad-hoc analytics on moderate data volumes.

349
MCQeasy

A startup is using Cloud SQL for PostgreSQL and wants to minimize downtime during maintenance. The application can tolerate a few minutes of read-only mode. Which configuration should they use?

A.Use a read replica and promote it during maintenance.
B.Enable automatic storage increase.
C.Configure a high availability (HA) instance with regional failover.
D.Schedule maintenance during off-peak hours only.
AnswerA

This allows reads to continue and writes to be redirected with minimal disruption.

Why this answer

Using a read replica and promoting it during maintenance allows the application to switch to a read-write capable instance with minimal downtime. The application can tolerate a few minutes of read-only mode, so the brief period when the replica is promoted and the original primary is unavailable is acceptable. This approach avoids the longer downtime associated with other methods like HA failover or simply waiting for maintenance to complete.

Exam trap

The trap here is that candidates often confuse high availability (HA) failover with read replica promotion, assuming HA provides zero downtime, but HA still incurs a brief failover delay and does not allow the application to remain in read-only mode during maintenance.

How to eliminate wrong answers

Option B is wrong because automatic storage increase only prevents out-of-disk errors, not downtime during maintenance; it does not provide any mechanism to switch traffic away from the instance being maintained. Option C is wrong because configuring a high availability (HA) instance with regional failover still requires a brief period of downtime during the failover process, and the application's tolerance for read-only mode is better served by a read replica that can be promoted independently. Option D is wrong because scheduling maintenance during off-peak hours only reduces the impact of downtime but does not eliminate it; the application still experiences downtime during the maintenance window, which the read replica approach avoids.

350
Multi-Selectmedium

A company is using Cloud SQL for PostgreSQL and needs to perform a disaster recovery drill by promoting a read replica to a standalone instance. They also need to ensure the replica is as current as possible before promotion. Which TWO steps should they take? (Choose two.)

Select 2 answers
A.Promote the replica using gcloud sql instances promote-replica
B.Enable binary logging on the replica
C.Check the replication_lag metric on the replica to confirm it is within acceptable range
D.Create an on-demand backup of the primary before promotion
E.Force a failover to the replica
AnswersA, C

Promotion converts the read replica into a standalone instance.

Why this answer

`gcloud sql instances promote-replica` is the standard command to promote a Cloud SQL read replica to a standalone instance, making it a primary that can accept writes. Option C is correct because checking the `replication_lag` metric ensures the replica has applied all pending changes from the primary before promotion, minimizing data loss. This step is critical because promoting a replica that is behind can result in lost transactions.

Exam trap

The trap here is that candidates confuse promoting a read replica with performing a failover in a Cloud SQL high-availability cluster, leading them to select 'Force a failover to the replica' instead of the correct promotion command using 'gcloud sql instances promote-replica'.

351
Multi-Selectmedium

An engineer is tuning Cloud Spanner performance for a database that experiences high read latency on parent-child queries. The database schema uses a table for Users and a table for Orders with a foreign key on user_id. The Orders table has a secondary index on order_date. Which TWO actions can improve query performance? (Choose TWO)

Select 2 answers
A.Increase the number of Spanner nodes to reduce read latency
B.Use the INTERLEAVE IN PARENT clause when creating the secondary index on order_date
C.Add a secondary index on user_id in the Orders table
D.Run a query explain plan to identify bottlenecks
E.Define Orders as an interleaved table within Users
AnswersB, E

This stores the index data in the same split as the base table, reducing latency for queries using that index.

Why this answer

Interleaving the Orders table in the Users table stores rows from both tables together on the same split, making parent-child joins much faster. Using INTERLEAVE IN PARENT for the secondary index on order_date stores the index data together with the base table, reducing lookup overhead. Adding a secondary index on user_id is unnecessary if Orders is interleaved in Users.

Query explain plan is diagnostic, not a direct performance improvement. Increasing nodes increases throughput but not latency for individual queries.

352
Multi-Selecteasy

Which TWO statements correctly describe characteristics of toil in SRE? (Choose 2 answers)

Select 2 answers
A.Toil is always automatable.
B.Toil is repetitive and manually performed.
C.Toil decreases as the service scales.
D.Toil adds enduring value to the service.
E.Toil provides no enduring value.
AnswersB, E

Manual and repetitive are key traits of toil.

Why this answer

Toil in SRE is defined as manual, repetitive work that does not produce enduring value. As a service scales, toil typically increases rather than decreases. Option B correctly identifies toil as repetitive and manually performed.

Option E correctly states that toil provides no enduring value. Option A is incorrect because toil is not always automatable; some toil may be difficult or impractical to automate. Option C is incorrect because toil scales with service growth, not decreases.

Option D is incorrect because toil does not add enduring value; that is a characteristic of engineering work.

353
MCQmedium

You need to set up a notification channel for alerts that sends messages to a custom internal incident management system via a webhook. Which notification channel type should you use?

A.PagerDuty
B.Cloud Pub/Sub
C.Email
D.SMS
AnswerB

Pub/Sub can be used to trigger a webhook via a subscriber.

Why this answer

Cloud Monitoring supports webhooks via Pub/Sub. You can create a Cloud Pub/Sub notification channel and subscribe with a webhook endpoint. Other channels like email, SMS, and PagerDuty are pre-defined but not customizable for webhooks.

354
MCQmedium

An SRE team uses PagerDuty for on-call rotation. They receive a critical alert at 2 AM. According to incident management best practices, what should the on-call engineer do first?

A.Ignore it until morning because it's off-hours
B.Start a postmortem immediately
C.Immediately escalate to the incident commander
D.Acknowledge the alert and begin triage according to the runbook
AnswerD

Acknowledging and following runbook procedures is the correct initial response.

Why this answer

The first step is to acknowledge the alert to signal that someone is responding, then assess severity and begin response per the runbook.

355
MCQmedium

A company has a Cloud SQL for PostgreSQL instance with a read replica in another region. They want to perform disaster recovery testing without affecting the primary. What should they do?

A.Promote the read replica to a standalone instance and use it for testing.
B.Use the replica as a failover target; testing is not allowed.
C.Enable point-in-time recovery on the replica and restore to a new instance.
D.Create a clone of the primary instance and test on that.
AnswerA

Promoting the replica makes it an independent instance, suitable for DR testing.

Why this answer

Promoting the read replica to a standalone instance detaches it from the primary, creating an independent writable Cloud SQL instance. This allows you to perform disaster recovery testing (e.g., failover validation, data integrity checks) without any impact on the primary instance, as the replica no longer replicates changes from the primary.

Exam trap

The trap here is that candidates assume read replicas are permanently read-only and cannot be used for testing, or they confuse promoting a replica with cloning the primary, which would impact the primary's performance.

How to eliminate wrong answers

Option B is wrong because Cloud SQL read replicas can be promoted to standalone instances for testing; there is no restriction that 'testing is not allowed' — the misconception is that replicas are read-only and cannot be used for write operations, but promotion makes them writable. Option C is wrong because point-in-time recovery (PITR) is a feature of the primary instance, not directly on a read replica; you cannot enable PITR on a replica and restore to a new instance — you would need to restore from the primary's backups or use the replica's data after promotion. Option D is wrong because creating a clone of the primary instance would require the primary to be online and could cause additional load or replication lag; the correct approach is to use the already-existing read replica to avoid any impact on the primary.

356
MCQmedium

An organization runs a Cloud SQL for MySQL instance for its e-commerce platform. During a load test, they notice the CPU utilization consistently exceeds 80% and queries are slowing down. The instance is using 2 vCPUs. The team needs to improve performance with minimal downtime. What should they do?

A.Increase the number of vCPUs and memory via vertical scaling
B.Create a cross-region read replica
C.Enable automatic storage increase
D.Shard the database using application-level sharding
AnswerA

Vertical scaling adds more CPU and memory, directly addressing high CPU utilization. Cloud SQL supports this online.

Why this answer

Increasing vCPUs and memory vertically (scaling up) is the quickest way to improve CPU-bound performance with minimal downtime. Cloud SQL supports online vertical scaling. Read replicas are for read offloading, not CPU-bound write performance.

Auto-storage increase addresses storage, not CPU.

357
MCQhard

A team wants to create a log-based metric that counts ERROR log entries grouped by the service name extracted from a JSON field. The log entries are structured JSON with a 'service' key. Which type of log-based metric should they create?

A.Alerting policy with a condition on 'service' field
B.Gauge metric with the 'service' field as value
C.Counter metric with a label extracted from 'service' field
D.Distribution metric with a histogram of the 'service' field
AnswerC

Counter metrics count log entries matching a filter and can have labels extracted from log fields for grouping.

Why this answer

To count log entries and group by a label, a counter metric is appropriate. Distribution metrics are for histograms of numeric values, not counting.

358
MCQmedium

You have a Cloud Monitoring alerting policy that triggers when CPU usage exceeds 80% for 5 minutes. You want to add documentation to the alert that includes a link to a runbook and labels indicating the affected service. How can you achieve this?

A.Create a separate Cloud Storage bucket and reference it in the alert.
B.Use Cloud Logging to store runbook URLs and attach them to alerts via log-based metrics.
C.Edit the alerting policy and add documentation with the runbook URL and labels under the 'Documentation' section.
D.Use Cloud Monitoring's notification channel to include a link in the email body.
AnswerC

Alert policy documentation supports markdown and labels can be added to the policy.

Why this answer

Cloud Monitoring alerting policies support documentation fields where you can provide markdown text including links and labels. This is done when creating or editing the policy in the console or via API. Labels can be attached to the alert policy to help with filtering and routing.

359
MCQeasy

A DevOps engineer wants to create an alerting policy that fires when the 99th percentile of request latency exceeds 2000 ms for any 5-minute window. Which metric type and aggregation should they use?

A.Use a GAUGE metric with reducer MAX
B.Use a CUMULATIVE metric with reducer DELTA
C.Use a distribution metric with reducer 99th percentile
D.Use a DELTA metric with reducer COUNT
AnswerC

Distribution metrics support percentiles. Reducer set to 99th percentile yields the desired value.

Why this answer

The 99th percentile is a distribution metric. Cloud Monitoring supports distribution metrics and can compute percentiles. The correct approach is to use a metric of type distribution with reducer set to 99th percentile.

360
MCQhard

A team is migrating an on-premises PostgreSQL 13 database to AlloyDB using DMS continuous migration. During the CDC phase, the migration job shows an error: 'ERROR: could not start WAL streaming: ERROR: replication slots are not enabled on the source.' The source is running in Google Cloud Compute Engine. What is the most likely cause?

A.The DMS connection profile uses the wrong public IP.
B.The source database is in read-only mode.
C.The source database does not have the pglogical extension installed.
D.The source database parameter wal_level is set to 'replica' instead of 'logical'.
AnswerD

wal_level must be set to 'logical' to enable logical replication slots.

Why this answer

DMS continuous migration for PostgreSQL requires logical replication, which uses replication slots. The error indicates that the source database does not have the necessary configuration to support replication slots (wal_level=logical, max_replication_slots > 0).

361
MCQhard

A microservice running on Cloud Run is logging structured JSON payloads. You want to correlate logs with distributed traces using Cloud Trace. Which field should you include in the log entry to enable automatic correlation?

A.Set the 'labels' field with the trace ID
B.Set the 'httpRequest' field with a reference to the trace
C.Include the 'spanId' field with the span ID
D.Include the 'trace' field with the full trace URL
AnswerD

The trace field in the LogEntry is used to associate logs with traces.

Why this answer

The 'trace' field in the structured log entry should be set to the trace ID in the format 'projects/PROJECT_ID/traces/TRACE_ID'. This enables Cloud Logging to link logs to traces. The 'spanId' field is for span ID, but the trace field is required for correlation.

362
MCQmedium

A data analyst reports that a BI dashboard query on BigQuery is taking over 30 seconds to execute. The table is partitioned by date and clustered by customer_id. The query filters on a specific date range and aggregates sales by customer. What is the most likely cause of the slow performance?

A.The query does not include a filter on the clustering column, so clustering provides no benefit.
B.The query uses a LEFT JOIN that requires a broadcast join, increasing network overhead.
C.The query filters on a date column that is not the partition column, causing a full table scan.
D.The table does not have a primary key, so BigQuery cannot use index scans.
AnswerC

Partition pruning only works when the filter is on the partition column; otherwise, all partitions are scanned.

Why this answer

The query is slow due to filtering on a date column that is not the partition column. Even though the table is partitioned by date, if the WHERE clause uses a different date column, BigQuery cannot perform partition pruning and must scan all partitions, leading to high latency. Option A is incorrect because the main issue is partition pruning, not clustering benefits.

Option B is incorrect as no join is mentioned in the question. Option D is incorrect because BigQuery does not use primary keys or indexes.

Exam trap

The trap is assuming that any date filter triggers partition pruning. In BigQuery, only filters on the partition column enable pruning. If the date column in the filter is not the partition column, a full table scan occurs despite partitioning being defined on another date column.

How to eliminate wrong answers

Option A is wrong because clustering provides benefits only when the query filters on the clustering column; without a filter on customer_id, BigQuery cannot prune clusters, but the query still benefits from partition pruning on date, so the primary performance issue is not clustering. Option B is wrong because the question does not mention any JOIN operation, and a broadcast join would only occur if a large table is joined with a small table, which is not indicated in the scenario. Option D is wrong because BigQuery does not use indexes or primary keys; it uses columnar storage and partitioning/clustering for performance, so the absence of a primary key is irrelevant.

363
Multi-Selecthard

A Cloud Spanner database has a table with a primary key (UserId, Timestamp). Queries that filter by Timestamp range for a specific UserId are fast, but queries that filter only by Timestamp range across all users are slow. Which TWO improvements would help?

Select 2 answers
A.Use a leading column of the primary key that supports range scans.
B.Use a hash prefix on UserId.
C.Create an interleaved table structure.
D.Add a secondary index on Timestamp.
E.Partition the table by Timestamp.
AnswersA, D

Redesigning the primary key with Timestamp as the first column allows efficient range scans across users.

Why this answer

In Cloud Spanner, the primary key order determines how data is physically sorted and stored. By making Timestamp the leading column of the primary key (e.g., (Timestamp, UserId)), range scans on Timestamp become efficient as Spanner can perform a contiguous scan of the sorted data. This directly addresses the slow queries that filter only by Timestamp range across all users.

Exam trap

Google Cloud often tests the misconception that adding a secondary index is always the best solution, but here both a leading key column change and a secondary index are valid; the trap is that candidates might think partitioning (Option E) is supported in Spanner when it is not.

364
MCQhard

A company runs a critical application on Cloud SQL for MySQL with an HA configuration. They want to test their disaster recovery plan without affecting production. They need to validate that a cross-region read replica can be promoted successfully in the event of a regional outage. Which approach should they take?

A.Promote the cross-region read replica to a standalone instance, then re-create the replica after testing
B.Use point-in-time recovery to restore the primary to a new instance in the secondary region
C.Create a new read replica in the secondary region and promote that
D.Create a clone of the cross-region read replica and promote the clone
AnswerD

Cloning creates an independent copy that can be promoted without affecting the original replica or primary.

Why this answer

To test DR without affecting production, you can promote a cross-region read replica to a standalone instance for testing. However, promoting a read replica stops replication and makes it a writable instance. To avoid impacting production, you should create a clone of the cross-region read replica and promote the clone.

Alternatively, you can create a snapshot of the replica and restore to a new instance. The safest way is to create a clone from the replica and promote the clone.

365
MCQeasy

A financial services company is migrating a legacy on-premises OLTP application to Google Cloud. The application requires high transaction rates (thousands per second), strict ACID compliance, and the ability to scale horizontally across multiple regions with strong consistency. Which Google Cloud database service should the company choose?

A.Bigtable
B.Cloud SQL for PostgreSQL
C.Firestore
D.Cloud Spanner
AnswerD

Spanner provides global distribution, strong consistency, ACID transactions, and horizontal scaling, meeting all OLTP requirements.

Why this answer

Cloud Spanner is a globally distributed, horizontally scalable relational database service that provides ACID transactions and strong consistency across regions. It is ideal for OLTP workloads that require high throughput, consistency, and global scalability.

366
Multi-Selecthard

A team is conducting a blameless postmortem after a production incident. Which three actions are part of an effective blameless postmortem process? (Choose 3)

Select 3 answers
A.Define action items with specific owners and due dates
B.Identify contributing factors using the 5 Whys technique
C.Assign blame to the individual who made the error
D.Punish the on-call engineer for missing the alert
E.Focus on the system and process failures, not individuals
AnswersA, B, E

Action items ensure follow-through on improvements.

Why this answer

Blameless postmortems focus on identifying contributing factors, using techniques like 5 Whys, and defining action items with owners. Assigning blame, punishing, or ignoring minor factors are not part of the process.

367
MCQmedium

A team uses Cloud Build to build a container image using Kaniko. They want to cache layers to speed up subsequent builds. What should they configure in their cloudbuild.yaml to enable Kaniko layer caching?

A.Use Docker layer caching with docker build --cache-from
B.Set substitution variable _KANIKO_CACHE=true
C.Enable Cloud Build cache via the caching service
D.Set --cache=true and specify --cache-repo in the Kaniko builder step
AnswerD

Kaniko caching is enabled by passing --cache=true and --cache-repo to point to a remote repository.

Why this answer

Kaniko does not rely on Docker's layer caching mechanism. Instead, it uses its own remote caching system where layers are pushed to a container registry. To enable this, you must pass `--cache=true` to the Kaniko builder to instruct it to cache intermediate layers, and `--cache-repo` to specify the target repository (e.g., a registry path) where those cached layers will be stored.

This allows subsequent builds to reuse previously built layers, significantly reducing build time.

Exam trap

The trap here is that candidates confuse Cloud Build's generic caching service (which caches build artifacts like Maven dependencies) with Kaniko's specific layer caching mechanism, leading them to select Option C, or they mistakenly assume Docker's `--cache-from` works with Kaniko (Option A), not realizing Kaniko is a daemonless builder.

How to eliminate wrong answers

Option A is wrong because `docker build --cache-from` is a Docker-specific caching mechanism that relies on the Docker daemon, which Kaniko does not use; Kaniko runs entirely in userspace without a Docker daemon. Option B is wrong because `_KANIKO_CACHE` is not a recognized substitution variable in Cloud Build; Kaniko caching is controlled via builder arguments (`--cache`), not environment variables or substitutions. Option C is wrong because Cloud Build's caching service is designed for storing build artifacts (e.g., Maven/Gradle dependencies) and is not integrated with Kaniko's layer caching; Kaniko requires its own `--cache-repo` to store layers in a container registry.

368
MCQeasy

A data analyst needs to create a reporting table that aggregates sales data by month. They want to ensure the table is optimized for querying by month and product category. Which table design best supports this?

A.Use a table with clustering on product_category only.
B.Use a flat table with no partitioning.
C.Use a view that selects month and product_category.
D.Partition by month and cluster by product_category.
AnswerD

Partitioning prunes months; clustering filters categories.

Why this answer

Partitioning by month physically separates data into monthly segments, allowing query pruning to skip irrelevant partitions when filtering by month. Clustering by product_category within each partition co-locates rows with the same category, reducing the amount of data scanned for queries that filter on both month and category. This design optimizes both I/O and scan efficiency for the described workload.

Exam trap

The trap here is that candidates often confuse a view with a materialized view or assume that any SQL object can improve performance without physical data reorganization, leading them to select Option C despite views having no storage or indexing capabilities.

How to eliminate wrong answers

Option A is wrong because clustering only on product_category without partitioning does not provide the month-level data isolation needed for efficient monthly queries; all months remain in the same storage unit, forcing full scans for any month filter. Option B is wrong because a flat table with no partitioning or clustering offers no data skipping or pruning, leading to full table scans on every query, which is highly inefficient for aggregated reporting. Option C is wrong because a view is just a stored query definition and does not physically reorganize or partition data; it cannot improve query performance on its own and still requires scanning the underlying table.

369
MCQmedium

Refer to the exhibit. A developer creates these tables and notices that queries joining Users and Orders on UserId are slow. What is the most likely cause?

A.The primary key of Orders should include UserId as a prefix for co-location.
B.The foreign key constraint is missing, causing full table scans.
C.Tables are not interleaved, so parent and child rows may be in different splits.
D.The foreign key reference should be on the parent table.
AnswerC

Interleaving is required to guarantee co-location. Without it, joins may be distributed.

Why this answer

In Google Cloud Spanner, interleaving tables physically co-locates parent and child rows in the same tablet split, reducing cross-node lookups. Without interleaving, rows from Users and Orders may reside on different servers, causing distributed queries that are slower due to network round trips. Option C correctly identifies this as the most likely cause of slow joins.

Exam trap

Google often tests the misconception that foreign keys or primary key ordering alone solve performance issues, when in Cloud Spanner the key optimization is interleaving for co-location.

How to eliminate wrong answers

Option A is wrong because the primary key of Orders should not include UserId as a prefix for co-location; CockroachDB uses interleaving, not composite primary key ordering, to achieve co-location. Option B is wrong because foreign key constraints do not prevent full table scans; they enforce referential integrity but do not affect query performance or index usage. Option D is wrong because foreign key references are correctly placed on the child table (Orders) to reference the parent (Users); placing them on the parent would be syntactically incorrect and meaningless.

370
MCQmedium

A team wants to implement chaos engineering on Google Kubernetes Engine (GKE) to test resilience against pod failures. Which tool is designed for injecting faults into GKE clusters?

A.GKE Node Auto-Repair
B.Traffic Director fault injection
C.Chaos Mesh on GKE
D.Cloud Armor
AnswerC

Chaos Mesh is specifically designed for chaos engineering on Kubernetes.

Why this answer

Chaos Mesh is an open-source chaos engineering platform for Kubernetes, including GKE. It can inject pod failures, network delays, etc. Traffic Director fault injection is for service mesh, not GKE-native.

371
MCQmedium

A user runs the query above on a large table and receives an out-of-memory error. What is the most likely cause?

A.The table is a materialized view that cannot handle ORDER BY
B.The query uses COUNT(*) without a GROUP BY
C.The ORDER BY clause forces sorting of the entire dataset in memory on a single worker
D.The table is not partitioned, so full table scan causes memory overflow
AnswerC

Sorting large datasets requires memory proportional to the data size; if it exceeds available memory, the query fails.

Why this answer

The ORDER BY clause in a distributed SQL engine like Snowflake or BigQuery forces all data to be sent to a single worker node for sorting, which can exceed the memory limit of that node when the dataset is large. This is a common cause of out-of-memory errors in MPP (Massively Parallel Processing) systems, as sorting is not a distributable operation by default without explicit partitioning or window functions.

Exam trap

Google Cloud often tests the misconception that any full table scan causes memory errors, but the real trap is that ORDER BY is a blocking operation that centralizes data, making it the primary culprit for out-of-memory errors in distributed systems.

How to eliminate wrong answers

Option A is wrong because materialized views can handle ORDER BY; the error is not related to materialized view limitations but to the sorting operation itself. Option B is wrong because COUNT(*) without GROUP BY returns a single scalar value, which does not cause memory overflow; it is an aggregation that can be computed in parallel without sorting. Option D is wrong because while a full table scan can be resource-intensive, it does not inherently cause out-of-memory errors; the memory overflow is specifically triggered by the ORDER BY clause forcing a single-node sort, not by the scan itself.

372
MCQmedium

A company is migrating a large on-premise Hadoop workload to Google Cloud. The data is stored in HBase and consists of time-series logs with 10 PB of data. They need a fully managed NoSQL solution with high throughput and low latency. Which migration path should they choose?

A.Migrate HBase tables to Cloud Spanner using Dataflow
B.Export data to BigQuery using Storage Transfer Service
C.Re-architect as Firestore collections
D.Use Cloud Bigtable and the HBase client
AnswerD

Bigtable supports HBase client via the Bigtable HBase client, allowing a smooth migration.

Why this answer

Cloud Bigtable is the fully managed, scalable NoSQL database that is compatible with HBase API, making migration straightforward. Cloud Spanner is relational, not the best for time-series logs. BigQuery is for analytics, not real-time.

Firestore is document-based and not suited for petabyte-scale logs.

373
MCQmedium

A company is designing a Cloud Spanner database for a global financial application. They need to minimize latency for customer queries while handling write-heavy workloads. The current design uses a single-region instance in us-central1. Which approach should they take to reduce latency for users in Europe?

A.Reconfigure the instance to a multi-region configuration with default leader in us-central1.
B.Reconfigure the instance to a multi-region configuration with default leader in europe-west1.
C.Add a read-only regional replica in europe-west1.
D.Increase the number of nodes to improve throughput and automatically reduce latency.
AnswerB

Multi-region configuration places a leader in Europe, reducing write and strong read latency for European users.

Why this answer

To reduce latency for users in Europe, the database must have a write-capable replica close to them. A multi-region configuration with the default leader in europe-west1 ensures that writes are committed in Europe, minimizing write latency for European users. Read-only replicas (Option C) cannot handle writes, so they do not reduce write latency.

Exam trap

Google Cloud often tests the misconception that adding read replicas or increasing nodes can reduce write latency in Cloud Spanner. In reality, only moving the default leader to the region where writes originate minimizes write latency for that region.

How to eliminate wrong answers

Option A is wrong because keeping the default leader in us-central1 means writes are still committed in the US, so European users would experience high write latency. Option C is wrong because a read-only regional replica cannot accept writes; it only serves stale reads, so it does not reduce write latency for write-heavy workloads. Option D is wrong because increasing nodes improves throughput and read performance but does not change the geographic location of writes; it cannot reduce latency for users far from the leader region.

374
MCQmedium

An engineer needs to troubleshoot a performance issue where a specific function in a Go application is consuming excessive CPU. They want to identify the exact lines of code causing the bottleneck with minimal overhead. Which Google Cloud tool should they use?

A.Error Reporting
B.Cloud Profiler
C.Cloud Monitoring
D.Cloud Trace
AnswerB

Cloud Profiler is designed for low-overhead CPU profiling and flame graph visualization.

Why this answer

Cloud Profiler continuously profiles CPU, heap, and other resources with very low overhead (~0.5%). It provides flame graphs that show which functions consume the most CPU, helping identify hot functions. Error Reporting focuses on errors, Cloud Trace on latency, and Cloud Monitoring on metrics.

375
MCQhard

An application is emitting structured JSON logs that include a 'request_id' field used for correlation. The team wants to enable log correlation with Cloud Trace so they can navigate from a log entry to its trace. What must they include in the log entry?

A.The trace ID in a field named 'trace' in the JSON payload
B.A logging label with key 'trace' and value set to the trace ID
C.The span ID in a field named 'span'
D.The request ID in a field named 'request_id'
AnswerA

The 'trace' field in structured logs is used by Cloud Logging to link to Cloud Trace.

Why this answer

Cloud Logging automatically correlates logs with traces when the log entry contains the trace field with the correct format.

Page 4

Page 5 of 20

Page 6