Courseiva

Google Professional Cloud Database Engineer (PCDE) — Questions 526600

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

Page 7

Page 8 of 20

Page 9
526
Multi-Selecteasy

A data engineer is designing a BigQuery schema for a dataset that will be used for both ad-hoc analysis and scheduled dashboards. They want to optimize costs and performance. Which three strategies should they consider? (Choose three.)

Select 3 answers
A.Use wildcard tables with a suffix filter.
B.Store data in multiple tables per day.
C.Use partitioning on a date column for time-based queries.
D.Use materialized views for pre-aggregated results.
E.Cluster on columns frequently used in filters.
AnswersC, D, E

Partitioning prunes partitions not needed by the query, reducing cost.

Why this answer

Partitioning on a date column (Option C) is correct because BigQuery uses the date column to prune partitions during query execution, significantly reducing the amount of data scanned and thus lowering costs and improving performance for time-based queries. This is a core optimization for both ad-hoc analysis and scheduled dashboards that frequently filter by date ranges.

Exam trap

The Google Cloud exam often tests the misconception that wildcard tables or multiple tables per day are efficient for time-series data, but the correct approach is to use a single partitioned table to leverage BigQuery's native partition pruning and reduce management overhead.

527
MCQhard

An e-commerce company uses BigQuery for BI. They have a large orders table with columns: order_id, customer_id, order_date, amount, status. Queries frequently aggregate total amount by customer and month. The current table is not partitioned. Users complain about high costs. The table is 2 TB and grows by 50 GB daily. Which action reduces query costs most?

A.Partition the table by order_date and cluster by customer_id.
B.Use a wildcard table with daily shards.
C.Create a materialized view that aggregates by customer and month.
D.Set a maximum bytes billed limit on the project.
AnswerC

Materialized view stores the aggregation, converting queries to small scans of precomputed data.

Why this answer

A materialized view pre-aggregates the total amount by customer and month, eliminating the need to scan the full 2 TB table for every query. This drastically reduces the bytes processed per query, directly lowering BigQuery costs. Since the table grows by 50 GB daily, the materialized view incrementally updates, ensuring fresh results without reprocessing historical data.

Exam trap

Google Cloud often tests the misconception that partitioning alone solves all cost issues, but the trap here is that partitioning reduces scan for date-range queries, not for aggregation queries that span many partitions; a materialized view is the correct cost-reduction strategy for pre-aggregated results.

How to eliminate wrong answers

Option A is wrong because partitioning by order_date and clustering by customer_id reduces bytes scanned for date-range filters, but queries aggregating by customer and month still require scanning all partitions that match the month, which can be large. Option B is wrong because wildcard tables with daily shards require manual management and each query must union or scan multiple shards, leading to higher costs and complexity compared to a single partitioned table. Option D is wrong because setting a maximum bytes billed limit only caps costs but does not reduce the bytes processed; queries that exceed the limit will fail, not become cheaper.

528
Multi-Selectmedium

Your company is migrating a 2 TB SQL Server database to Cloud SQL. You need to choose a migration approach that minimizes downtime and supports ongoing changes. Which TWO options meet these requirements?

Select 2 answers
A.Use Database Migration Service with a source of SQL Server.
B.Export the database as a .bak file and restore to Cloud SQL.
C.Use BCP to export data and import via gcloud sql import.
D.Configure a linked server to Cloud SQL from on-premises and use data synchronization tools.
E.Migrate to Azure SQL Managed Instance first, then to Cloud SQL.
AnswersA, D

DMS supports SQL Server to Cloud SQL for SQL Server with continuous replication.

Why this answer

Database Migration Service (DMS) supports continuous change data capture (CDC) for SQL Server, enabling near-zero-downtime migrations by replicating ongoing changes from the source to Cloud SQL until cutover. This approach minimizes downtime and keeps the database synchronized during the migration window, meeting both requirements.

Exam trap

Google Cloud often tests the misconception that a full export/import (like .bak or BCP) can be performed with minimal downtime, but these methods require the source to be static, failing the 'ongoing changes' requirement.

529
MCQmedium

A team wants to create an SLO for a batch data pipeline that processes files hourly. They want to measure whether each batch completes successfully within the hour. Which type of SLI should they use?

A.Window-based SLI measuring good minutes over total minutes
B.Latency-based SLI measuring p99 of file processing time
C.Request-based SLI measuring good requests over total requests
D.Availability SLI based on successful API calls
AnswerA

Window-based SLIs are designed for batch or streaming pipelines where success is measured over time windows.

Why this answer

For batch or sliding window data, a window-based SLI is appropriate: it counts good minutes (or windows) where the pipeline succeeded within the time window, divided by total minutes. Request-based SLIs are for individual request/response pairs.

530
Multi-Selecthard

A company runs a financial analytics platform on BigQuery. They need to reduce query costs for frequent, predictable queries. Which three strategies can help? (Choose THREE.)

Select 3 answers
A.Use BI Engine to cache results of frequent queries.
B.Create materialized views for common aggregations.
C.Partition tables by ingestion time.
D.Cluster tables on frequently filtered columns.
E.Use DML statements to pre-aggregate data.
AnswersA, B, D

Correct: BI Engine caches results of frequent, predictable queries in memory, reducing slot consumption and storage scans.

Why this answer

BigQuery BI Engine provides an in-memory analysis service that caches results of frequent and predictable queries, reducing the need to scan data in BigQuery storage and thereby lowering query costs. By serving cached results directly from memory, BI Engine avoids repeated data processing and slot consumption for recurring queries.

Option B is correct because materialized views allow you to pre-compute and store the results of common aggregations. When you query a materialized view, BigQuery uses the pre-computed results instead of scanning the base tables, which reduces the amount of data processed and thus lowers query costs, especially for frequent, predictable aggregations.

Option D is correct because clustering tables on frequently filtered columns can significantly reduce the amount of data scanned by queries that filter on those columns. By organizing data based on the clustering columns, BigQuery can efficiently prune partitions and only scan relevant blocks. This reduces the bytes billed for each query, leading to cost savings for frequent, predictable queries with filtering predicates.

Option C is incorrect because partitioning by ingestion time is primarily used for managing data lifecycle and improving query performance on time-based ranges, but it does not directly address cost reduction for frequent, predictable queries. While it can reduce scanned data for time-range queries, it is not as targeted as the other strategies for predictable, repeated access patterns.

Option E is incorrect because using DML statements to pre-aggregate data would require additional processing and storage costs for the aggregated tables, and the queries against those tables would still incur costs. This approach does not inherently reduce query costs compared to using materialized views or BI Engine, and it adds complexity and maintenance overhead.

Exam trap

Candidates often confuse cost-reduction techniques that directly cache or precompute results (BI Engine, materialized views) with performance optimizations that also reduce scanned data (clustering). Here, clustering is correct because it reduces bytes billed for frequent filters, but partitioning by ingestion time is less effective for predictable queries unless they always filter on that timestamp.

531
MCQmedium

A Cloud Bigtable instance is experiencing high read latency. The team suspects hot spotting on a single node. Which tool should they use to identify the hotspot?

A.Cloud Logging to review request logs
B.Key Visualizer
C.Bigtable Admin API to list tables
D.Cloud Monitoring (Stackdriver) to check CPU utilization
AnswerB

Key Visualizer provides heatmaps of reads/writes to detect hot spots.

Why this answer

Key Visualizer is the correct tool because it is specifically designed to analyze access patterns in Cloud Bigtable and identify hot spotting—where a small range of row keys receives a disproportionate amount of traffic. It visualizes read and write heatmaps across row key space and time, allowing teams to pinpoint the exact keys causing the hotspot. Unlike general-purpose monitoring tools, Key Visualizer provides row-key-level granularity essential for diagnosing hot spotting.

Exam trap

The exam often tests the distinction between general-purpose monitoring tools (Cloud Monitoring, Cloud Logging) and purpose-built diagnostic tools (Key Visualizer), trapping candidates who assume any monitoring tool can identify row-key-level hotspots.

How to eliminate wrong answers

Option A is wrong because Cloud Logging captures request logs at the instance level, but it does not provide row-key-level heatmaps or access pattern analysis needed to identify hot spotting; it is useful for debugging errors, not visualizing key distribution. Option C is wrong because the Bigtable Admin API is used for administrative operations like creating, listing, or deleting tables and clusters, not for monitoring real-time access patterns or detecting hotspots. Option D is wrong because Cloud Monitoring (Stackdriver) can show CPU utilization metrics, which may indicate overall load but cannot reveal which specific row keys are causing the hotspot; high CPU could be due to many factors unrelated to key distribution.

532
MCQeasy

A company is building a real-time leaderboard for a mobile game using Google Cloud. The data includes player scores that update frequently (thousands of writes per second) and queries for top 100 players. Which database is most suitable?

A.BigQuery
B.Cloud Bigtable
C.Cloud Firestore
D.Cloud SQL (PostgreSQL)
AnswerB

Bigtable can handle high write volumes and read the top 100 rows efficiently via a prefix scan.

Why this answer

Cloud Bigtable is a good fit for high write throughput and simple range scans (e.g., scanning top scores). Firestore has limited write capacity. Cloud SQL cannot handle thousands of writes per second.

Spanner can but is overkill and more expensive.

533
Multi-Selectmedium

An SRE team is designing an incident management process. Which TWO components are part of a typical incident command structure?

Select 2 answers
A.Incident Commander
B.Developer
C.On-call engineer
D.Communications Lead
E.Product Manager
AnswersA, D

The Incident Commander directs all response activities.

Why this answer

The incident command structure includes an Incident Commander (overall lead) and a Communications Lead (liaison for stakeholders). The SRE lead may be Incident Commander. Developer is a generic role; on-call engineer is a role but not part of the command structure per se.

534
MCQeasy

You are designing a Spanner schema for a global social media application that stores user posts. Each user can have millions of posts. The most common query is 'get the most recent 10 posts for a user'. Which table interleaving design minimizes latency?

A.Interleave the Posts table under the Users table, with user_id as parent key and post_timestamp as the child ordering key.
B.Use a secondary index on user_id in the Posts table.
C.Create a single table with user_id and post_timestamp as a composite primary key.
D.Store posts in a separate Cloud Bigtable table and use the user_id as part of the row key.
AnswerA

Interleaving ensures all posts of a user are stored together, enabling fast retrieval.

Why this answer

Interleaving the Posts table under the Users table in Spanner ensures that all posts for a given user are stored in the same split, co-located on the same tablet server. This allows the query for the most recent 10 posts to be served with a single, local range scan on the interleaved child table, using post_timestamp as the descending ordering key, minimizing cross-node communication and latency.

Exam trap

Google Cloud often tests the misconception that a secondary index or composite primary key alone provides the same performance as interleaving, but they fail to guarantee physical co-location, which is critical for minimizing latency in globally distributed databases.

How to eliminate wrong answers

Option B is wrong because a secondary index on user_id would require an index lookup followed by a back-join to the base table, adding an extra round-trip and potentially scattering the posts across splits, increasing latency. Option C is wrong because a single table with a composite primary key (user_id, post_timestamp) does not guarantee co-location of a user's posts; without interleaving, Spanner may distribute rows across splits, causing cross-split reads. Option D is wrong because Cloud Bigtable is a different database service with a different consistency model and API; using it would require cross-service calls and introduce additional latency, and it does not benefit from Spanner's interleaving optimization.

535
MCQmedium

An engineer is migrating a MySQL database to Cloud SQL using DMS. The source database uses MyISAM tables. During the migration, the full dump phase fails with a timeout. What should the engineer do to increase the likelihood of success?

A.Add the --single-transaction flag to the mysqldump command.
B.Increase the DMS migration job timeout.
C.Use --skip-lock-tables to avoid locking.
D.Convert the MyISAM tables to InnoDB before migration.
AnswerD

InnoDB supports transactional dump with less locking.

Why this answer

MyISAM tables require table-level locking during dump. Using --single-transaction is only for InnoDB. To reduce lock contention, the engineer should schedule the migration during low-traffic periods or convert MyISAM to InnoDB before migration.

536
MCQhard

You are designing a Cloud Spanner schema for a global social media application. The application reads the most recent 100 posts for a user's timeline. The Posts table has a primary key of (UserId, PostTimestamp DESC). You observe that queries for the timeline are hitting high read latency and the transaction abort rate is increasing. What is the most likely cause?

A.The descending timestamp in the primary key is causing hotspotting on the tablet leader for the most recent data.
B.The instance has too few nodes to handle the write volume.
C.The lack of a secondary index on UserId is forcing full table scans.
D.The table should be interleaved under a Users table.
AnswerA

Frequent inserts to the same split (latest timestamp) cause contention.

Why this answer

The descending timestamp in the primary key causes all writes for the most recent posts to be concentrated on the same tablet leader, because Cloud Spanner uses the first primary key column for splitting and distributing data. This hotspotting leads to high read latency and increased transaction abort rates as the single leader becomes overloaded with both writes and reads for the latest data.

Exam trap

Google Cloud often tests the misconception that adding more nodes or secondary indexes solves all performance problems, when in fact the root cause is often a poorly designed primary key that creates hotspotting in Cloud Spanner's distributed architecture.

How to eliminate wrong answers

Option B is wrong because while insufficient nodes can cause performance issues, the specific symptom of high read latency combined with increasing transaction abort rates points to hotspotting from the primary key design, not a general capacity problem. Option C is wrong because the primary key already includes UserId as the first column, so queries filtering by UserId can use the primary key directly without needing a secondary index. Option D is wrong because interleaving the Posts table under a Users table would not solve the hotspotting issue caused by the descending timestamp; it would actually exacerbate the problem by colocating all posts for a user on the same split.

537
MCQmedium

An e-commerce platform runs on Cloud SQL and expects heavy write traffic during a flash sale. The database instance currently has 8 vCPUs and 32 GB RAM. Based on the max_connections formula (max_connections = RAM_MB/16), what is the current maximum number of connections, and what change would increase it?

A.2048 connections; increase vCPU to 16
B.4096 connections; increase vCPU to 16
C.2048 connections; increase RAM to 64 GB
D.4096 connections; increase RAM to 64 GB
AnswerC

64 GB = 65536 MB, max_connections = 4096.

Why this answer

With 32 GB = 32768 MB, max_connections = 32768/16 = 2048. To increase connections, you need to increase RAM (e.g., 64 GB gives 4096). vCPU does not directly affect max_connections per the formula.

538
Multi-Selecthard

You are managing a Cloud SQL for MySQL instance that is experiencing high replication lag. The instance uses semi-synchronous replication. Which THREE actions could reduce the replication lag?

Select 3 answers
A.Change replication mode from semi-synchronous to asynchronous.
B.Reduce the binlog retention period on the primary.
C.Configure the replica to use parallel replication (slave_parallel_workers > 0).
D.Increase the machine type of the replica.
E.Enable binary log compression on the primary.
AnswersA, C, D

Async replication removes the acknowledgement wait, reducing lag.

Why this answer

Switching from semi-synchronous to asynchronous replication removes the requirement for the primary to wait for at least one replica to acknowledge receipt of each transaction. In semi-synchronous mode, the primary waits for acknowledgment, which can introduce latency and contribute to replication lag under high write loads. Asynchronous replication allows the primary to commit transactions immediately without waiting, reducing the time the primary spends waiting for replica acknowledgment and thus lowering replication lag.

Exam trap

Google Cloud often tests the misconception that reducing log retention or compressing logs directly reduces replication lag, when in fact these actions affect storage or network transfer, not the apply speed or acknowledgment delay that cause lag.

539
MCQmedium

An application uses Cloud Firestore. The team notices that queries on a collection with an array field are slow. They want to create an index on the array field. What should they do?

A.Create a collection group index on the field.
B.Create a composite index on the array field and another field.
C.Create an index exemption for the array field.
D.Rely on the automatically created single-field index.
AnswerB

Correct. A composite index that includes the array field is required to support array queries efficiently. This index enables the use of array-contains and other array-related operations.

Why this answer

Cloud Firestore does not support single-field indexes on array fields. To enable efficient queries involving array fields, you must create a composite index that includes the array field along with another field. This allows Firestore to use the composite index for array-contains queries and other array operations, improving query performance.

Exam trap

Google Cloud often tests the misconception that array fields cannot be included in composite indexes without special handling, but Firestore supports composite indexes containing array fields by default.

How to eliminate wrong answers

Option A is wrong because a collection group index is used for queries that span multiple collections with the same name, not for indexing array fields. Option B is wrong because composite indexes in Firestore cannot include an array field as part of the index; array fields are only indexed for equality queries using the automatic array index. Option D is wrong because Firestore does not automatically create single-field indexes for array fields; it only creates an automatic array index for equality queries, which may not be sufficient for performance optimization.

540
MCQhard

A team uses Cloud Monitoring SLO monitoring with a request-based SLI for availability. They define good requests as those returning HTTP 200. Which configuration correctly creates this SLO?

A.good-request-count = requests with latency < 500ms, valid-request-count = total requests
B.good-request-count = total requests, valid-request-count = successful requests
C.good-request-count = 200 responses, valid-request-count = 400+500 responses
D.good-request-count = successful requests, valid-request-count = total requests
AnswerD

Correct definition.

Why this answer

For request-based SLO, define good-request-count as the number of successful requests and valid-request-count as total requests. Cloud Monitoring uses these metrics.

541
MCQeasy

A database engineer is reviewing the configuration of a Cloud SQL for MySQL instance. The backup configuration shows binaryLogEnabled and pointInTimeRecoveryEnabled set to true. However, the engineer is unable to perform a point-in-time recovery (PITR) to a specific second within the last 30 days. What is the most likely reason?

A.Binary logging is not enabled for all databases on the instance.
B.The transaction log retention period is not set, defaulting to 7 days, so logs older than that are purged.
C.The instance is not in a runnable state.
D.The database version is MySQL 8.0, which does not support PITR.
AnswerB

PITR requires transaction logs to be retained for the desired recovery window; the default is 7 days.

Why this answer

By default, Cloud SQL for MySQL sets the transaction log retention period to 7 days when binary logging and point-in-time recovery are enabled. This means that binary logs older than 7 days are automatically purged, making it impossible to perform a PITR to a specific second beyond that window, even if the backup retention is set to 30 days. To recover to any point within the last 30 days, the transaction log retention period must be explicitly configured to match the backup retention period.

Exam trap

Google Cloud often tests the misconception that enabling binary logging and point-in-time recovery automatically allows recovery to any point within the backup retention period, ignoring the separate transaction log retention default of 7 days.

How to eliminate wrong answers

Option A is wrong because binary logging in Cloud SQL for MySQL is enabled at the instance level, not per database, and when binaryLogEnabled is true, it applies to all databases on the instance. Option C is wrong because the instance being in a runnable state is not a prerequisite for performing a PITR; the recovery operation uses stored backups and transaction logs, and the instance can be restored from a non-runnable state. Option D is wrong because MySQL 8.0 fully supports point-in-time recovery; the limitation is not the database version but the transaction log retention period.

542
Multi-Selecthard

Which THREE are key principles of a blameless postmortem culture in SRE? (Choose 3)

Select 3 answers
A.Creating action items with owners and due dates
B.Ensuring incidents are never discussed outside the team
C.Identifying and documenting contributing factors
D.Assigning responsibility to individuals for errors
E.Focusing on systemic improvements rather than individual mistakes
AnswersA, C, E

Ensures follow-up.

Why this answer

Blameless postmortems focus on systemic improvements, not individual blame. They involve documenting contributing factors, creating action items with owners and dates, and fostering a culture of learning. Assigning blame is avoided.

543
MCQeasy

You are using Cloud Monitoring to track performance of a Cloud Spanner instance. Which metric indicates that a database is approaching its throughput limits and may need a split or additional nodes?

A.Storage utilization (bytes used)
B.Query error rate (errors per second)
C.High CPU utilization (percentage)
D.Average commit latency
AnswerC

CPU utilization above 65% suggests the instance is nearing its throughput limit.

Why this answer

High CPU utilization (percentage) is the correct metric because Cloud Spanner's CPU utilization directly reflects the processing load on the instance's nodes. When CPU utilization consistently exceeds 65-70%, it indicates the database is approaching its throughput limits, often requiring a split (to distribute load across more tablets) or additional nodes to maintain performance and avoid throttling.

Exam trap

Google Cloud often tests the misconception that storage utilization or latency metrics indicate throughput limits, but the correct answer is CPU utilization because it directly measures the processing capacity headroom in Cloud Spanner's node-based architecture.

How to eliminate wrong answers

Option A is wrong because storage utilization measures data volume, not throughput capacity; a database can have low storage but still hit throughput limits due to high read/write operations. Option B is wrong because query error rate indicates failures (e.g., due to deadlocks or timeouts), but it is a lagging indicator of throughput saturation, not a direct measure of approaching limits. Option D is wrong because average commit latency can increase due to many factors (e.g., network latency, contention) and is not a primary metric for throughput capacity; Spanner's key metric for node saturation is CPU utilization.

544
MCQeasy

A BI analyst needs to calculate a running total of sales by region over time in BigQuery. Which SQL window function should be used?

A.RANK() OVER (PARTITION BY region ORDER BY date)
B.SUM(sales) OVER (PARTITION BY region ORDER BY date)
C.ROW_NUMBER() OVER (PARTITION BY region ORDER BY date)
D.COUNT(sales) OVER (PARTITION BY region ORDER BY date)
AnswerB

This correctly computes a running total per region.

Why this answer

The SUM() window function with an ORDER BY clause in the OVER() clause computes a running total (cumulative sum) over the specified partition. In BigQuery, when you include ORDER BY inside a window function's OVER() clause, the default window frame is RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, which produces the running total for each region ordered by date.

Exam trap

Google Cloud often tests the distinction between aggregate functions (SUM, COUNT) and ranking functions (RANK, ROW_NUMBER) in window functions, and the trap here is that candidates confuse RANK() or ROW_NUMBER() with the ability to compute a running total, not realizing that only SUM() with an ORDER BY clause produces a cumulative sum.

How to eliminate wrong answers

Option A is wrong because RANK() assigns a rank to each row based on the ordering, not a running total of sales. Option C is wrong because ROW_NUMBER() assigns a sequential integer to each row, not a cumulative sum. Option D is wrong because COUNT(sales) counts the number of non-null sales values up to the current row, not the sum of sales.

545
MCQmedium

A company runs a Cloud Bigtable instance with SSD storage and wants to switch to HDD storage to reduce costs. The instance cannot tolerate downtime for data migration. What is the correct approach?

A.Create a new Cloud Bigtable cluster with HDD storage and migrate data
B.Increase the number of nodes to reduce per-node cost
C.Add a cross-region replica and then promote it with HDD storage
D.Use the gcloud bigtable clusters update command to change storage type
AnswerA

To change storage type, you must create a new cluster with the desired type and migrate the data.

Why this answer

Cloud Bigtable does not support in-place conversion of storage type from SSD to HDD. The only way to switch storage without downtime is to create a new cluster with HDD storage, then use a replicated setup (e.g., via a replication cluster or application-level dual-write) to migrate data while the original cluster remains operational. This ensures zero downtime during the migration.

Exam trap

The trap here is that candidates assume a simple update command or replica promotion can change storage type, but Cloud Bigtable does not allow in-place storage type changes or replication across different storage types, forcing a new cluster creation with data migration.

How to eliminate wrong answers

Option B is wrong because increasing the number of nodes does not change the storage type from SSD to HDD; it only scales throughput and capacity, not the underlying storage medium, so it does not reduce per-node cost in the context of switching to HDD. Option C is wrong because cross-region replication in Cloud Bigtable requires both clusters to use the same storage type (SSD or HDD); you cannot add a replica with a different storage type and then promote it, as replication is not supported across different storage types. Option D is wrong because the gcloud bigtable clusters update command does not support changing the storage type; it can only modify node count or other cluster settings, not the underlying storage medium.

546
MCQmedium

A company needs to migrate its on-premises Oracle database to a fully managed relational database on Google Cloud. The application uses stored procedures and requires high availability across multiple zones. Which migration path is MOST appropriate?

A.Use Database Migration Service to migrate to Cloud SQL for SQL Server
B.Use Bare Metal Solution to run Oracle Database on dedicated hardware
C.Migrate to AlloyDB for PostgreSQL with cross-region replication
D.Migrate to Cloud SQL for PostgreSQL and configure cross-zone high availability
AnswerD

Cloud SQL supports PostgreSQL, cross-zone HA, and fully managed. Stored procedures can be migrated with adaptation.

Why this answer

Cloud SQL for PostgreSQL supports high availability across zones and can use the PostgreSQL dialect with some migration effort. Bare Metal Solution is for lifting and shifting Oracle workloads but is not fully managed. AlloyDB is PostgreSQL-compatible and provides high availability.

The best option is Cloud SQL for PostgreSQL due to its managed nature and cross-zone HA.

547
MCQmedium

A retail company stores sales transactions in BigQuery. They want to create a materialized view that aggregates daily sales by product category, but they need the view to refresh automatically within 5 minutes of new data being inserted. The source table is partitioned by transaction_date and has a streaming buffer. What should they do to ensure the materialized view refreshes quickly enough?

A.Set max_staleness on the base table to 5 minutes.
B.Disable streaming inserts and use batch loads only.
C.Increase the streaming buffer size on the base table.
D.Set the materialized view's max_staleness interval to 5 minutes and allow relaxed consistency.
AnswerD

This allows the view to use base table storage for faster refresh, meeting the 5-minute requirement.

Why this answer

Setting the `max_staleness` interval on the materialized view to 5 minutes allows BigQuery to serve query results from the view even if the underlying base table's streaming buffer hasn't fully committed, as long as the data is within the staleness window. This enables the materialized view to reflect near-real-time data without waiting for the streaming buffer to fully materialize, meeting the 5-minute refresh requirement.

Exam trap

Google Cloud often tests the misconception that `max_staleness` is set on the base table or that streaming buffer size can be manually tuned, when in fact `max_staleness` is a materialized view property that relaxes consistency to achieve faster refresh.

How to eliminate wrong answers

Option A is wrong because `max_staleness` is a property of materialized views or tables that controls how stale results can be served, not a property set on the base table to force faster refresh. Option B is wrong because disabling streaming inserts and using batch loads only would eliminate the streaming buffer but would introduce latency from batch job scheduling, making it impossible to achieve sub-5-minute refreshes. Option C is wrong because the streaming buffer size is not configurable by users; BigQuery manages it automatically, and increasing it would not speed up materialized view refresh.

548
MCQmedium

A company is using Cloud SQL for MySQL for its OLTP workload. They want to run complex analytical queries on the same data without impacting transactional performance. The analytical queries involve large scans and joins. What is the recommended approach?

A.Export the data to BigQuery periodically and run analytical queries there
B.Enable MySQL Query Cache to speed up analytical queries on the primary instance
C.Use Cloud Spanner to handle both OLTP and analytics with interleaved tables
D.Create a Cloud SQL read replica and route analytical queries to it
AnswerA

BigQuery is designed for complex analytics; periodic exports ensure no impact on the OLTP instance.

Why this answer

BigQuery is a serverless, highly scalable data warehouse designed for analytical queries on large datasets. By exporting data from Cloud SQL (OLTP) to BigQuery, you isolate the analytical workload from the transactional database, preventing resource contention and performance degradation on the primary instance. This separation of concerns is the recommended pattern for running complex scans and joins without impacting OLTP performance.

Exam trap

Google often tests the misconception that a read replica can handle analytical workloads without impact, but the trap here is that read replicas still run the same MySQL engine and share storage I/O, making them unsuitable for large scans and joins that would degrade performance for all queries on that replica.

How to eliminate wrong answers

Option B is wrong because MySQL Query Cache is designed to cache the result set of SELECT statements for repeated identical queries, not to accelerate large scans or complex joins; it was deprecated in MySQL 8.0 and offers no benefit for analytical workloads that involve full table scans. Option C is wrong because Cloud Spanner is a globally distributed, strongly consistent database for OLTP workloads, not optimized for complex analytical queries; interleaved tables improve join performance for hierarchical data but do not isolate analytical queries from transactional impact. Option D is wrong because a Cloud SQL read replica shares the same underlying storage and compute resources as the primary instance; while it can offload read traffic, it still runs the same MySQL engine and will experience performance degradation under heavy analytical queries, and it cannot handle large scans and joins without affecting the replica's ability to serve other reads.

549
MCQmedium

A Cloud SQL for PostgreSQL database experiences lock contention during heavy concurrent writes on a single table. Which schema design change can most effectively reduce contention?

A.Deploy read replicas to offload reads
B.Use a connection pooler like PgBouncer
C.Create materialized views for read queries
D.Partition the table by a key that spreads write load
AnswerD

Partitioning reduces lock contention by distributing writes.

Why this answer

Partitioning the table by a key that spreads write load (e.g., a hash of the user ID or timestamp) reduces lock contention because each partition is a separate physical storage unit with its own lock manager. Concurrent writes targeting different partitions can proceed in parallel without blocking each other, directly addressing the contention on a single table.

Exam trap

The trap here is that candidates confuse read scaling solutions (replicas, materialized views) or connection management with write concurrency fixes, failing to recognize that only partitioning or sharding directly reduces lock contention on a heavily written table.

How to eliminate wrong answers

Option A is wrong because read replicas offload SELECT queries but do not reduce write lock contention on the primary table; writes still serialize on the source. Option B is wrong because a connection pooler like PgBouncer manages client connections to reduce overhead but does not change the locking behavior of concurrent DML statements on the same table. Option C is wrong because materialized views are read-only snapshots that do not affect write locking; they only improve read performance for complex aggregations.

550
MCQeasy

An application running on Google Kubernetes Engine (GKE) uses OpenTelemetry SDK to export traces. Which Google Cloud service should receive these traces?

A.Cloud Logging
B.Cloud Monitoring
C.Error Reporting
D.Cloud Trace
AnswerD

Correct. Cloud Trace is the distributed tracing service for Google Cloud.

Why this answer

Cloud Trace is the managed distributed tracing service on Google Cloud. OpenTelemetry SDK can export traces directly to Cloud Trace via the exporter. Cloud Monitoring is for metrics, Cloud Logging for logs, and Error Reporting for exceptions.

Traces go to Cloud Trace.

551
Multi-Selectmedium

A company wants to implement least-privilege access for service accounts. Which THREE practices should they follow? (Choose 3)

Select 3 answers
A.Use Workload Identity Federation instead of service account keys.
B.Grant primitive roles for simplicity.
C.Use predefined roles to ensure compatibility.
D.Regularly rotate service account keys.
E.Create custom roles with only necessary permissions.
AnswersA, D, E

Eliminates the need to manage keys.

Why this answer

Workload Identity Federation allows workloads running outside Google Cloud (e.g., on-premises, AWS, Azure) to authenticate to Google Cloud APIs without using long-lived service account keys. By exchanging tokens from an external identity provider for short-lived Google Cloud access tokens, it eliminates the need to store and manage static keys, directly supporting least-privilege access by reducing the attack surface and enabling automatic credential rotation.

Exam trap

The trap here is that candidates often confuse 'predefined roles ensure compatibility' with 'predefined roles are best for least-privilege,' but predefined roles still bundle permissions that may exceed what is strictly necessary, whereas custom roles allow exact permission scoping.

552
MCQmedium

A Cloud Spanner database is experiencing increased read traffic. You need to add an index to improve query performance without downtime. What is the correct approach?

A.Export the database, create the index in a new instance, then import.
B.Use the ALTER TABLE statement to add the index as a constraint.
C.Create a secondary index using the 'CREATE INDEX WITH OFFLINE' option to avoid blocking.
D.Use the CREATE INDEX statement. Spanner creates indexes online without blocking writes or reads.
AnswerD

Spanner supports online index creation; the index is built in the background without downtime.

553
MCQhard

You have a BigQuery table with billions of rows partitioned by date and clustered on country. Users frequently query the table to compute total sales by product for a specific month. The product field has high cardinality (millions of distinct values). Which optimization would improve query performance the most?

A.Use a wildcard table pattern to query across date partitions
B.Re-cluster the table with product as the first clustering column
C.Partition by product
D.Keep the current clustering on country
AnswerB

Clustering on product improves aggregation performance by grouping data physically.

Why this answer

B is correct because clustering on a high-cardinality column like product, especially as the first clustering column, allows BigQuery to prune blocks more effectively during queries that filter or group by product. Since the table is already partitioned by date, clustering on product reduces the amount of data scanned when computing total sales by product for a specific month, directly addressing the query pattern.

Exam trap

Google often tests the distinction between partitioning and clustering, and the trap here is that candidates mistakenly choose partitioning by product (Option C) without realizing BigQuery's partition limit and the unsuitability of high-cardinality columns for partitioning.

How to eliminate wrong answers

Option A is wrong because using a wildcard table pattern does not improve query performance; it is a method for querying multiple tables, not an optimization for pruning within a single partitioned table. Option C is wrong because partitioning by product is impractical for high-cardinality columns (millions of distinct values) — BigQuery limits partitions to 10,000 per table, and excessive partitions degrade performance and increase metadata overhead. Option D is wrong because keeping the current clustering on country does not optimize queries that filter or group by product; clustering on a column not used in the query provides no pruning benefit.

554
Multi-Selectmedium

A team is running a critical application on Cloud SQL (PostgreSQL) that serves both OLTP transactions and read-heavy reporting. The reporting queries are causing performance degradation for the OLTP traffic. The team needs to optimize performance with minimal application changes. Which THREE actions should they take? (Choose THREE)

Select 3 answers
A.Enable slow query logging and use EXPLAIN ANALYZE to optimize queries
B.Route all traffic through the Cloud SQL Auth Proxy for better performance
C.Increase the number of vCPUs and memory on the primary instance
D.Enable connection pooling using PgBouncer via the Cloud SQL Auth Proxy
E.Create read replicas and route reporting queries to them
AnswersA, D, E

Identifying and optimizing slow queries reduces resource contention and improves overall performance.

Why this answer

Read replicas offload reporting queries from the primary instance. Connection pooling with PgBouncer reduces connection overhead and improves throughput. Slow query logging and EXPLAIN ANALYZE help identify and tune problematic queries, which is essential for performance.

VCPUs and memory should be right-sized based on workload, not arbitrarily increased. Cloud SQL Auth Proxy is for secure connections, not performance.

555
MCQeasy

Your Cloud SQL for MySQL instance is experiencing unusually high disk usage. You need to identify the cause. Which metric should you monitor in Cloud Monitoring?

A.InnoDB row reads
B.CPU utilization
C.Query latency
D.Binary log disk usage
AnswerD

Binary logs can consume significant disk space.

Why this answer

Binary logs in MySQL store all data changes (e.g., INSERT, UPDATE, DELETE) and can consume significant disk space, especially under heavy write workloads or if retention is misconfigured. Monitoring 'Binary log disk usage' directly reveals whether accumulated binary logs are the primary cause of high disk usage, which is a common issue in Cloud SQL for MySQL.

Exam trap

The trap here is that candidates may confuse performance metrics (like CPU or latency) with storage metrics, overlooking the direct disk space impact of binary logs in MySQL replication or backup configurations.

How to eliminate wrong answers

Option A is wrong because InnoDB row reads measure the number of rows read from the InnoDB storage engine, which indicates query activity but does not directly correlate with disk space consumption. Option B is wrong because CPU utilization reflects processing load, not storage usage; high CPU could be a symptom of inefficient queries but does not explain disk usage. Option C is wrong because query latency measures the time taken to execute queries, which can be affected by disk I/O but does not identify the specific cause of high disk usage.

556
MCQmedium

A company is using BigQuery and needs to implement row-level security so that sales representatives only see their own region's data. Which approach?

A.Use BigQuery column-level security to filter by region
B.Create separate tables for each region and union in views
C.Use authorized views with WHERE clause filtering by session user's region
D.Use IAM conditions at the dataset level
AnswerC

Authorized views can apply row-level filters using SESSION_USER() and a mapping table, ensuring users only see their data.

Why this answer

BigQuery authorized views allow you to enforce row-level security by embedding a WHERE clause that filters data based on the session user's region (e.g., using SESSION_USER() or a mapping table). This ensures each sales representative sees only their own region's data without exposing the underlying tables directly.

Exam trap

Google Cloud often tests the distinction between column-level security (which restricts columns) and row-level security (which restricts rows), leading candidates to mistakenly choose column-level options when row filtering is required.

How to eliminate wrong answers

Option A is wrong because BigQuery column-level security restricts access to specific columns, not rows; it cannot filter by region values. Option B is wrong because creating separate tables per region and unioning them in views is unscalable, violates data normalization, and does not dynamically filter by the current user. Option D is wrong because IAM conditions at the dataset level control access to entire datasets or tables, not individual rows within a table.

557
MCQhard

You are running a Memorystore for Redis instance with persistence disabled. The application requires high availability and data durability after a zone failure. What is the most cost-effective approach?

A.Use a Basic tier instance and schedule periodic exports to Cloud Storage.
B.Enable persistence using the AOF or RDB configuration in Memorystore.
C.Use a Standard tier instance with cross-zone replication.
D.Deploy a Redis Cluster across multiple regions using Memorystore.
AnswerC

Standard tier provides Multi-Zone replication for HA; data is replicated across zones.

Why this answer

Standard tier Memorystore for Redis instances provide cross-zone replication by default, ensuring automatic failover and data durability in the event of a zone failure. This meets the high availability and data durability requirements without the need for manual exports or complex multi-region setups, making it the most cost-effective solution.

Exam trap

The trap here is that candidates often confuse data persistence (AOF/RDB) with high availability (cross-zone replication), leading them to choose Option B, which only addresses durability after a crash, not zone failure recovery.

How to eliminate wrong answers

Option A is wrong because Basic tier instances are single-zone and lack replication, so they cannot provide high availability or data durability after a zone failure; periodic exports to Cloud Storage only provide point-in-time recovery, not automatic failover. Option B is wrong because enabling AOF or RDB persistence in Memorystore only protects against data loss from restarts or crashes, not against zone failures, and it does not provide cross-zone high availability. Option D is wrong because deploying a Redis Cluster across multiple regions introduces significant complexity, higher latency, and increased cost due to inter-region traffic and multi-region replication, which is overkill for a single zone failure scenario.

558
Multi-Selecthard

Which TWO techniques can help avoid hot spotting in a Cloud Spanner table?

Select 2 answers
A.Add a hash of the primary key as the first part of the key
B.Use a monotonically increasing integer as the key
C.Use interleaved tables to distribute writes
D.Create a secondary index on a high-cardinality column
E.Use a random prefix or UUID as the first key column
AnswersA, E

Hash prefix evenly distributes writes.

Why this answer

Adding a hash of the primary key as the first part of the key distributes writes evenly across Cloud Spanner's split boundaries. This prevents hot spotting, which occurs when monotonically increasing keys cause all new writes to land on the same tablet server. By hashing the key, writes are spread across multiple nodes, avoiding contention.

Exam trap

A common mistake is believing that secondary indexes or interleaved tables can prevent write hot spotting in Spanner. In reality, only key design techniques like hashing or using UUIDs as the first key column distribute writes across splits and avoid hot spots.

559
MCQmedium

A team is migrating a self-managed PostgreSQL database to AlloyDB using DMS. They need to set up the source connection profile. The source database is in a different VPC network, and the team wants to avoid exposing it to the internet. Which connectivity option should they use?

A.VPC peering
B.Direct peering
C.Cloud SQL Auth Proxy
D.IP allowlisting for public IP
AnswerA

VPC peering provides private connectivity between VPCs without internet exposure.

Why this answer

VPC peering is the correct connectivity option because it allows private IP connectivity between two VPC networks without exposing the source database to the internet. DMS can use VPC peering to connect to a source PostgreSQL database in a different VPC, as long as the CIDR ranges do not overlap and the necessary firewall rules allow traffic on port 5432. This meets the requirement of avoiding internet exposure while enabling secure, low-latency replication.

Exam trap

The trap here is that candidates confuse VPC peering with Direct peering, assuming both are for VPC-to-VPC connections, but Direct peering is specifically for on-premises or external networks, not for connecting two Google Cloud VPCs.

How to eliminate wrong answers

Option B is wrong because Direct peering is used for on-premises networks connecting to Google Cloud via a dedicated interconnect or partner interconnect, not for connecting two VPCs within Google Cloud. Option C is wrong because Cloud SQL Auth Proxy is a client-side tool for securely connecting to Cloud SQL instances, not for connecting DMS to a self-managed PostgreSQL database in a different VPC. Option D is wrong because IP allowlisting for public IP would expose the source database to the internet, which contradicts the requirement to avoid internet exposure.

560
MCQmedium

A team notices that a critical microservice often fails when the downstream database is slow. They want to test the service's resilience by injecting latency into the database dependency. Which GCP tool should they use?

A.Cloud Load Balancing logging
B.VPC Flow Logs
C.Traffic Director with HTTP fault filter
D.Cloud Armor
AnswerC

Traffic Director can inject latency or errors into traffic for testing resilience.

Why this answer

Chaos Engineering practices on GCP can be implemented using Traffic Director's fault injection or Chaos Mesh. Traffic Director's HTTP fault filter can inject latency into traffic.

561
MCQmedium

An engineer is designing a Cloud SQL database for an e-commerce platform. They need to store product inventory and order history. Which schema normalization level is recommended for OLTP to avoid data anomalies?

A.Second Normal Form (2NF)
B.First Normal Form (1NF)
C.Third Normal Form (3NF)
D.Denormalized schema
AnswerC

3NF removes transitive dependencies, reducing anomalies for OLTP.

Why this answer

Third Normal Form (3NF) eliminates transitive dependencies, reducing update anomalies in OLTP systems.

562
Multi-Selectmedium

You want to use Error Reporting to monitor exceptions in your application. Which TWO prerequisites must be met? (Select 2)

Select 2 answers
A.Enable Error Reporting API for the project.
B.Use a supported language runtime.
C.Log exceptions to Cloud Logging with stack traces.
D.Create a Pub/Sub topic for errors.
E.Install the Cloud Profiler agent.
AnswersA, C

The API must be enabled.

Why this answer

Error Reporting requires that exceptions are logged to Cloud Logging with stack traces, and the service must be configured to write log entries with the appropriate format.

563
Multi-Selecteasy

Which TWO actions can help reduce connection overhead in a Cloud SQL for MySQL instance? (Choose two.)

Select 2 answers
A.Disable SSL encryption for database connections.
B.Enable automatic connection management in the application driver.
C.Use Cloud SQL Proxy or a connection pooler.
D.Increase the max_connections parameter.
E.Add a read replica to handle connect requests.
AnswersB, C

Automatic pooling reduces connection creation.

Why this answer

Enabling automatic connection management in the application driver (e.g., MySQL Connector/J with autoReconnect=true or HikariCP) allows the driver to reuse idle connections and transparently recover from broken connections, reducing the overhead of repeatedly establishing new TCP connections. Option C is correct because Cloud SQL Proxy or a connection pooler (like pgBouncer or ProxySQL) maintains a persistent pool of connections to the database, amortizing the cost of connection setup across multiple client requests and reducing the total number of concurrent connections to the instance.

Exam trap

The trap here is that candidates often confuse increasing max_connections (a capacity setting) with reducing connection overhead, or they mistakenly think disabling SSL reduces overhead significantly, when in reality the overhead of SSL is minor compared to the cost of establishing a new connection from scratch.

564
MCQhard

You need to design a Spanner schema for a social media application that stores user posts. Each post has a unique ID, author ID, timestamp, and content. The primary access pattern is querying all posts for a given author in reverse chronological order. Which schema design minimizes the risk of hotspotting?

A.Primary key: (AuthorId, PostId) where PostId is generated using a UUID
B.Primary key: (AuthorId, HashOfPostId)
C.Primary key: (AuthorId, Timestamp) with Timestamp stored in descending order
D.Primary key: (PostId) with a secondary index on AuthorId
AnswerA

Correct. The UUID as the second part of the key ensures writes are distributed randomly across splits, avoiding hotspotting, while the AuthorId prefix supports efficient reverse-chronological queries (by ordering on PostId, which is random, not chronological; but the access pattern is querying all posts for an author, which can be done by scanning the AuthorId prefix; reverse chronological order can be achieved by storing timestamps in a separate column and ordering by that during query, or by using a descending index on timestamp). The primary purpose here is to minimize hotspotting.

Why this answer

Using a composite primary key with AuthorId as the first part distributes writes across splits. However, adding Timestamp as the second key causes monotonically increasing writes for a single author, leading to hotspotting on the last split. Instead, a random component like a UUID (as in option A) distributes writes evenly across splits, minimizing hotspot risk.

Option A's UUID provides sufficient randomness to avoid sequential writes while still enabling efficient queries per author via the prefix.

565
MCQhard

A company has a Cloud SQL instance with a 500 GB database. They need to perform a major version upgrade from MySQL 5.7 to 8.0 with minimal downtime. Which strategy should they use?

A.Create a read replica with new version, then promote
B.Export and import the database
C.Use in-place upgrade via gcloud command
D.Upgrade during maintenance window
AnswerA

A read replica can be created with MySQL 8.0 and promoted after sync, minimizing downtime to a failover moment.

Why this answer

Creating a read replica with the new MySQL version and then promoting it minimizes downtime because replication keeps the replica synchronized with the primary until promotion. This approach avoids the lengthy export/import process and reduces the risk of data loss or extended unavailability.

Exam trap

The trap here is that candidates may think an in-place upgrade (Option C) is possible with a simple gcloud command, but Cloud SQL requires a replica-based approach for major version changes to ensure minimal downtime and data integrity.

How to eliminate wrong answers

Option B is wrong because exporting and importing a 500 GB database would take hours, causing significant downtime and potential data inconsistency. Option C is wrong because Cloud SQL does not support in-place major version upgrades via gcloud; the gcloud command can only trigger a database flag change or minor version upgrade, not a major version jump. Option D is wrong because upgrading during a maintenance window still requires a database restart and may involve a lengthy migration process, not minimizing downtime as effectively as a replica promotion.

566
MCQhard

A team uses Cloud Deploy with a delivery pipeline that has multiple targets (dev, staging, prod). They want to automatically roll back to the previous release if the new release fails a post-deployment health check. Which configuration should they use?

A.Configure a postDeploy hook that runs a health check and uses 'gcloud deploy releases rollback' if it fails
B.Set 'rollbackOnFailure: true' in the pipeline definition
C.Use a canary deployment with metric analysis to trigger rollback
D.Enable 'auto-rollback' in the target configuration
AnswerA

PostDeploy hooks can run arbitrary Cloud Run jobs; a script can check health and initiate rollback via the API.

Why this answer

Cloud Deploy does not have a built-in 'rollbackOnFailure' or 'auto-rollback' property for post-deployment health checks. Instead, you must implement a custom postDeploy hook that runs a health check script; if the health check fails, the script can invoke 'gcloud deploy releases rollback' to programmatically trigger a rollback to the previous release. This gives you full control over the rollback logic and conditions.

Exam trap

The trap here is that candidates assume Cloud Deploy has a built-in 'rollbackOnFailure' or 'auto-rollback' property similar to other CI/CD tools, but Cloud Deploy requires explicit custom logic via postDeploy hooks for health check-driven rollbacks.

How to eliminate wrong answers

Option B is wrong because 'rollbackOnFailure: true' is not a valid property in Cloud Deploy's pipeline definition; Cloud Deploy does not support an automatic rollback flag for post-deployment failures. Option C is wrong because canary deployments with metric analysis are used for progressive delivery and automated promotion/rollback based on metrics, but they are not the mechanism for a simple post-deployment health check rollback; the question specifically asks for a post-deployment health check, not a canary strategy. Option D is wrong because 'auto-rollback' is not a configurable setting in Cloud Deploy's target configuration; Cloud Deploy targets do not have a built-in auto-rollback property for health checks.

567
MCQmedium

A company collects sensor data from millions of devices globally. Each write is a small record with a device ID and timestamp. They need low write latency and high availability. Which database should they choose?

A.Cloud Firestore
B.Cloud Memorystore
C.Cloud SQL for MySQL
D.Cloud Bigtable
AnswerD

Bigtable excels at high write throughput, low latency, and is ideal for IoT time-series data.

Why this answer

Cloud Bigtable is a fully managed, scalable NoSQL database designed for large analytical and operational workloads with high throughput and low latency. It supports millions of writes per second from globally distributed devices, provides high availability through replication, and is optimized for time-series data like sensor records with device IDs and timestamps.

Exam trap

Google Cloud often tests the misconception that any NoSQL database is suitable for high-throughput writes, but candidates must distinguish between document stores (Firestore) and wide-column stores (Bigtable) designed for massive write scalability.

How to eliminate wrong answers

Option A is wrong because Cloud Firestore is a document-oriented NoSQL database optimized for mobile and web app real-time sync, not for high-throughput sensor ingestion from millions of devices; it has write limits per database that cannot match Bigtable's scale. Option B is wrong because Cloud Memorystore is an in-memory cache (Redis/Memcached) that does not provide durable storage or the ability to store large volumes of historical sensor data. Option C is wrong because Cloud SQL for MySQL is a relational database with limited write throughput and scaling constraints (e.g., read replicas, not horizontal sharding), making it unsuitable for millions of concurrent small writes from global devices.

568
MCQeasy

A game development company wants to use Memorystore for Redis as a session store. They need to ensure that when memory is full, the least recently used keys are evicted first. Which eviction policy should they configure?

A.volatile-lru
B.allkeys-lru
C.volatile-ttl
D.noeviction
AnswerB

This evicts the least recently used keys from the entire keyspace, which matches the requirement.

Why this answer

(allkeys-lru) is correct because the requirement is to evict the least recently used keys from the entire keyspace when memory is full. The 'allkeys-lru' policy applies the LRU algorithm to all keys, regardless of whether they have an expiry set, which matches the need to evict the least recently used keys first across the entire dataset.

Exam trap

A common pitfall in Redis eviction policies is confusing 'volatile-lru' (only keys with TTL) with 'allkeys-lru' (all keys). Since the company needs to evict the least recently used keys regardless of expiry, 'allkeys-lru' is correct.

How to eliminate wrong answers

Option A (volatile-lru) is wrong because it only evicts keys with an expiry set (volatile keys), but the requirement is to evict from all keys, not just those with TTL. Option C (volatile-ttl) is wrong because it evicts keys with the shortest remaining TTL, not the least recently used keys, which does not satisfy the LRU requirement. Option D (noeviction) is wrong because it returns errors on write operations when memory is full, rather than evicting any keys, which would break the session store functionality.

569
MCQmedium

A data engineer is writing a SQL query in BigQuery to calculate the running total of sales per product over time. The table 'sales' has columns product_id, sale_date, and amount. The result must include the cumulative sum ordered by sale_date for each product. Which SQL construct should be used?

A.GROUP BY product_id, sale_date with SUM(amount)
B.SUM(amount) OVER (PARTITION BY product_id ORDER BY sale_date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
C.ROW_NUMBER() OVER (ORDER BY sale_date)
D.LAG(amount, 1, 0) OVER (ORDER BY sale_date)
AnswerB

This window function correctly computes a running total per product.

Why this answer

It uses a window function with a PARTITION BY clause to reset the running total per product and an ORDER BY with a ROWS frame to compute the cumulative sum over time. This is the standard SQL construct in BigQuery for calculating running totals within partitions.

Exam trap

Google Cloud often tests the distinction between aggregate functions with GROUP BY and window functions with OVER, where candidates mistakenly choose GROUP BY thinking it produces a running total, but it only collapses rows.

How to eliminate wrong answers

Option A is wrong because GROUP BY with SUM(amount) aggregates sales into a single total per product and date, not a running cumulative sum over time. Option C is wrong because ROW_NUMBER() assigns sequential row numbers but does not compute any sum or cumulative value. Option D is wrong because LAG() accesses a previous row's value but does not accumulate sums across rows.

570
Multi-Selectmedium

You are designing a highly available Cloud SQL for MySQL architecture. Which TWO components are essential?

Select 2 answers
A.High availability (HA) configuration with a standby zone
B.Regional persistent disk
C.Point-in-time recovery (PITR)
D.Read replicas in the same region
E.Cross-region replication
AnswersA, B

HA provides automatic failover to a standby instance in another zone.

Why this answer

A is correct because Cloud SQL for MySQL High Availability (HA) configuration provisions a standby instance in a different zone within the same region, enabling automatic failover with minimal downtime. B is correct because regional persistent disks replicate data synchronously across two zones, ensuring data durability and availability even if an entire zone fails, which is a prerequisite for HA.

Exam trap

The trap here is that candidates often confuse high availability features (like automatic failover and zone redundancy) with disaster recovery or backup features (like PITR or cross-region replication), leading them to select options that improve data protection but do not ensure continuous uptime within a single region.

571
MCQhard

Refer to the exhibit. This DDL is used to create a table in Cloud Spanner. The table will be used for storing user data with high write throughput. What is one performance issue with this table design?

A.The primary key is a monotonically increasing integer
B.The Name column is of type STRING(MAX)
C.There are no secondary indexes
D.The table is not interleaved with another table
AnswerA

Sequential keys cause write hotspots in Spanner, leading to uneven load.

Why this answer

Using a monotonically increasing integer as the primary key in Cloud Spanner causes all writes to be directed to a single split (tablet), creating a hotspot that severely limits write throughput. Cloud Spanner distributes splits across nodes based on key ranges, and sequential keys prevent this distribution, leading to performance degradation under high write load.

Exam trap

A common misconception is that any integer primary key is acceptable, but in Cloud Spanner, monotonically increasing keys create hotspots because all writes are directed to a single split, limiting write throughput.

How to eliminate wrong answers

Option B is wrong because STRING(MAX) is a valid and common data type in Cloud Spanner; it does not inherently cause performance issues, though it may impact storage costs. Option C is wrong because secondary indexes are not required for high write throughput; they are optional and can be added later for query performance without affecting write throughput directly. Option D is wrong because interleaving tables is a design choice for hierarchical data access patterns, not a requirement for high write throughput; non-interleaved tables can still perform well with proper key design.

572
Multi-Selectmedium

An organization wants to implement feature flags to gradually roll out new features in production. Which TWO approaches can they use on Google Cloud?

Select 2 answers
A.Store feature flags in Cloud Storage and have the application poll for changes
B.Use Cloud Build substitutions to inject feature flags at build time
C.Use Cloud Run traffic splitting to route users to different application versions
D.Integrate a third-party feature flag service like LaunchDarkly into the application
E.Use Cloud Functions to toggle feature flags via HTTP calls
AnswersC, D

Traffic splitting can be used to gradually expose new features by directing user segments to different revisions.

Why this answer

Cloud Run's traffic splitting feature allows you to gradually route a percentage of traffic to a new revision of a service, enabling canary deployments or gradual rollouts of new features without requiring code changes or external services. This is a native Google Cloud approach that leverages the underlying Knative serving layer to manage traffic routing at the request level.

Exam trap

The trap here is that candidates may confuse build-time injection (Option B) with runtime feature toggles, or think that polling Cloud Storage (Option A) is a valid pattern for real-time flag updates, when in fact Google Cloud's native traffic splitting or a dedicated feature flag service is required for gradual rollouts.

573
Multi-Selectmedium

A site reliability engineer is leading a blameless postmortem for an incident. Which THREE practices should be included? (Choose 3.)

Select 3 answers
A.List contributing factors
B.Determine the incident commander for future incidents
C.Assign action items with owners and due dates
D.Use the 5 Whys technique to find root cause
E.Identify the person who caused the incident
AnswersA, C, D

Identifying contributing factors helps prevent recurrence.

Why this answer

Blameless postmortems focus on understanding contributing factors and creating action items. The five whys technique helps find root cause. Action items should have owners and due dates.

Assigning blame is explicitly avoided. Incident commander is part of incident management, not postmortem. A timeline is important.

574
MCQhard

Your Spanner instance is running a workload with high read throughput. You notice that read latency has increased significantly. Upon investigating, you find that the instance is experiencing high CPU utilization on the Spanner nodes. The workload consists of many small point lookups (reads by primary key). Which action is most likely to reduce read latency?

A.Add secondary indexes on the primary key columns.
B.Use stale reads with a timestamp bound to allow reads from replicas.
C.Redesign the schema to use interleaved tables.
D.Reduce the number of Spanner nodes to lower CPU overhead.
AnswerB

Stale reads can be served from any replica, reducing load on the leader and improving latency.

Why this answer

B is correct because stale reads allow Cloud Spanner to serve read requests from read-only replicas, which offloads CPU-intensive processing from the leading replica nodes. By using a timestamp bound (e.g., exact_staleness or max_staleness), the workload can tolerate slightly outdated data, reducing the load on the nodes and lowering read latency for point lookups.

Exam trap

Google Cloud often tests the misconception that reducing nodes or adding indexes always improves performance, but in Spanner, reducing nodes starves CPU capacity and secondary indexes increase write overhead, while stale reads directly offload the leader's CPU.

How to eliminate wrong answers

Option A is wrong because adding secondary indexes on primary key columns does not reduce CPU utilization on Spanner nodes; it adds additional index maintenance overhead and may increase write latency without addressing the high read CPU issue. Option C is wrong because redesigning the schema to use interleaved tables improves locality for parent-child relationships but does not directly reduce CPU load from high-throughput point lookups; it may even increase CPU usage due to more complex splits. Option D is wrong because reducing the number of Spanner nodes decreases total CPU capacity, which would likely increase CPU utilization per node and worsen read latency, not reduce it.

575
MCQmedium

A company stores time-series data in Cloud Spanner with a primary key composed of a timestamp prefix and a user ID suffix. They notice high write latency and hotspotting on a specific node. How should they redesign the primary key to distribute writes evenly?

A.Use a hash of the user ID as the prefix, then timestamp
B.Use a monotonically increasing counter as the prefix
C.Keep the current design but add a secondary index
D.Reverse the key order: timestamp suffix, user ID prefix
AnswerA

Hashing the user ID distributes writes across tablets, while timestamp ensures order within that hash.

Why this answer

Hotspots occur in Spanner when using monotonically increasing keys (like timestamps) because all writes go to a single tablet. Using a hash prefix or bit-reversal distributes writes across tablets. Keeping a timestamp suffix still causes hot leading key.

None and using a secondary index doesn't fix the primary key issue.

576
MCQeasy

A company has an SLA of 99.95% availability for its service. The SRE team defines an SLO of 99.99% availability. The error budget is calculated as 0.01% over a 30-day window. How much downtime is allowed per month according to the error budget?

A.432 minutes
B.0.432 minutes
C.43.2 minutes
D.4.32 minutes
AnswerD

Correct calculation: 0.01% of 43200 minutes = 4.32 minutes.

Why this answer

Error budget = 100% - SLO. For 99.99% SLO, error budget = 0.01%. Over 30 days (720 hours), 0.01% of 720 hours = 0.072 hours = 4.32 minutes.

Alternatively, compute: 30 days * 24 * 60 minutes = 43200 minutes; 0.01% of that = 4.32 minutes.

577
Matchingmedium

Match each Cloud Spanner replication type to its purpose.

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

Concepts
Matches

Participates in writes and reads

Serves reads but not writes

Participates in voting but not data storage

Replication within a single region for low latency

Global replication for higher availability

Why these pairings

Cloud Spanner supports read-write, read-only, and witness replicas. Read-write replicas handle all operations and vote; read-only replicas scale reads without voting; witness replicas provide quorum without storing data. Common confusions include swapping the roles of read-only and witness replicas.

578
Multi-Selectmedium

Which TWO of the following are valid ways to improve the performance of a BigQuery query that joins two large tables?

Select 2 answers
A.Apply WHERE clauses to filter each table before the join.
B.Create a materialized view that pre-joins the tables.
C.Use the 'JOIN EACH' clause.
D.Denormalize the tables into a single table.
E.Set the query option 'USE_CACHE=TRUE'.
AnswersA, B

Reducing data before joining improves performance.

Why this answer

Applying WHERE clauses before the join (e.g., using subqueries or CTEs to pre-filter each table) reduces the amount of data shuffled and processed during the join phase. BigQuery's query engine can push down filters to the storage layer, minimizing the bytes read and improving performance significantly. Option B is also correct because a materialized view can pre-join the tables and store the results, allowing subsequent queries to read from the pre-joined view instead of performing the join each time.

This can drastically reduce query time, especially for repeated queries on the same join pattern.

Exam trap

Google Cloud often tests the misconception that 'JOIN EACH' is still required for large joins, when in fact it is a deprecated syntax and modern BigQuery handles large joins automatically without any special clause.

579
MCQmedium

During a blameless postmortem, the team uses the '5 Whys' technique to identify root causes. What is the primary purpose of this technique?

A.To estimate the cost of the incident
B.To iteratively ask 'why' to uncover the root cause
C.To identify the immediate superficial cause of the incident
D.To determine which team member made an error
AnswerB

The technique involves asking 'why' repeatedly to drill down to root cause.

Why this answer

5 Whys is a root cause analysis technique used to uncover the underlying causes of an incident, not to assign blame or find contributors superficially.

580
MCQmedium

A team is automating toil reduction and needs to identify tasks that qualify as toil. Which of the following is a defining characteristic of toil according to SRE principles?

A.Work that has no enduring value
B.Work that requires deep domain expertise
C.Work that is performed by junior engineers only
D.Work that is critical to business operations
AnswerA

Toil does not produce lasting improvement; once done, it needs to be done again.

Why this answer

Toil is work that is manual, repetitive, automatable, has no enduring value, and scales linearly with service growth. One key characteristic is that it provides no enduring value; if the task were not done, the service would not suffer long-term loss.

581
MCQeasy

A company is migrating a MySQL database to Cloud SQL using Database Migration Service (DMS). The source database is on-premises with a public IP address. Which networking configuration is required on the source to allow DMS to connect?

A.Create a VPC peering connection between the source and DMS.
B.Install the Cloud SQL Auth Proxy on the source database.
C.Allowlist the DMS public IP addresses in the source database firewall.
D.Configure a Cloud VPN tunnel between the on-premises network and Google Cloud.
AnswerC

DMS connects from its own IP range; allowlisting those IPs enables the connection.

Why this answer

For DMS to connect to a source with a public IP, the source must allowlist the IP addresses of the DMS instance to bypass firewall restrictions.

582
MCQeasy

A Cloud SQL instance is running low on disk space. You want to increase disk size with zero downtime. Which action should you take?

A.Stop the instance, increase disk, and restart
B.Export data, create a new instance with larger disk, and import
C.Create a clone with larger disk and failover
D.Use gcloud sql instances patch to increase the storage size
AnswerD

This operation increases storage online without restarting the instance.

Why this answer

Cloud SQL supports online storage increases without downtime. The `gcloud sql instances patch` command (or the equivalent Console/API operation) dynamically adds more disk capacity to the running instance while it continues serving traffic. This is possible because Cloud SQL uses persistent disks that can be resized online, and the database engine (e.g., MySQL, PostgreSQL) does not need to restart to recognize the additional space.

Exam trap

Google Cloud often tests the misconception that any storage change requires a restart or rebuild, but Cloud SQL's online disk resize is a key differentiator that candidates must remember to avoid picking downtime-inducing options like stopping the instance or recreating it.

How to eliminate wrong answers

Option A is wrong because stopping the instance causes downtime, which violates the zero-downtime requirement. Option B is wrong because exporting and importing data is a manual, time-consuming process that also requires downtime during the cutover, and it is not the recommended method for simply increasing disk size. Option C is wrong because creating a clone with a larger disk and then failing over still involves a brief interruption during the failover process, and it is an unnecessarily complex approach when a direct online resize is available.

583
MCQeasy

A BI developer needs to write a query that calculates total sales by month for the current year. They create a Common Table Expression (CTE) to define monthly aggregates, then reference it in a final SELECT. What is the main benefit of using a CTE over a subquery in this scenario?

A.CTEs are always faster than subqueries.
B.CTEs reduce the amount of memory used by the query.
C.CTEs automatically cache results for subsequent queries.
D.CTEs enhance query readability and maintainability.
AnswerD

CTEs allow you to break down complex queries into named steps.

Why this answer

CTEs improve query readability and maintainability by allowing you to define a named temporary result set once and reference it multiple times in the final SELECT. In this scenario, the CTE clearly separates the monthly aggregation logic from the final output, making the query easier to understand and modify compared to nesting subqueries.

Exam trap

Google Cloud often tests the misconception that CTEs provide performance benefits like caching or reduced memory, when in fact their primary advantage is structural clarity and reusability within a single query.

How to eliminate wrong answers

Option A is wrong because CTEs are not inherently faster than subqueries; performance depends on the query optimizer and execution plan, and in many cases CTEs are not materialized or optimized differently. Option B is wrong because CTEs do not reduce memory usage; in fact, a CTE that is referenced multiple times may be re-evaluated each time unless the database engine materializes it, potentially increasing memory and CPU usage. Option C is wrong because CTEs do not automatically cache results for subsequent queries; they are scoped to a single statement and are not persisted or shared across separate executions.

584
MCQeasy

What is the primary benefit of using Workload Identity Federation over service account keys when authenticating workloads running outside Google Cloud?

A.It allows using multiple service accounts simultaneously.
B.It enables workloads to run without any service account.
C.It provides higher performance for authentication requests.
D.It eliminates the need to create and manage long-lived service account keys, reducing the risk of key exposure.
AnswerD

Workload Identity Federation uses short-lived tokens and avoids the security risks of managing static keys.

Why this answer

Workload Identity Federation allows external workloads to impersonate a service account temporarily without needing to manage long-lived service account keys, which are a security risk.

585
MCQhard

A company is migrating a large on-premises MySQL database to Cloud SQL. The source database supports heavy reporting queries that scan millions of rows and join multiple tables. The team wants to minimize downtime and avoid performance degradation during migration. Which migration approach should they use?

A.Use gcloud sql import command to import a CSV export while the source database remains in use
B.Create a BigQuery transfer service to move data from MySQL to Cloud SQL
C.Set up Database Migration Service (DMS) with continuous replication from the source to Cloud SQL, then cut over when replication lag is minimal
D.Use mysqldump to export the data and import it into Cloud SQL during a maintenance window
AnswerC

DMS with continuous replication minimizes downtime by synchronizing data in real-time until cutover.

Why this answer

Database Migration Service (DMS) with continuous replication allows near-zero downtime migration by replicating changes from the source to Cloud SQL while the source remains operational. Export/import methods typically require downtime. Replicating to BigQuery is not relevant for Cloud SQL migration.

Just changing instance size does not handle data migration.

586
Multi-Selecthard

You need to set up a logs-based alert that triggers when the 99th percentile of request latency exceeds 500ms in a 10-minute window. You create a logs-based distribution metric. Which THREE alert conditions are needed? (Select 3)

Select 3 answers
A.Reducer: 99th percentile
B.Alignment period: 10 minutes
C.Notification channel: SMS only
D.Metric type: Log-based distribution metric
E.Condition type: Metric absence
AnswersA, B, D

To compute the 99th percentile.

Why this answer

To alert on a percentile of a distribution metric, you need to use the distribution metric, configure the percentile reducer (99th), set an alignment period, and define a threshold condition.

587
Multi-Selecteasy

A company wants to migrate from a self-managed MySQL database to a fully managed GCP service. They need high availability with automatic failover, automated backups, and read replicas for scaling read traffic. Which two Google Cloud services meet these requirements? (Choose TWO.)

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

Fully managed, globally distributed, HA, and can handle read scaling.

Why this answer

Cloud SQL for MySQL is correct because it is a fully managed MySQL-compatible service that offers high availability with automatic failover, automated backups, and support for read replicas to scale read traffic. Cloud Spanner is also correct because it provides a fully managed, horizontally scalable relational database with automatic synchronous replication for high availability, automatic failover, automated backups, and read replica support, making it suitable for migrating from MySQL. Both services meet the requirements for a fully managed, highly available database with read scaling.

Exam trap

The trap here is that candidates may incorrectly choose Firestore or Cloud Bigtable because they see 'fully managed' and 'high availability' without recognizing that the requirement for MySQL compatibility and read replicas eliminates NoSQL options, or they may overlook Cloud SQL for MySQL as a valid choice because they assume only Cloud Spanner can provide high availability with read replicas in this Google Cloud context.

588
MCQhard

A company uses Cloud SQL for PostgreSQL to store transactional data and BigQuery for analytics. They need to sync a subset of tables from Cloud SQL to BigQuery daily for BI reporting. The tables are updated incrementally (INSERT, UPDATE, DELETE). Which approach is MOST reliable and cost-effective?

A.Use Datastream to stream changes from Cloud SQL to BigQuery in near real-time.
B.Write a custom cron job on App Engine to extract changes and load them into BigQuery.
C.Create BigQuery federated queries that directly read from Cloud SQL.
D.Export the Cloud SQL tables to Cloud Storage as CSV files daily, then load them into BigQuery.
AnswerA

Datastream is a managed CDC service that handles incremental changes efficiently.

Why this answer

Datastream is purpose-built for exactly this use case: it captures CDC (Change Data Capture) events from Cloud SQL for PostgreSQL (using the PostgreSQL logical replication slot and the pgoutput plugin) and streams them directly into BigQuery via a streaming ingestion pipeline. This approach handles INSERT, UPDATE, and DELETE operations reliably without custom code, and it is cost-effective because it avoids full table exports and leverages BigQuery's streaming buffer for near-real-time updates.

Exam trap

Google Cloud often tests the misconception that batch exports (Option D) are the simplest and most reliable approach, but the trap here is that incremental CDC with Datastream is actually more reliable and cost-effective for tables with frequent updates and deletes, because it avoids full table scans and manual change tracking.

How to eliminate wrong answers

Option B is wrong because a custom cron job on App Engine would require implementing complex change tracking (e.g., using timestamps or triggers) and cannot reliably capture DELETE operations without additional overhead, making it less reliable and more costly to maintain. Option C is wrong because BigQuery federated queries read from Cloud SQL directly at query time, which bypasses BigQuery's storage and performance optimizations, incurs high latency, and is not suitable for daily syncing or handling incremental changes. Option D is wrong because daily full CSV exports are inefficient for incrementally updated tables (they waste storage and compute on unchanged rows), cannot capture DELETEs without additional logic, and the daily batch load introduces a 24-hour delay, which is less reliable and more expensive than streaming CDC.

589
MCQeasy

A company needs to store raw event logs for future BI analysis. The logs are semistructured with varying fields. Which BigQuery data type should they use to store the event payload?

A.ARRAY
B.STRING
C.FLOAT64
D.JSON
AnswerD

JSON type allows storing and querying semistructured data with nested fields.

Why this answer

BigQuery's JSON data type is designed to store semistructured data with varying fields, such as raw event logs. It allows schema flexibility, efficient querying of nested fields using JSON functions like `JSON_EXTRACT`, and avoids the need to predefine a rigid schema, which is ideal for BI analysis of event payloads.

Exam trap

Google Cloud often tests the misconception that STRING is sufficient for semistructured data, but the trap is that STRING lacks native querying capabilities and incurs higher costs for parsing, whereas JSON provides built-in functions and better performance for BI workloads.

How to eliminate wrong answers

Option A is wrong because ARRAY is used to store ordered lists of elements of the same data type, not for semistructured payloads with varying fields. Option B is wrong because STRING would store the payload as a plain text blob, losing the ability to query individual fields without complex parsing and increasing storage and processing overhead. Option C is wrong because FLOAT64 is a numeric data type for floating-point numbers, completely unsuitable for storing event payloads that contain diverse field types.

590
MCQmedium

A company runs an e-commerce application on Cloud SQL for MySQL. They need to recover the database to a specific point in time 15 minutes ago after an accidental data deletion. What must be configured beforehand?

A.Create a cross-region replica for failover
B.Enable automated backups only
C.Configure binary logging and set a PITR retention period
D.Set up an on-demand backup every hour
AnswerC

Binary logging is required for PITR, and the retention period determines how far back you can recover.

Why this answer

Point-in-time recovery (PITR) in Cloud SQL for MySQL relies on binary logging (binlog) to capture all write operations. To recover to a specific moment (e.g., 15 minutes ago), you must enable automated backups (which provide the base restore point) and configure binary logging with a retention period that covers the desired recovery window. Option C correctly specifies both requirements: binary logging must be enabled, and a PITR retention period (e.g., 1–7 days) must be set to retain the necessary binlog files for replay.

Exam trap

The PCDOE exam often tests the misconception that automated backups alone are sufficient for point-in-time recovery, but candidates must recognize that binary logging and a PITR retention period are required to replay transactions beyond the last snapshot.

How to eliminate wrong answers

Option A is wrong because a cross-region replica provides disaster recovery and failover capability, not the granular transaction logs needed for point-in-time recovery; it does not enable binlog-based PITR. Option B is wrong because enabling automated backups alone only creates daily backup snapshots; without binary logging, you can only restore to the time of the last backup, not to a specific minute. Option D is wrong because on-demand backups are manual snapshots taken at a specific moment; they do not provide continuous transaction log replay, so you cannot recover to an arbitrary point between backups.

591
MCQhard

An organization is implementing GitOps using Config Sync. They have a Git repository containing Kubernetes manifests for multiple GKE clusters. They want to ensure that only authorized engineers can modify the configuration and that changes are automatically applied to clusters. What is the recommended way to secure Config Sync?

A.Store the Git repository in Cloud Source Repositories and use IAM to control access. Use branch protection rules to require pull request approvals before merging to the main branch.
B.Use a public Git repository and rely on Kubernetes RBAC to control who can modify Config Sync objects.
C.Use a separate Git repository for each cluster and restrict access via SSH keys.
D.Encrypt the Kubernetes secrets in the repo and use a KMS key to decrypt them in the cluster.
AnswerA

IAM controls who can access the repo. Branch protection ensures only reviewed changes are merged. Config Sync automatically applies the main branch.

Why this answer

Config Sync uses a Git repo. The best practice is to use a private repo and grant least-privilege access. To prevent unauthorized changes, enforce branch protection rules (e.g., require PR approvals) and use a service account with read-only access to the repo.

Config Sync's reconciler runs in the cluster with read-only permissions.

592
MCQmedium

The query returns results but takes a long time. The orders table has 500M rows with order_date as a timestamp and revenue as float. How can the query be optimized?

A.Add a clustering key on order_date.
B.Partition the table by month on order_date.
C.Use a wildcard table over multiple date-sharded tables.
D.Use a materialized view that caches the query result.
AnswerB

Partition pruning limits data scanned to relevant months.

Why this answer

Partitioning the table by month on order_date (Option B) is correct because it physically separates the data into monthly partitions, allowing the query engine to prune partitions that do not match the query's time range. This dramatically reduces the amount of data scanned, which is the primary cause of slow performance on a 500M-row table. In BigQuery, partitioning by a timestamp column like order_date is a native, cost-effective optimization that directly addresses the scan bottleneck.

Exam trap

The trap here is that candidates often confuse clustering with partitioning, assuming that sorting data (clustering) provides the same scan reduction as physically separating data (partitioning), but clustering only improves block pruning within already-scanned data, not the initial scan elimination.

How to eliminate wrong answers

Option A is wrong because adding a clustering key on order_date does not physically separate data into independent storage blocks; it only sorts data within existing partitions or the entire table, so it cannot reduce the amount of data scanned as effectively as partitioning. Option C is wrong because using a wildcard table over multiple date-sharded tables is a legacy approach that requires manual table management and incurs additional overhead for query planning and metadata operations, whereas native partitioning is simpler and more performant. Option D is wrong because a materialized view caches the query result but does not reduce the scan cost for the base table; it is useful for repeated aggregations, not for optimizing a single ad-hoc query that filters by order_date.

593
MCQhard

An application running on GKE uses OpenTelemetry for instrumentation. You need to export traces to Cloud Trace and custom metrics to Cloud Monitoring. Which approach is most efficient?

A.Write a custom exporter in the application that sends data to both services
B.Export traces to Cloud Trace via Stackdriver Trace exporter and metrics to Cloud Monitoring via Stackdriver Metrics exporter in the SDK
C.Configure the OpenTelemetry SDK to export directly to Cloud Trace and Cloud Monitoring endpoints
D.Use the OpenTelemetry Collector to receive OTLP data and export to Cloud Trace and Cloud Monitoring
AnswerD

The Collector is the recommended approach for multi-backend export, providing robustness and flexibility.

Why this answer

The OpenTelemetry Collector can receive OTLP data from the application and export to multiple backends. Using the Collector as a sidecar or daemonset reduces overhead and provides buffering. Direct export from the SDK increases complexity and resource usage.

594
Multi-Selecteasy

A company is planning to migrate a self-managed MongoDB database to a fully managed Google Cloud service. They need to maintain high availability and support complex queries with aggregation pipelines. Which TWO services should they consider?

Select 2 answers
A.MongoDB Atlas on Google Cloud
B.Cloud Spanner
C.Cloud Firestore
D.Cloud Bigtable
E.Cloud SQL for PostgreSQL with JSON data type
AnswersA, E

MongoDB Atlas on Google Cloud is a fully managed MongoDB service that directly supports aggregation pipelines and provides high availability through replica sets and automated failover.

Why this answer

MongoDB Atlas on Google Cloud is a fully managed MongoDB service that provides native support for MongoDB's aggregation pipeline and high availability through replica sets and automated failover. Cloud SQL for PostgreSQL with JSON data type is a relational database that offers advanced JSON functions (e.g., jsonb_path_query) and can emulate many aggregation pipeline operations, making it a viable option for complex queries while still being fully managed. The other options lack native aggregation pipeline support: Cloud Spanner is a relational database with strong consistency but limited JSON support; Cloud Firestore is a document database with simpler queries; Cloud Bigtable is a wide-column store without aggregation pipeline capabilities.

Exam trap

A common trap is to assume that only MongoDB-native services support aggregation pipelines, but Cloud SQL for PostgreSQL with JSON provides powerful JSON querying that can handle many complex aggregations. Candidates may incorrectly eliminate PostgreSQL due to its relational nature, overlook its JSON capabilities, or mistakenly choose Firestore or Bigtable.

595
Multi-Selecteasy

A company uses Cloud Spanner and needs to design a backup strategy that meets a 24-hour RPO and 4-hour RTO. Which TWO statements are correct for achieving these goals? (Choose 2)

Select 2 answers
A.Use point-in-time recovery to restore to any point within the last 24 hours.
B.Export the database to Avro files in Cloud Storage.
C.Create a cross-region read replica for failover.
D.Schedule a daily backup of the Spanner database.
E.Restore the backup to a new Spanner instance in the same region.
AnswersD, E

Daily backup gives RPO up to 24 hours.

Why this answer

Spanner backups can be created on-demand or scheduled. The backup restore typically completes in hours depending on size, and can meet 4-hour RTO. Scheduling daily backups meets 24-hour RPO.

596
MCQeasy

A company wants to deploy a containerized application to Cloud Run and gradually shift traffic from the current revision to a new revision. They want to send 10% of traffic to the new revision initially. Which command should they use?

A.gcloud run revisions update-traffic ... --to-revisions=NEW=10
B.gcloud run deploy --image ... --to-revisions=NEW=10
C.gcloud run deploy --image ... --no-traffic; then gcloud run services update-traffic ... --to-revisions=NEW=10,OLD=90
D.gcloud run deploy --image ... --traffic=10
AnswerC

This two-step approach first deploys without traffic, then adjusts traffic percentages.

Why this answer

It first deploys the new revision without any traffic using `--no-traffic`, then uses `gcloud run services update-traffic` to explicitly set 10% traffic to the new revision and 90% to the old revision. This two-step approach is required when you want to gradually shift traffic to a new revision without immediately serving any traffic to it, as Cloud Run does not support setting a specific traffic percentage directly in the `gcloud run deploy` command.

Exam trap

The trap here is that candidates assume `gcloud run deploy` can directly set a traffic percentage via a `--traffic` or `--to-revisions` flag, but Cloud Run requires a separate traffic update command after a no-traffic deployment to achieve gradual traffic shifting.

How to eliminate wrong answers

Option A is wrong because `gcloud run revisions update-traffic` operates on a specific revision, not on a service, and the `--to-revisions` flag is not valid for that command; it should be `--to-revisions=NEW=10` but the command itself is incorrect. Option B is wrong because `gcloud run deploy` does not accept a `--to-revisions` flag; it deploys a new revision and by default sends 100% of traffic to it unless `--no-traffic` is used. Option D is wrong because `gcloud run deploy --traffic=10` is invalid; the `--traffic` flag is not supported in `gcloud run deploy` and would cause a syntax error.

597
MCQhard

Your Cloud Spanner database is experiencing a high volume of read-write conflicts, causing many aborts and high latency. You have already increased the compute capacity. Upon analyzing the schema, you find that most conflicts occur on a single table with frequent updates to the same row. What index or schema change would most effectively reduce contention?

A.Enable batch writes in the client library to combine updates.
B.Use a monotonically increasing timestamp as a prefix to the primary key.
C.Add a secondary index on the most frequently updated column.
D.Change the primary key to include a hash prefix of the original key.
AnswerD

A hash prefix distributes writes evenly across splits, reducing row-level contention.

Why this answer

Adding a hash prefix to the primary key distributes writes across multiple splits, reducing hot-spotting on a single row. Cloud Spanner uses range-based splits; without a hash prefix, monotonically increasing keys cause all writes to target the same split, leading to read-write conflicts and aborts. A hash prefix randomizes the key distribution, spreading load across nodes and minimizing contention.

Exam trap

Google Cloud often tests the misconception that secondary indexes or batching solve hot-spotting, when the root cause is key distribution; candidates must recognize that only changing the primary key structure (e.g., hash prefix) directly addresses split-level contention.

How to eliminate wrong answers

Option A is wrong because batch writes combine multiple mutations into a single request but do not change the underlying key distribution; if all writes target the same row, batching still causes contention on that row. Option B is wrong because using a monotonically increasing timestamp as a prefix to the primary key exacerbates hot-spotting, as all new writes go to the same split, increasing contention rather than reducing it. Option C is wrong because adding a secondary index on the frequently updated column does not affect the primary key distribution; it may even increase write overhead and contention due to index maintenance.

598
MCQmedium

An engineer needs to migrate a 500 GB MySQL database to Cloud SQL. The source is in a private network with no public IP. The Cloud SQL instance will also use a private IP. Which connectivity method should the engineer use for Database Migration Service?

A.Assign a public IP to the source database and allowlist it in Cloud SQL.
B.Use VPC peering between the source network and the Cloud SQL VPC.
C.Use Cloud VPN to connect the source network to Cloud SQL.
D.Configure IP allowlisting on Cloud SQL to accept traffic from the source's private IP range.
AnswerB

VPC peering enables private connectivity for DMS.

Why this answer

For private IP scenarios, DMS requires VPC peering between the source network and the Cloud SQL VPC. Alternatively, Cloud SQL Auth Proxy can be used if the source can connect to the proxy, but VPC peering is the recommended direct method for DMS.

599
MCQhard

A BI team uses BigQuery to report on customer orders. The 'customers' dimension table is updated nightly with Type 2 Slowly Changing Dimensions (SCD). However, some reports show incorrect historical aggregates because the fact table references only the current customer key. Which approach resolves this issue?

A.Update the fact table nightly to replace old customer keys with the current key
B.Store the surrogate customer key from the dimension table in the fact table at transaction time
C.Denormalize customer attributes into the fact table
D.Use the natural customer ID in the fact table and join with the dimension using a BETWEEN condition on effective dates
AnswerB

This ensures the fact always points to the correct version of the customer.

Why this answer

With Type 2 SCD, each customer row has a unique surrogate key that represents a specific version of the customer's attributes over time. Storing that surrogate key in the fact table at transaction time ensures that historical facts are permanently linked to the correct customer attributes as they existed at the time of the order. This prevents incorrect aggregates when the dimension table is updated, as the fact table will always join to the precise version of the customer record that was active when the transaction occurred.

Exam trap

Google Cloud often tests the misconception that updating the fact table with current keys (Option A) is acceptable for Type 2 SCD, when in reality it silently converts the design to Type 1 and destroys historical accuracy.

How to eliminate wrong answers

Option A is wrong because updating the fact table nightly to replace old customer keys with the current key destroys historical accuracy, effectively converting the Type 2 SCD into a Type 1 overwrite and breaking the ability to report on past customer attributes. Option C is wrong because denormalizing customer attributes into the fact table duplicates data, increases storage costs, and requires updating all historical fact rows whenever a customer attribute changes, which is impractical and error-prone in BigQuery's append-heavy architecture. Option D is wrong because using the natural customer ID with a BETWEEN condition on effective dates is a valid approach for Type 2 SCDs, but it requires the fact table to store the transaction timestamp; the question states the fact table references only the current customer key, so this option does not resolve the issue without also modifying the fact table schema to include a timestamp.

600
Multi-Selectmedium

A company is adopting GitOps for their GKE clusters using Config Sync. They need to meet the following requirements: (1) automatically sync the cluster state to a Git repository every 5 minutes, (2) ensure that any changes made directly to the cluster are reverted to the desired state defined in Git. Which Config Sync settings should they configure? (Choose TWO).

Select 2 answers
A.Set spec.driftManagement to false.
B.Set spec.sync to '5m' in the RootSync or RepoSync object.
C.Set spec.override to true.
D.Enable drift management by setting spec.driftManagement to true.
E.Set spec.syncInterval to '5m' in the RootSync or RepoSync object.
AnswersB, D

This sets the sync interval to every 5 minutes.

Why this answer

`spec.sync` in a RootSync or RepoSync object defines the sync interval for Config Sync. Setting it to `'5m'` ensures the cluster state is automatically reconciled against the Git repository every 5 minutes. Option D is correct because enabling drift management (`spec.driftManagement: true`) ensures that any manual changes made directly to the cluster are detected and reverted to the desired state defined in Git, meeting the second requirement.

Exam trap

The trap here is confusing the `spec.sync` field (which sets the sync interval) with the non-existent `spec.syncInterval` field, and assuming that `spec.driftManagement` is disabled by default or that setting it to `false` would meet the requirements.

Page 7

Page 8 of 20

Page 9