Courseiva

Google Professional Cloud Database Engineer (PCDE) — Questions 76150

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

Page 1

Page 2 of 20

Page 3
76
MCQeasy

You are using Cloud Memorystore for Redis as a caching layer. You notice that cache hit ratio is below 50%. What is the best action to improve it?

A.Flush the cache periodically to remove stale data.
B.Increase the TTL (time-to-live) for cached data.
C.Enable persistence to avoid data loss.
D.Increase the instance memory size.
AnswerB

Longer TTL keeps data in cache for more reads.

Why this answer

A low cache hit ratio indicates that a large proportion of requests are not finding their data in the cache, forcing the application to fetch from the primary database. Increasing the TTL (time-to-live) for cached data keeps valid entries in Redis longer, reducing the frequency of evictions and cache misses. This directly improves the hit ratio by ensuring that more requests can be served from the cache before the data expires.

Exam trap

Google Cloud often tests the misconception that a low cache hit ratio is always a memory capacity problem, leading candidates to choose 'increase memory size' when the real issue is data expiring too quickly due to short TTLs.

How to eliminate wrong answers

Option A is wrong because flushing the cache periodically removes all data, which would drastically reduce the hit ratio and increase load on the database, the opposite of the desired effect. Option C is wrong because enabling persistence (e.g., RDB snapshots or AOF logs) protects against data loss on restart but does not influence how long data remains in the cache or the hit ratio. Option D is wrong because increasing instance memory size only delays evictions under the maxmemory-policy; if the TTL is too short, data still expires quickly and the hit ratio remains low regardless of memory size.

77
MCQhard

An organization wants to implement least-privilege IAM for their DevOps team. They need permissions to manage Compute Engine instances but not to create or delete them. Which IAM role should be assigned?

A.roles/compute.networkAdmin
B.roles/compute.admin
C.roles/compute.instanceAdmin.v1
D.roles/compute.viewer
AnswerC

This role allows modifying, starting, stopping, but not creating or deleting instances.

Why this answer

The role roles/compute.instanceAdmin.v1 provides permissions to manage Compute Engine instances, including starting, stopping, and modifying them, but explicitly excludes the ability to create or delete instances. This aligns with the least-privilege requirement for the DevOps team, as they need operational control without lifecycle management rights.

Exam trap

The trap here is that candidates often confuse roles/compute.admin with instanceAdmin.v1, assuming 'admin' implies management without realizing it includes full lifecycle permissions, or they pick roles/compute.networkAdmin thinking it covers instance management due to the word 'network'.

How to eliminate wrong answers

Option A is wrong because roles/compute.networkAdmin grants permissions to manage networking resources like firewalls and routes, not Compute Engine instances. Option B is wrong because roles/compute.admin provides full control over all Compute Engine resources, including creating and deleting instances, which violates the least-privilege constraint. Option D is wrong because roles/compute.viewer only allows read-only access to Compute Engine resources, lacking the permissions needed to manage instances.

78
MCQeasy

A BI developer needs to display sales data in a dashboard that shows sales in local time zones. The source data stores all timestamps in UTC. Which is the best practice for handling time zone conversions?

A.Store timestamps in UTC and convert to local time in the BI tool's application layer
B.Store all timestamps in UTC and convert them to the desired time zone in SQL queries
C.Store timestamps as text strings with time zone offset to avoid conversion
D.Store both UTC and local time in separate columns
AnswerB

This ensures a single source of truth and leverages SQL functions for accurate conversion.

Why this answer

Storing timestamps in UTC and converting them in SQL queries ensures that the conversion logic is centralized, auditable, and consistent across all BI reports. This approach leverages the database engine's time zone functions (e.g., AT TIME ZONE in SQL Server or CONVERT_TZ in MySQL) to handle daylight saving time transitions accurately, avoiding the pitfalls of application-layer conversions that may be inconsistent or not applied uniformly.

Exam trap

Google Cloud often tests the misconception that converting time zones in the application layer is simpler and more flexible, but the trap is that this approach introduces inconsistency when multiple BI tools or direct database queries access the same data, and it fails to leverage the database's robust time zone handling for daylight saving time transitions.

How to eliminate wrong answers

Option A is wrong because converting in the BI tool's application layer can lead to inconsistencies if multiple tools access the same data, and it offloads conversion logic to the presentation tier, which may not handle daylight saving time changes correctly without additional configuration. Option C is wrong because storing timestamps as text strings with time zone offsets breaks date arithmetic, indexing, and sorting, and makes it impossible to use native temporal functions for filtering or aggregation. Option D is wrong because storing both UTC and local time in separate columns duplicates data, increases storage overhead, and risks synchronization errors when time zone rules change (e.g., daylight saving time policy updates).

79
MCQeasy

An engineer needs to migrate a PostgreSQL database to Cloud SQL. They have used pg_dump to create a dump file. Which flags should they use to avoid issues with ownership and ACLs, since Cloud SQL does not support those?

A.--no-privileges --no-owner
B.--no-owner --clean
C.--no-acl --if-exists
D.--no-owner --no-acl
AnswerD

These flags exclude ownership and ACL commands, avoiding errors in Cloud SQL.

Why this answer

--no-owner and --no-acl prevent pg_dump from including ownership and ACL commands, which are not supported on Cloud SQL. --no-privileges is not a standard flag (use --no-acl). --clean drops objects before recreating, not recommended.

80
MCQmedium

A company is setting up a new Google Cloud organization. The DevOps team wants to enforce that all Compute Engine instances are created only in us-central1 or europe-west1. Which approach should they use?

A.Set a IAM policy on the organization to allow Compute Engine instances only in those regions.
B.Configure a VPC Service Controls perimeter to restrict resource creation to allowed regions.
C.Use Cloud Deployment Manager to enforce regions via a template that validates location.
D.Create an organization policy with constraint `resourceLocations` and set allowed values to `us-central1` and `europe-west1`.
AnswerD

The `resourceLocations` constraint restricts the regions where resources can be created.

Why this answer

The `resourceLocations` organization policy constraint is specifically designed to restrict the set of Google Cloud locations where resources can be created. By setting allowed values to `us-central1` and `europe-west1`, the DevOps team enforces that Compute Engine instances (and other supported resources) can only be provisioned in those regions. This policy is evaluated at resource creation time and applies across the entire organization, project, or folder hierarchy.

Exam trap

The trap here is that candidates often confuse IAM policies (who can act) with organization policies (what can be done where), leading them to select Option A, which cannot enforce regional restrictions.

How to eliminate wrong answers

Option A is wrong because IAM policies control who can perform actions (e.g., compute.instances.create), not where resources can be created; they cannot restrict creation to specific regions. Option B is wrong because VPC Service Controls is designed to protect data exfiltration by controlling access to services within a perimeter, not to enforce region restrictions on resource creation. Option C is wrong because Cloud Deployment Manager templates can validate region parameters, but they are not enforced at the organization level and can be bypassed by users creating resources outside of Deployment Manager.

81
Multi-Selecthard

A team wants to implement error budget alerts in Cloud Monitoring. They need TWO policies to detect both rapid and gradual budget consumption. Which TWO alert policies should they configure? (Choose 2 answers)

Select 2 answers
A.Single alert with a burn rate of 10x over 1 hour.
B.Alert on error budget remaining < 10%.
C.Fast burn alert with 14x burn rate over 1 hour.
D.Slow burn alert with 5x burn rate over 6 hours.
E.Fast burn alert with 5x burn rate over 6 hours.
AnswersC, D

Catches rapid consumption.

Why this answer

The standard practice is to create a fast burn alert (e.g., 14x burn rate over 1 hour) for rapid consumption, and a slow burn alert (e.g., 5x burn rate over 6 hours) for gradual consumption. The other options are not standard.

82
MCQeasy

A startup is migrating from MongoDB to Firestore in Datastore mode. Their existing documents contain nested arrays of sub-objects (e.g., tags, comments). They want to design a schema that scales well and supports efficient queries. What is the recommended approach for handling these nested arrays in Firestore?

A.Use maps instead of arrays to store the data.
B.Store the arrays as stringified JSON in a single field.
C.Flatten the arrays into subcollections under each document.
D.Keep the nested arrays as they are; Firestore supports arrays.
AnswerC

Subcollections scale independently and allow efficient queries.

Why this answer

Firestore in Datastore mode does not support querying or indexing nested array elements efficiently, which can lead to performance issues as the dataset grows. Flattening nested arrays into subcollections allows each sub-object to be a separate document, enabling scalable queries and proper indexing without the limitations of array-based storage.

Exam trap

Candidates might assume that Firestore in Datastore mode supports querying nested arrays like MongoDB does, but Google Cloud Firestore does not index nested array elements. Flattening into subcollections is necessary for scalability.

How to eliminate wrong answers

Option A is wrong because using maps instead of arrays still stores nested data within the document, which does not resolve the indexing and query limitations for nested objects in Firestore. Option B is wrong because storing arrays as stringified JSON in a single field prevents any server-side querying or filtering on individual elements, forcing application-side parsing and defeating the purpose of a managed database. Option D is wrong because while Firestore supports arrays, it does not support indexing individual elements within nested arrays, making queries on those elements inefficient or impossible at scale.

83
Multi-Selecthard

A global application uses Cloud Trace to collect distributed traces. The current sampling rate of 100% is causing high costs and storage usage. The team wants to reduce sampling while still capturing representative data. Which THREE strategies should they consider?

Select 3 answers
A.Set a probabilistic sampling rate (e.g., 10%) in the OpenTelemetry SDK
B.Disable automatic instrumentation and only use manual instrumentation with Cloud Trace API
C.Configure rate limiting based on request path, sampling only critical endpoints
D.Use tail-based sampling in the OpenTelemetry Collector, retaining traces with errors or high latency
E.Increase the sampling rate to 100% to ensure no traces are missed
AnswersA, C, D

Correct. Head-based probabilistic sampling reduces volume while maintaining a representative sample.

Why this answer

Strategies to reduce trace volume: (1) Implement head-based sampling with a fixed rate like 10% in the OpenTelemetry SDK. (2) Use tail-based sampling via the OpenTelemetry Collector to sample based on error status or latency. (3) Sample based on request path — prioritize high-value endpoints. Disabling auto-instrumentation stops all traces; increasing rate worsens the issue; using only Cloud Trace API is not a sampling strategy.

84
Multi-Selecthard

An organisation wants to back up their Cloud Spanner database and store the backup in a different region for disaster recovery. They require the backup to be in a format that can be restored into Spanner with minimal effort. Which THREE actions should they take? (Choose three.)

Select 3 answers
A.Export the database using gcloud spanner databases export to CSV format
B.Specify a different location for the backup at creation time for cross-region storage
C.Use Dataflow to import the backup into a new instance
D.Restore the backup to a new database using gcloud spanner databases restore
E.Create a database-level backup using gcloud spanner databases backup
AnswersB, D, E

Backups can be stored in a different region by specifying the --location flag.

Why this answer

Cloud Spanner allows you to specify a different location for the backup at creation time, enabling cross-region storage for disaster recovery without additional export or import steps. Option D is correct because restoring a backup to a new database using `gcloud spanner databases restore` directly utilizes the backup format, requiring minimal effort. Option E is correct because creating a database-level backup using `gcloud spanner databases backup` is the native method to back up Spanner databases, and such backups can be stored in different regions for geographic redundancy.

Exam trap

A common trap in Google Cloud exams is thinking that exporting to CSV or using Dataflow is required for cross-region backup, but Spanner's native backup and restore features handle location specification and restoration directly.

85
Multi-Selecteasy

Which TWO are best practices for optimizing write performance in Cloud Bigtable?

Select 2 answers
A.Use short row keys to reduce storage size
B.Group multiple mutations into a single request
C.Design row keys to distribute writes across tablets
D.Use the Dataflow Bulk Import API for real-time writes
E.Increase replication lag to allow more time for writes
AnswersB, C

Batching reduces overhead.

Why this answer

Bigtable batches mutations into a single RPC request, reducing network round trips and improving throughput. Sending individual mutations incurs per-request overhead, so grouping them into a single atomic or non-atomic batch (via `MutateRows` or client-side batching) significantly increases write throughput.

Exam trap

Google Cloud often tests the misconception that short row keys are a primary optimization for write performance, when in reality row key distribution to avoid hotspots is far more critical for throughput.

86
MCQmedium

A DevOps engineer needs to ensure that no Compute Engine VM in the organization can have an external IP address, except for a specific set of approved projects. Which organization policy configuration should they use?

A.Use 'constraints/compute.vmExternalIpAccess' with a condition that denies external IPs unless the project has a specific label.
B.Set the policy 'constraints/compute.vmExternalIpAccess' to 'Allowed' at the organization level and 'Denied' on each project except the approved ones.
C.Create a custom constraint to block external IPs and apply it to all projects except the approved ones.
D.Set 'constraints/compute.vmExternalIpAccess' to 'Deny' at the organization level, then create a tag-based condition to allow external IPs for approved projects.
AnswerD

This is the correct method: deny at org level, then use conditions to allow for projects with a specific tag.

Why this answer

Organization policies support inheritance and conditions. Setting policy to 'Enforce' at the organization level with a condition to exclude approved projects (e.g., resource.matchTag:env/approved-external-ip) ensures only those projects can have external IPs.

87
MCQeasy

A company is running a Cloud SQL for PostgreSQL database and wants to improve read performance for reporting queries. They have already optimized the queries but still see high CPU usage on the primary instance. What is the most cost-effective solution?

A.Add a read replica and direct reporting traffic to it.
B.Enable connection pooling with PgBouncer on the primary.
C.Increase the memory of the primary instance.
D.Create a Cloud SQL Auth Proxy and use it for all connections.
AnswerA

Read replicas handle read-only queries, reducing load on the primary instance.

Why this answer

Read replicas offload read traffic from the primary instance, reducing CPU usage without requiring a larger primary instance.

88
MCQeasy

A company is migrating a PostgreSQL database to Cloud SQL using DMS. The source database has logical replication enabled for the migration. What is the purpose of logical replication in this context?

A.To enable point-in-time recovery on the source.
B.To improve performance of the initial dump.
C.To capture changes for continuous replication after the initial dump.
D.To convert data types between source and destination.
AnswerC

Correct. Logical replication uses WAL to capture changes in real-time, allowing continuous replication after the initial data load.

Why this answer

DMS uses PostgreSQL logical replication to capture ongoing changes. The source database must have logical replication enabled (via WAL with logical decoding) to allow DMS to replicate changes continuously after the initial dump. Binary logging is a MySQL concept, not applicable to PostgreSQL.

89
MCQmedium

A company is migrating an on-premises OLTP application to Google Cloud. The application requires high concurrency (up to 5,000 simultaneous connections) and uses a relational schema with strong transactional integrity. Which database service is the MOST suitable?

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

Cloud SQL provides full SQL compatibility, high connection limits, and strong consistency for OLTP workloads.

Why this answer

Cloud SQL supports up to 4,096 connections by default (configurable) and provides full transactional integrity. For 5,000 connections, Cloud SQL can be configured with appropriate instance sizing. Spanner also supports transactions but is overkill for a single-region OLTP migration.

BigQuery is for analytics, Firestore is NoSQL.

90
Multi-Selecthard

A company uses Cloud Deploy to deploy to multiple GKE clusters (dev, staging, prod). They want to implement a canary deployment strategy for the prod target. The canary should deploy 10% of pods initially, then after 30 minutes and a manual approval, promote to 100%. Which configurations are necessary? (Choose THREE).

Select 3 answers
A.Set the canary percentage to 10% and the promotion interval to 30m.
B.Add an approval gate on the prod target.
C.Define a canary strategy in the prod target within the delivery pipeline.
D.Set the strategy to 'blue/green' with a 10% initial pool.
E.Create a separate delivery pipeline for canary deployments.
AnswersA, B, C

This defines the initial canary percentage and the wait time before promotion.

Why this answer

Setting the canary percentage to 10% and the promotion interval to 30m directly implements the required behavior: initially 10% of pods receive traffic, and after 30 minutes the deployment automatically attempts promotion. This matches the canary deployment strategy in Cloud Deploy where the `canaryDeployment` configuration specifies `percentages` and `verify` intervals.

Exam trap

Google Cloud often tests the distinction between canary and blue/green strategies, trapping candidates who confuse 'initial pool' percentages with canary incremental percentages, or who think separate pipelines are required for different deployment strategies.

91
MCQmedium

A company uses Cloud Spanner for its global inventory system. The current schema has a table 'Orders' with a primary key of OrderID (UUID). The team wants to add a secondary index to support queries filtering by 'status' and 'order_date'. Which type of index should they create and how should they define it to ensure the index covers the query without needing to read the base table?

A.Create a secondary index on (status, order_date)
B.Create a secondary index on (status) STORING (order_date)
C.Create a global secondary index on status, and let the query join with the base table for order_date
D.Create a local secondary index on status with order_date stored in the index
AnswerB

This creates a covering index: the index includes the status column for filtering and stores order_date, so queries on status and order_date can be satisfied by the index alone.

Why this answer

A secondary index with a STORING clause includes additional columns (like order_date) in the index, allowing the index to cover queries that reference only the indexed and stored columns, avoiding a back-join to the base table.

92
MCQhard

Your Cloud SQL for MySQL instance is experiencing intermittent performance degradation. You suspect that the issue is due to a sudden spike in connections from a specific application. Which metric and monitoring approach would best help you correlate the connection spike with performance degradation?

A.Monitor 'cloudsql.googleapis.com/network/received_bytes_count' and compare with connection count.
B.Monitor 'cloudsql.googleapis.com/database/mysql/replication/seconds_behind_master' and compare with query latency.
C.Monitor 'cloudsql.googleapis.com/instance/uptime' and check for instance restarts during degradation.
D.Monitor 'cloudsql.googleapis.com/database/mysql/threads/threads_connected' and correlate with CPU utilization and query latency.
AnswerD

Threads connected directly indicates active connections, and correlating with CPU and latency helps identify the impact.

Why this answer

The 'threads_connected' metric directly measures the number of active connections to the MySQL instance. Correlating this with CPU utilization and query latency allows you to pinpoint whether a sudden spike in connections is causing resource contention and degraded query performance, which is the exact scenario described.

Exam trap

The trap here is that candidates may confuse network metrics (like cloudsql.googleapis.com/network/received_bytes_count) or replication metrics with direct indicators of connection-related performance issues, rather than focusing on the thread count (threads_connected) and its impact on CPU and query latency.

How to eliminate wrong answers

Option A is wrong because 'received_bytes_count' measures network throughput, not connection count; a spike in bytes could be due to large queries or data transfers, not necessarily a connection spike. Option B is wrong because 'seconds_behind_master' is a replication lag metric relevant only for read replicas, not for correlating connection spikes with performance degradation on the primary instance. Option C is wrong because 'instance/uptime' only indicates restarts, which are not directly caused by connection spikes; performance degradation can occur without any instance restart.

93
MCQhard

A company uses Cloud SQL for MySQL and notices slow queries. They have enabled slow query logging and found that some queries are performing full table scans. The table has millions of rows. What is the best immediate action to improve query performance?

A.Increase the instance memory to allow more caching.
B.Use `EXPLAIN ANALYZE` to rewrite the query.
C.Create an index on the columns used in the WHERE clause.
D.Add a read replica to offload the queries.
AnswerC

Indexes allow the database to find rows without scanning the entire table.

Why this answer

Creating an appropriate index can eliminate full table scans and drastically improve query performance for the identified slow queries.

94
MCQeasy

A data engineer needs to run complex analytical queries on terabytes of data with sub-second query latency. The data is stored in Google Cloud Storage and updated daily. Which database service should they use?

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

BigQuery is the correct choice for petabyte-scale analytics with fast SQL queries.

Why this answer

BigQuery is a serverless data warehouse designed for complex SQL queries on large datasets with fast query execution. It can query data directly from Cloud Storage using external tables. Cloud SQL and Spanner are for OLTP, Bigtable for real-time low-latency lookups.

95
MCQmedium

A team is designing a BigQuery schema for time-series analytics on IoT sensor data. They expect high write throughput and queries that aggregate data by hour. Which partitioning and clustering strategy is most cost-effective?

A.Partition by ingestion_time and cluster by sensor_id.
B.Use integer range partitioning on sensor_id.
C.Partition by date and cluster by sensor_id with a timestamp column.
D.Partition by sensor_id and cluster by timestamp.
AnswerC

Date-based partitioning efficiently prunes scans; clustering by sensor_id further reduces data read.

Why this answer

Partitioning by date (e.g., _PARTITIONDATE) allows BigQuery to prune partitions when querying hourly aggregates, drastically reducing scanned bytes. Clustering by sensor_id with a timestamp column further organizes data within each partition, enabling efficient filtering and sorting for sensor-specific queries. This combination optimizes both write throughput (partitioning avoids small, frequent partitions) and query performance (clustering reduces scan on sensor_id filters).

Exam trap

The trap here is that candidates confuse the roles of partitioning and clustering. A common mistake is to partition on a high-cardinality column like sensor_id, which BigQuery limits to 4,000 partitions, causing partition explosion and degraded performance. Understanding this BigQuery constraint is key to choosing the right strategy.

How to eliminate wrong answers

Option A is wrong because partitioning by ingestion_time (using _PARTITIONTIME) creates a new partition for each ingestion batch, which can lead to excessive partitions under high write throughput, increasing metadata overhead and query latency. Option B is wrong because integer range partitioning on sensor_id is not suitable for time-series analytics; it does not enable time-based partition pruning for hourly aggregation queries, forcing full-table scans. Option D is wrong because partitioning by sensor_id would create a separate partition per sensor, which is impractical for high-cardinality sensor data (thousands of sensors) and violates BigQuery's limit of 4,000 partitions per table, while clustering by timestamp alone does not optimize the hourly aggregation pattern.

96
Multi-Selecthard

A company wants to migrate a self-managed PostgreSQL database to AlloyDB with minimal downtime. They plan to use Database Migration Service with continuous CDC. The source database is in a different region. Which THREE steps should they include in their cutover plan? (Choose 3 correct answers.)

Select 3 answers
A.Run a full performance test on AlloyDB before cutover.
B.Quiesce writes to the source database.
C.Confirm replication lag is zero.
D.Delete the source database immediately after promotion.
E.Promote the AlloyDB destination to make it the primary.
AnswersB, C, E

Stop writes to prevent changes after cutover.

Why this answer

Cutover plan: quiesce writes to source, confirm replication lag is 0, promote the destination, update connection strings, and keep source running read-only for rollback. Testing before cutover is important but not part of the cutover plan step. DMS can work across regions but may have increased lag.

Deleting the source immediately is risky.

97
MCQhard

A Cloud Spanner database has a parent table 'Customers' and a child table 'Orders' interleaved on CustomerId. The most common query retrieves the last 10 orders for a given customer. How should the primary key of Orders be defined for optimal performance?

A.(CustomerId, OrderId)
B.Add a commit timestamp column as part of the primary key
C.No change; use a secondary index on OrderDate
D.(CustomerId, OrderDate DESC)
AnswerD

Descending order stores newest first, enabling efficient limit queries.

Why this answer

Defining the primary key as (CustomerId, OrderDate DESC) leverages Cloud Spanner's interleaved table structure to physically co-locate rows for the same customer, and the descending order on OrderDate allows the most common query (retrieving the last 10 orders) to be served as a sequential scan of the most recent rows without sorting or a full table scan.

Exam trap

A common trap in Google Cloud exams is assuming that a secondary index on OrderDate is sufficient for ordered retrieval. However, without using the primary key ordering in an interleaved table, the query cannot exploit physical co-location and will require an extra index lookup and sort, which is suboptimal.

How to eliminate wrong answers

Option A is wrong because (CustomerId, OrderId) does not provide ordering by date, so retrieving the last 10 orders would require scanning all orders for that customer and sorting, which is inefficient. Option B is wrong because adding a commit timestamp column as part of the primary key does not guarantee order by order date, and commit timestamps are not user-defined; they are set by Spanner and cannot be used for application-level ordering without additional logic. Option C is wrong because using a secondary index on OrderDate would require an extra index lookup and does not benefit from the interleaved table's physical locality, leading to higher latency and cost compared to a primary key that directly supports the query.

98
MCQeasy

A team notices that queries on a Cloud Spanner database are slow. They want to identify which queries are consuming the most resources. What should they use?

A.Query Insights
B.Cloud Logging
C.Performance Dashboard
D.Cloud Monitoring metrics
AnswerA

Query Insights is the dedicated tool for analyzing Cloud Spanner query performance.

Why this answer

Query Insights is the correct tool because it is specifically designed for Cloud Spanner to analyze query performance, providing detailed metrics such as execution latency, CPU usage, and rows scanned per query. It helps identify the most resource-intensive queries by breaking down performance by query fingerprint, allowing the team to pinpoint and optimize slow queries directly.

Exam trap

Google Cloud often tests the distinction between high-level monitoring tools (Cloud Monitoring, Performance Dashboard) and query-specific diagnostic tools (Query Insights), trapping candidates who confuse general performance metrics with per-query resource analysis.

How to eliminate wrong answers

Option B is wrong because Cloud Logging captures raw log entries and events but does not provide aggregated query-level performance metrics or resource consumption analysis for Cloud Spanner. Option C is wrong because the Performance Dashboard in Google Cloud Console offers a high-level overview of database metrics like latency and throughput, but it lacks the per-query breakdown and resource attribution needed to identify specific resource-heavy queries. Option D is wrong because Cloud Monitoring metrics provide system-level metrics (e.g., CPU utilization, storage) but do not offer query-level insights or the ability to sort and analyze individual query performance.

99
MCQmedium

You manage a Memorystore for Redis instance that is regularly hitting its maximum memory limit. The application can tolerate some data loss and prefers to keep the most recently used data. Which eviction policy should you configure?

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

volatile-lru evicts the least recently used keys among those with an expiry set, matching the requirement.

Why this answer

volatile-lru evicts keys with an expiry set (volatile keys) using an LRU (least recently used) algorithm. This fits the requirement: the application can tolerate loss of expired data, and it prefers to keep recently used data. allkeys-lru would evict any key, which might include important unexpired keys.

100
MCQeasy

An engineer needs to connect Database Migration Service to a source MySQL database that has only a private IP address. The Cloud SQL destination is also private. What is the recommended method for DMS to connect to the source?

A.Use a Cloud VPN tunnel with static IP
B.Use Cloud NAT to provide outbound connectivity
C.Use VPC peering or Cloud SQL Auth Proxy
D.Use the source database's public IP with IP allowlisting
AnswerC

VPC peering enables private connectivity; Cloud SQL Auth Proxy provides secure tunnel.

Why this answer

For private IP sources, VPC peering or Cloud SQL Auth Proxy can be used. Auth Proxy is recommended for secure connectivity without public IP exposure.

101
MCQeasy

An application running on Compute Engine needs a relational database with high availability across zones within a single region. The application requires an RTO of less than 30 seconds and RPO of zero. Which database solution meets these requirements?

A.AlloyDB
B.Cloud Bigtable with replication
C.Cloud SQL for MySQL with HA configuration
D.Cloud Spanner multi-region
AnswerA

AlloyDB provides automatic failover in less than 30 seconds and near-zero RPO, meeting both requirements.

Why this answer

AlloyDB provides automatic failover with RTO of less than 30 seconds and near-zero data loss (RPO ~0). It replicates data synchronously within a primary and read pool across zones in the same region. Cloud SQL HA has RTO <60 seconds, which does not meet the <30 second requirement.

Spanner multi-region is overkill and has higher cost. Bigtable does not support SQL and has eventual consistency.

102
MCQmedium

A company is migrating from a relational database to Cloud Bigtable. They have a table with a 'user_id' and 'login_timestamp'. Queries often filter by user_id and time range. What should be the row key?

A.timestamp
B.hash(user_id) + timestamp
C.user_id + timestamp
D.user_id
AnswerB

Hash distributes, timestamp enables range queries.

Why this answer

hashing the user_id prevents hotspots, and appending timestamp enables range scans. 'user_id' alone may cause hotspots if sequential.

103
MCQhard

A team is migrating a MySQL OLTP database to Cloud Spanner. The existing schema uses auto-increment primary keys. They plan to convert them to STRING columns with UUIDs. However, the application also relies on ORDER BY on the original integer key. How should they preserve ordering while avoiding hotspots in Spanner?

A.Keep the auto-increment key but use bit-reversal
B.Use a composite primary key with a hash prefix followed by the UUID
C.Use the UUID as the primary key and create a secondary index on the original integer
D.Use a monotonically increasing custom ID and rely on Spanner's split management
AnswerC

Correct. UUID primary key avoids hotspots, and a secondary index on the original integer provides the needed ordering.

Why this answer

Using UUID as the primary key avoids hotspotting because UUIDs are random and distribute writes evenly across splits. Creating a secondary index on the original integer key allows efficient ORDER BY queries on that column. While the secondary index may experience some hotspotting due to monotonically increasing values, Spanner's automatic split management can mitigate this, and the approach meets both requirements: hotspot avoidance on the primary key and ordering capability on the original integer.

Exam trap

Candidates often think a composite key with a hash prefix and a sortable UUID is the best solution, but this does not preserve ordering by the original integer unless the UUID is specifically generated to reflect that order. The secondary index approach directly supports ordering on the original key.

104
MCQhard

A company uses Cloud Deploy to manage deployments to multiple GKE clusters across environments. They want to implement a canary deployment strategy where 10% of traffic goes to the new version initially, and after manual approval, the remaining 90% rolls out. What should be included in the delivery pipeline configuration?

A.Configure a 'canary' strategy with a single phase of 10% and rely on external traffic management
B.Define a 'canary' strategy with a first phase of 10% and a second phase of 90% with an approval gate
C.Set the rollout strategy to 'standard' and use skaffold.yaml for traffic splitting
D.Use a 'blueGreen' strategy with a 10% preview phase
AnswerB

Canary strategy in Cloud Deploy allows multiple phases. An approval gate can be placed before proceeding to the next phase.

Why this answer

Cloud Deploy's 'canary' strategy allows defining multiple phases with incremental traffic percentages, and an approval gate can be inserted between phases to require manual sign-off before proceeding. This directly matches the requirement: a first phase sending 10% traffic to the new version, then a manual approval, followed by a second phase rolling out the remaining 90%.

Exam trap

The trap here is that candidates confuse the 'canary' strategy with a single-phase deployment or mistakenly think 'standard' or 'blueGreen' strategies can achieve incremental traffic splitting with manual approval, when only a multi-phase canary with an approval gate satisfies the requirement.

How to eliminate wrong answers

Option A is wrong because a single-phase canary strategy cannot implement a two-step rollout with a manual approval gate; it would deploy the 10% phase and then automatically complete the rollout without waiting for approval. Option C is wrong because the 'standard' rollout strategy in Cloud Deploy does not support traffic splitting or phased canary deployments; it simply replaces all pods at once, and skaffold.yaml is used for building and deploying artifacts, not for traffic management. Option D is wrong because a 'blueGreen' strategy does not support incremental traffic percentages like 10%; it switches all traffic from the old version to the new version in one step, optionally with a preview phase that does not serve live traffic.

105
MCQmedium

You are deploying a containerized application to Cloud Run using gcloud run deploy. You need to ensure that revisions are tagged with a custom identifier for testing purposes, without allocating any traffic to them. Which flag should you use?

A.--no-traffic
B.--tag=test
C.--traffic=test=0
D.--revision-suffix=test
AnswerB

Assigns the tag 'test' to the revision, allowing access via a test URL.

Why this answer

The `--tag` flag in `gcloud run deploy` assigns a custom tag (e.g., `test`) to a specific revision, allowing it to be accessed via a dedicated URL without receiving any live traffic. This is the correct way to create a tagged revision for testing or staging purposes while keeping the primary revision serving user requests.

Exam trap

The trap here is that candidates confuse the `--tag` flag (which creates a named, traffic-free endpoint) with `--no-traffic` (which only prevents traffic but does not provide a custom identifier) or with `--revision-suffix` (which only renames the revision without creating a separate access point).

How to eliminate wrong answers

Option A is wrong because `--no-traffic` prevents the new revision from receiving any traffic but does not assign a custom identifier or tag; it simply deploys the revision with 0% traffic allocation. Option C is wrong because `--traffic=test=0` is syntactically invalid; the `--traffic` flag expects a revision name or tag with a percentage (e.g., `--traffic=latest=100`), not a tag name as a key. Option D is wrong because `--revision-suffix=test` appends a suffix to the revision name (e.g., `my-service-test`) but does not create a tag or a dedicated URL for testing; it only renames the revision.

106
Multi-Selectmedium

A company uses Cloud Deploy to manage deployments to multiple GKE clusters. They want to implement a canary deployment strategy where the new revision receives 10% of traffic initially, and after 5 minutes with no errors, it receives 100%. Which TWO actions are required to achieve this?

Select 2 answers
A.Integrate with Cloud Monitoring for metric-based canary analysis
B.Use a blue/green deployment strategy instead
C.Enable rollback on failure in the pipeline definition
D.Configure a manual approval gate for the canary phase
E.Configure a canaryDeployment strategy with multiple phases and wait times
AnswersA, E

Metric analysis can automatically verify health and progress the rollout.

Why this answer

Cloud Deploy supports canary deployments using the `canaryDeployment` strategy, which allows defining multiple phases with traffic percentages and wait times. In this scenario, the first phase sends 10% traffic, and after 5 minutes with no errors (detected via Cloud Monitoring integration), it progresses to 100%. Thus, configuring the `canaryDeployment` strategy with phases and wait times (E) is required.

Additionally, integrating with Cloud Monitoring (A) is necessary to automatically detect errors and trigger the progression or rollback. Option D (manual approval) is not automated and does not fit the 'no errors' requirement.

107
Multi-Selecthard

An organization wants to monitor a batch processing job that runs daily on Compute Engine. They need to be alerted if the job fails to produce output within 24 hours. Which THREE components should they use? (Choose 3)

Select 3 answers
A.Create a log-based counter metric that increments upon job completion
B.Create a Cloud Monitoring dashboard to visualize the metric
C.Configure a notification channel (e.g., email) for the alert
D.Create a Cloud Monitoring alert with a metric-absent condition for the counter metric with duration 24h
E.Use Cloud Trace to trace the job execution
AnswersA, C, D

This metric provides the signal of job completion.

Why this answer

A log-based metric counting success messages, an alert with metric-absent condition, and a notification channel. The metric-absent condition fires when the metric stops reporting (i.e., no success log within 24h).

108
MCQmedium

A team is migrating an Oracle database to Cloud Spanner. They have a large table with an auto-increment primary key. Which key design strategy should they use to avoid hot spots?

A.Use a composite primary key with a hash prefix of the auto-increment value
B.Use the auto-increment value as the primary key
C.Use interleaved tables to colocate related data
D.Use UUID as the primary key
AnswerA

Hash prefix distributes writes uniformly across splits.

Why this answer

Using a composite primary key with a hash prefix of the auto-increment value distributes writes across multiple splits in Cloud Spanner. Cloud Spanner uses range-based sharding; a monotonically increasing primary key (like an auto-increment value) would cause all new writes to land on the same split, creating a hot spot. By hashing the auto-increment value and prepending it to the primary key, you randomize the key distribution, ensuring writes are spread evenly across the table's splits.

Exam trap

The trap here is that candidates often think UUIDs are always the best solution for avoiding hot spots in distributed databases, but in Cloud Spanner, a hash prefix of the auto-increment value is more storage-efficient and avoids the performance overhead of large primary keys, while still achieving even write distribution.

How to eliminate wrong answers

Option B is wrong because using the auto-increment value directly as the primary key creates a monotonically increasing sequence, which Cloud Spanner will route to a single split, causing a hot spot and severely limiting write throughput. Option C is wrong because interleaved tables colocate parent and child rows for efficient joins, but they do not address the distribution of writes for a table with a monotonically increasing primary key; the hot spot would still occur in the parent table. Option D is wrong because while a UUID primary key avoids monotonicity and can distribute writes, it is not the best design for Cloud Spanner; UUIDs are large (128-bit), increase storage and index size, and can still cause hot spots if not carefully designed (e.g., time-based UUIDs), whereas a hash prefix of the auto-increment value is more efficient and purpose-built for this scenario.

109
Multi-Selecteasy

You need to create an alerting policy in Cloud Monitoring for a custom metric. Which THREE components must be defined? (Select 3)

Select 3 answers
A.Log sink
B.Conditions
C.Notification channels
D.Documentation
E.Dashboard
AnswersB, C, D

Conditions define the metric and threshold.

Why this answer

An alerting policy consists of conditions (which specify when to trigger), notification channels (how to notify), and documentation (optional but recommended). Duration is part of a condition.

110
Multi-Selecthard

A company is migrating a large Oracle Data Warehouse to BigQuery. The source schema includes many partitioned tables and materialized views. Which THREE considerations are important when designing the BigQuery schema?

Select 3 answers
A.Clustering can be used to improve query performance on frequently filtered columns.
B.Partitioning in BigQuery can be based on a DATE, TIMESTAMP, or INTEGER column.
C.BigQuery requires explicit indexes on columns used in WHERE clauses.
D.Materialized views in BigQuery are automatically refreshed based on base table changes.
E.BigQuery supports unique constraints and foreign keys for data integrity.
AnswersA, B, D

Clustering sorts data within partitions for better filter performance.

Why this answer

Options A, B, and D are correct. Clustering (A) improves query performance on frequently filtered columns by colocating data, similar to Oracle's partitioning but without manual index management. Partitioning in BigQuery (B) supports DATE, TIMESTAMP, or INTEGER columns, which is crucial for migrating Oracle's partitioned tables.

Materialized views in BigQuery (D) are automatically refreshed when base tables change, aligning with Oracle's materialized view refresh mechanisms but with less administrative overhead. Options C and E are incorrect because BigQuery does not require explicit indexes and does not enforce unique or foreign key constraints, reflecting its schema-on-read approach.

Exam trap

Candidates often assume BigQuery requires traditional database features like indexes (C) or constraint enforcement (E), but BigQuery relies on partitioning, clustering, and automatic materialized view refresh for performance and manageability.

111
Multi-Selectmedium

Your organisation uses Cloud Spanner for a globally distributed application. You need to set up a backup strategy that allows restoring the database to a specific point in time within the last 7 days, with minimal impact on performance. Which THREE actions should you take? (Choose THREE.)

Select 3 answers
A.Export the database daily using Dataflow to Cloud Storage.
B.Use gcloud spanner databases import to restore from previous exports.
C.Create full database backups using gcloud spanner backups create and set retention to 7 days.
D.Enable point-in-time recovery (PITR) with a 7-day retention period.
E.Use Cloud Scheduler to trigger regular full backups via gcloud commands.
AnswersC, D, E

Creating full database backups with a 7-day retention provides a restore point and is part of a robust backup strategy.

Why this answer

For point-in-time recovery within 7 days, Cloud Spanner offers built-in PITR (Option D) which enables restoring to any point within the retention period with minimal performance impact. Additionally, creating full backups (Option C) with a 7-day retention ensures you have backup files for restore if needed. Automating these backups with Cloud Scheduler (Option E) ensures regular backups without manual intervention.

Options A and B are incorrect: A uses Dataflow export which is intended for long-term retention and can impact performance, and B restores from backups rather than enabling PITR. Option B is not needed when PITR is enabled.

112
Multi-Selectmedium

A DevOps team wants to use Cloud Deploy to promote releases across multiple targets. They need to define a delivery pipeline that includes a canary deployment for a GKE cluster and a standard deployment for Cloud Run. Which two strategies can they use in the same pipeline?

Select 2 answers
A.Progressive delivery strategy with manual approval
B.Blue/green strategy for Cloud Run
C.Rolling update strategy for GKE
D.Canary strategy for GKE
E.Standard strategy for Cloud Run
AnswersD, E

Canary is supported for GKE targets.

Why this answer

Cloud Deploy allows different deployment strategies per target. You can mix 'canary' for GKE and 'standard' for Cloud Run in the same delivery pipeline. 'Blue/green' is also supported but not required.

113
MCQhard

A team uses Cloud Build to deploy to Cloud Run via gcloud run deploy. They need to perform a canary deployment where 10% of traffic goes to the new revision for 10 minutes before shifting to 100%. The deployment must be automated without manual steps. What approach should they take?

A.Use Cloud Deploy with a canary strategy targeting Cloud Run
B.Use Cloud Build with a substitution variable to control traffic percentage across two builds
C.Use two separate Cloud Build steps: first deploy with --no-traffic, then second step after 10 minutes with --to-revisions
D.Use a single gcloud run deploy with --traffic flags to set 10% initially, then manually update traffic later
AnswerA

Cloud Deploy supports canary deployments to Cloud Run, automatically managing traffic splitting with metrics.

Why this answer

Cloud Run supports traffic splitting via the --no-traffic flag (deploy without serving traffic) and then gradually updating traffic with update-traffic. This can be automated in a Cloud Build step with a sleep or using Cloud Deploy's canary strategy.

114
Multi-Selectmedium

A team is migrating a MySQL database to Cloud SQL using a manual approach (mysqldump + import) instead of DMS. They have limited bandwidth. Which TWO considerations should they take into account when choosing between DMS and manual migration? (Choose TWO.)

Select 2 answers
A.Manual migration does not support resumable uploads.
B.DMS requires the source to have binary logging enabled for continuous migration.
C.DMS does not support MySQL 8.0 as a source.
D.Manual migration is always faster than DMS.
E.DMS compresses data during transfer, reducing bandwidth usage.
AnswersB, E

An important prerequisite for DMS CDC.

Why this answer

DMS can compress data and supports CDC, reducing downtime. Manual migration gives more control over the process but may require more scripting.

115
MCQmedium

A company is designing a Cloud Firestore schema for a social media application. Users can follow other users, and the application needs to display a feed of posts from followed users ordered by timestamp. Which schema design is most cost-effective and performant for querying the feed?

A.Store all posts in a top-level collection and query for posts where user ID is in the list of followed users, ordered by timestamp.
B.Store a feed subcollection under each user document containing references to posts from followed users.
C.Store all user posts in an array within a single document and use array-contains queries.
D.Store a 'follows' collection with documents containing follower and followed user IDs; then query posts for each followed user.
AnswerB

This allows direct query on the feed subcollection ordered by timestamp.

Why this answer

It uses a feed subcollection under each user document to store pre-computed references to posts from followed users. This design avoids expensive collection-group queries or multiple individual queries per followed user, ensuring that fetching the feed is a single, indexed read operation ordered by timestamp, which is both cost-effective and performant at scale.

Exam trap

The trap here is that candidates often choose Option A, thinking a single top-level query with an 'in' filter is simpler, but they overlook Firestore's 10-value limit on 'in' queries and the resulting need for multiple queries, which destroys both performance and cost predictability at scale.

How to eliminate wrong answers

Option A is wrong because querying a top-level posts collection with a list of followed user IDs requires an 'in' query, which is limited to 10 values per query and does not scale to hundreds or thousands of followed users, leading to multiple queries and high read costs. Option C is wrong because storing all user posts in an array within a single document violates the 1 MiB document size limit and cannot support ordered queries or pagination, making it impractical for any real-world social media feed. Option D is wrong because querying posts for each followed user individually results in N+1 read operations per feed request, causing high latency and cost proportional to the number of followed users, with no built-in ordering across results.

116
Multi-Selectmedium

Which TWO actions should be performed during cutover planning for a DMS continuous migration to minimize downtime?

Select 2 answers
A.Quiesce writes to the source database
B.Drop the source database
C.Confirm DMS replication lag is 0
D.Update application connection strings to the destination
E.Create a new DMS migration job
AnswersA, C

Stops new changes, ensuring consistency.

Why this answer

Quiescing writes to the source ensures no new changes after the last sync. Confirming DMS replication lag is 0 ensures all changes are applied. Creating a DMS job is done earlier.

Updating connection strings happens after promotion. Dropping source is not recommended for rollback.

117
Multi-Selectmedium

An organization wants to enforce security policies on container images before deployment. They need to scan images for vulnerabilities and ensure only images that pass the scan can be deployed. Which TWO services should they use? (Select TWO)

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

Container Analysis provides vulnerability scanning.

Why this answer

Container Analysis scans images for vulnerabilities. Binary Authorization enforces policies that require images to have attestations (e.g., from Container Analysis) before deployment.

118
MCQhard

An e-commerce platform uses Cloud Bigtable for real-time user sessions. Write latency is high. On investigation, they find that rows are being written with monotonically increasing row keys (e.g., user_id + timestamp). What is the likely cause and solution?

A.Too many column families; merge them
B.Inefficient reads; use reverse scan
C.Hotspotting on a single node; use salting or field promotion
D.Tablet splits are misconfigured; pre-split the table
AnswerC

Salting or field promotion spreads writes across tablets.

Why this answer

Monotonically increasing row keys (e.g., user_id + timestamp) cause all writes to target a single tablet server, creating a hotspot. Cloud Bigtable distributes writes across nodes by row key range; sequential keys concentrate load on one node, degrading write latency. Salting (prepending a hash or random prefix) or field promotion (using a high-cardinality field as the first part of the key) spreads writes evenly across the cluster.

Exam trap

Google Cloud often tests the misconception that pre-splitting alone solves hotspotting, but the trap here is that monotonically increasing keys will still cause writes to concentrate on the last tablet regardless of pre-splitting, requiring key design changes like salting.

How to eliminate wrong answers

Option A is wrong because too many column families do not cause write hotspotting; they affect storage and read performance, not write distribution. Option B is wrong because inefficient reads (e.g., full scans) are a read-side issue, not a cause of high write latency; reverse scan is a read optimization, not a write fix. Option D is wrong because misconfigured tablet splits or pre-splitting addresses initial distribution, but the root cause here is the key design pattern, not split configuration; even with pre-splits, monotonically increasing keys will still hotspot writes to the last tablet.

119
MCQmedium

A healthcare company uses Cloud SQL for PostgreSQL and needs to meet a disaster recovery requirement of RPO = 1 hour and RTO = 2 hours for a cross-region failover. They currently have a cross-region read replica in another region. Which additional action should they take to meet the RPO consistently?

A.Configure the read replica to use synchronous replication
B.Increase the replica's storage capacity
C.Set up monitoring and alerting on the replication lag metric
D.Enable point-in-time recovery on the primary instance
AnswerC

Monitoring the replication lag ensures that if the lag approaches 1 hour, the team can take corrective action to maintain the RPO.

Why this answer

Cross-region read replicas have asynchronous replication lag, which can vary. To ensure that the RPO is bounded to 1 hour, the company must monitor the replication lag and alert if it exceeds 1 hour. They can also increase the replica's resources to reduce lag, but monitoring is essential to guarantee the RPO.

120
MCQmedium

An organization wants to centralize cost management across multiple projects. They need to analyze spending trends and set budget alerts. Which combination of services should they use?

A.Use the Cloud Billing API to retrieve cost data and store in Firestore for querying.
B.Export billing data to Cloud Storage and use Cloud Logging for analysis.
C.Export billing data to BigQuery and set up budgets with alert thresholds.
D.Enable Cloud Billing reports and configure Slack notifications via webhooks.
AnswerC

BigQuery enables powerful analysis, and budgets with alerts provide cost control.

Why this answer

For cost analysis, billing export to BigQuery provides detailed data. Budgets and alerts are set up in the Cloud Billing console and can trigger notifications via Pub/Sub or email.

121
Multi-Selectmedium

You are a Cloud Database Engineer managing a Cloud Spanner instance. You notice that some queries are taking longer than expected. You suspect that the queries are not using secondary indexes efficiently. Which TWO metrics should you monitor in Cloud Monitoring to validate your suspicion? (Choose two.)

Select 2 answers
A.CPU utilization
B.Statement scan rows returned
C.Lock conflicts
D.Row count returned by index
E.Query scan latency (mean)
AnswersB, D

High scan rows vs. rows returned indicates inefficient index usage.

Why this answer

'Statement scan rows returned' measures the number of rows scanned by a query, which directly indicates whether a full table scan is occurring instead of an efficient index seek. If this metric is high relative to the rows returned, it confirms that secondary indexes are not being used effectively, leading to longer query times.

Exam trap

The trap here is that candidates often confuse general performance metrics like CPU utilization or latency with index-specific metrics, failing to realize that only row-level scan and return metrics directly reveal index usage efficiency.

122
MCQeasy

You need to create a read replica of a Cloud SQL for PostgreSQL instance in a different region for disaster recovery. What must be true about the primary instance to support cross-region replicas?

A.The primary instance must have point-in-time recovery disabled.
B.The primary instance must be using a regional (high-availability) configuration.
C.The primary instance must have the 'cloudsql.logical_decoding' flag set to 'off'.
D.The primary instance must have automated backups enabled.
AnswerD

Correct. Automated backups must be enabled on the primary instance because they provide the WAL archive needed for replication, including for cross-region replicas.

Why this answer

Cross-region read replicas for Cloud SQL for PostgreSQL require automated backups to be enabled on the primary instance. Automated backups are necessary to maintain the WAL (Write-Ahead Log) archive, which is used for replication. The primary does not need to be regional; a zonal (non-HA) instance can also support cross-region replicas.

Point-in-time recovery is automatically enabled when automated backups are on, and the flag 'cloudsql.logical_decoding' must be set to 'on' (not 'off') for PostgreSQL replication.

123
MCQmedium

You are using Cloud Profiler to identify performance bottlenecks. You notice a function that consumes significant CPU time. However, the profiler shows only a small percentage of samples in that function. What is the most likely cause?

A.You need to enable sampling for the specific function.
B.The profiler only profiles heap memory, not CPU.
C.The profiler is not configured to profile CPU usage.
D.The function is not hot enough to be sampled frequently due to the low overhead sampling rate of 0.5%.
AnswerD

The low sampling rate means only a fraction of CPU time is sampled, so a function might appear less frequently.

Why this answer

Cloud Profiler uses statistical sampling and has a low overhead of about 0.5%. If a function appears with a small percentage, it may be that the sampling rate is too low to capture it accurately, or the function is not the main bottleneck. However, a common reason is that the profiler's sampling rate is low to keep overhead minimal.

124
MCQmedium

A team uses Cloud Run for a web application that experiences sporadic traffic. They want to minimize cold starts without incurring costs when there are no requests. Which configuration should they use?

A.Set min instances to a value greater than 0
B.Set min instances to 0
C.Set CPU always-on to true
D.Set concurrency to 1000
AnswerA

Correct. Setting min instances to a value greater than 0 keeps at least one instance warm, eliminating cold starts. This does incur costs during idle periods, but it directly addresses the goal of minimizing cold start latency.

Why this answer

To minimize cold starts, the service needs at least one warm instance ready to handle requests, which requires setting min instances to a value greater than 0. While this incurs costs even when there are no requests (since instances remain allocated), it eliminates the latency of cold starts. Setting min instances to 0 would reduce costs to zero during idle periods, but it would cause cold starts on every request ramp-up, contradicting the goal of minimizing cold starts.

The requirement to 'not incur costs when there are no requests' is inherently conflicting with minimizing cold starts; the best compromise under the stated goals is to set min instances > 0.

Exam trap

The question presents two conflicting requirements: minimize cold starts and incur no costs when idle. The only way to minimize cold starts is to keep instances warm, which costs money. The trap is choosing option B (scale to zero) because it sounds cost-efficient, but it fails the cold start minimization goal.

125
Multi-Selectmedium

A company runs a microservices application on GKE. They want to automatically adjust both the number of pods (for varying load) and the resource limits of individual pods (to avoid resource waste). Which two Kubernetes resources should they configure together? (Choose two.)

Select 2 answers
A.PodDisruptionBudget
B.Vertical Pod Autoscaler (VPA)
C.Horizontal Pod Autoscaler (HPA)
D.Cluster Autoscaler
E.Node Auto-Provisioning
AnswersB, C

VPA adjusts CPU and memory requests/limits of pods to match usage, reducing waste.

Why this answer

HPA adjusts the number of pod replicas based on metrics like CPU. VPA adjusts resource requests and limits to right-size pods. Together, they can complement each other: VPA provides recommended resource values, and HPA scales based on load.

However, when using both, VPA should be in 'Off' mode for recommendations only, to avoid conflicts. Cluster Autoscaler adjusts nodes, not pods. PDB controls disruptions.

126
MCQeasy

A company is designing a mobile application backend that requires real-time synchronization across users and offline support. Which Google Cloud database service is most suitable?

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

Correct. Firestore offers real-time listeners and offline data persistence.

Why this answer

Firestore is designed for real-time sync, offline support, and mobile/web applications. It provides real-time listeners and offline data persistence.

127
MCQmedium

A team uses Cloud Deploy to manage deployments to GKE. They want to automatically roll back to the previous revision if a canary deployment fails health checks. What should they configure?

A.Configure a manual approval gate before promotion
B.Set the deployment strategy to blue/green
C.Set 'rollback-on-failure: true' in the delivery pipeline definition
D.Use a Cloud Build step to run kubectl rollout undo
AnswerC

This enables automatic rollback if the canary deployment fails.

Why this answer

Cloud Deploy supports automatic rollback on failure for canary deployments by setting `rollback-on-failure: true` in the delivery pipeline definition. When a canary deployment fails health checks, Cloud Deploy automatically reverts to the previous stable revision without manual intervention, ensuring minimal downtime and consistent release governance.

Exam trap

Candidates often confuse manual approval gates or alternative deployment strategies (like blue/green) with Cloud Deploy's `rollback-on-failure` configuration, which is the only built-in mechanism for automatic rollback on canary health check failures in Google Cloud Deploy.

How to eliminate wrong answers

Option A is wrong because a manual approval gate before promotion only pauses the pipeline for human sign-off; it does not trigger an automatic rollback on health check failure. Option B is wrong because blue/green deployment strategy is a different deployment pattern that does not inherently provide automatic rollback on canary health check failures; Cloud Deploy's rollback-on-failure is a separate configuration. Option D is wrong because using a Cloud Build step to run kubectl rollout undo is a manual, scripted workaround that bypasses Cloud Deploy's built-in rollback automation and does not integrate with the delivery pipeline's health check failure detection.

128
MCQeasy

A company needs to ensure that their Cloud SQL for PostgreSQL instance can recover from a zonal failure within 60 seconds with minimal data loss. Which feature should they enable?

A.Automated backups with PITR
B.Cross-region read replica
C.Enable deletion protection
D.High availability (HA) configuration
AnswerD

HA provides automatic zonal failover with RTO <60 seconds and near-zero data loss.

Why this answer

Cloud SQL HA configuration automatically fails over to a standby instance in a different zone within the same region. This failover is automatic and typically completes in under 60 seconds, with near-zero data loss (synchronous replication). Cross-region replicas are manual and have longer RTO.

Backups are not suitable for quick recovery.

129
Multi-Selectmedium

A company is designing a landing zone for a large enterprise with multiple business units. They need to implement cost tracking and billing management. Which TWO actions should they take?

Select 2 answers
A.Create a separate billing account for each project.
B.Set up budgets and alerts for each project to monitor spending.
C.Enable billing export to BigQuery for detailed cost analysis.
D.Use resource labels to tag resources with project, team, and environment metadata.
E.Use Cloud Armor to restrict access to billing data.
AnswersC, D

Export to BigQuery allows custom queries and reporting.

Why this answer

Labels can be applied to resources for cost breakdown in billing reports. Billing export to BigQuery enables detailed analysis. Budgets and alerts provide notifications but do not enable tracking at the resource level.

Using a billing account per project would be inefficient.

130
MCQmedium

A financial services firm needs a database for real-time fraud detection that requires single-digit millisecond latency for lookups on a precomputed feature set. The dataset is 5 TB and grows by 1 TB per month. Which database service BEST meets these requirements?

A.BigQuery
B.Cloud Bigtable
C.Cloud Spanner
D.Cloud SQL (MySQL)
AnswerB

Bigtable provides consistent single-digit ms latency and scales horizontally.

Why this answer

Bigtable is designed for high-throughput, low-latency access to large datasets. It can handle 5 TB (or more) with SSD nodes. Cloud SQL and Spanner have lower throughput limits.

BigQuery is not real-time.

131
MCQeasy

A team is using Skaffold for local development and CI/CD. They want to use Skaffold profiles to handle differences between local and production environments. In the CI pipeline (Cloud Build), they want Skaffold to build and deploy using the production profile. How should they invoke Skaffold in the cloudbuild.yaml?

A.skaffold run --profile production
B.skaffold deploy --profile production
C.skaffold dev --profile production
D.skaffold build --profile production
AnswerA

skaffold run builds and deploys once, suitable for CI/CD.

Why this answer

Skaffold profiles can be selected with the --profile flag. In a CI environment, use skaffold run --profile production.

132
Multi-Selecthard

Which THREE are best practices for designing a Cloud Spanner schema for high performance? (Choose three.)

Select 3 answers
A.Spread data across multiple regions to reduce latency.
B.Avoid using a monotonically increasing primary key as the first part of the key.
C.Denormalize frequently joined tables into a single table.
D.Use interleaved tables for tables that are always accessed together by the parent key.
E.Use secondary indexes when querying by non-key columns.
AnswersB, D, E

This prevents write hotspotting.

Why this answer

A monotonically increasing primary key (e.g., an auto-increment integer or timestamp) creates a hot spot on the last tablet server, causing all writes to be serialized on a single split. Cloud Spanner distributes splits based on the primary key range; a sequential key forces all new inserts into the same split, leading to write contention and poor throughput. Using a hash prefix or a UUID-like key spreads writes evenly across splits, maximizing parallelism.

Option A is wrong because spreading data across multiple regions does not inherently reduce latency; it may increase latency due to geographic distance. Cloud Spanner automatically replicates data across regions for high availability, and best practices recommend placing instances close to users for lower latency.

Option C is wrong because denormalization is generally not recommended in Cloud Spanner. Instead, use interleaved tables to efficiently join parent-child tables without data redundancy. Denormalization can lead to increased storage and update anomalies.

Option D is correct because interleaved tables allow parent and child rows to be stored together, providing efficient access when querying by the parent key. This reduces the need for joins and improves performance.

Option E is correct because secondary indexes are necessary for efficient queries on non-key columns. Without an index, Cloud Spanner would need to perform a full table scan, which is slow for large tables.

Exam trap

Google Cloud often tests the misconception that denormalization is always beneficial for performance, but in Cloud Spanner, interleaved tables provide efficient parent-child joins without the downsides of denormalization.

133
MCQmedium

An engineer needs to set up alerting for error budget burn rate. For a fast burn alert, which burn rate multiplier and evaluation window are recommended?

A.6-hour window, 5x burn rate
B.1-hour window, 5x burn rate
C.1-hour window, 14x burn rate
D.6-hour window, 14x burn rate
AnswerC

Fast burn uses 1-hour window and 14x burn rate.

Why this answer

Fast burn alert uses a 1-hour window and 14x burn rate. Slow burn uses 6-hour window and 5x burn rate.

134
MCQeasy

A Cloud SQL for MySQL instance is experiencing high CPU utilisation (>80%) and slow query performance. The instance has auto-storage increase enabled. Which step should the engineer take to immediately reduce CPU load?

A.Increase the instance tier to a larger machine type
B.Reduce the max_connections parameter
C.Create a cross-region read replica to offload reads
D.Enable auto-storage increase if not already enabled
AnswerA

Increasing the machine type provides more CPU and memory, directly reducing CPU utilisation.

Why this answer

High CPU utilisation is often due to insufficient compute capacity. Increasing the instance tier (vertical scaling) provides more CPU and memory, reducing load. Enabling auto-storage increase only adds disk space, not compute.

Creating a read replica distributes read traffic but does not help with CPU load on the primary for write-heavy workloads. Adjusting max_connections may help marginally but is not as effective as increasing compute capacity.

135
MCQeasy

After promoting a Cloud SQL destination in a DMS continuous migration, the application team updates the connection strings. However, they want a rollback plan in case issues arise. What should they keep running to allow a rollback?

A.Keep both databases writable
B.Keep the destination database in read-only mode
C.Keep the DMS job active
D.Keep the source database running in read-only mode
AnswerD

This allows rolling back to the source without data divergence.

Why this answer

Keeping the source database running (read-only) allows reverting to it if needed. The DMS job is stopped after promotion. The destination is now the primary.

Keeping both writable could cause conflicts.

136
MCQmedium

A Cloud Spanner database contains the Orders table as defined above. The query `SELECT * FROM Orders WHERE CustomerID=123` takes a long time. What is the most likely reason?

A.The ORDER BY clause is missing.
B.Interleaving causes extra I/O.
C.The primary key is not optimized for this query.
D.The table needs a secondary index on CustomerID.
AnswerD

A secondary index on CustomerID enables direct lookup without scanning the entire table.

Why this answer

The query `SELECT * FROM Orders WHERE CustomerID=123` filters on the `CustomerID` column, but the primary key of the Orders table is likely defined on a different column (e.g., `OrderID`). Without a secondary index on `CustomerID`, Cloud Spanner must perform a full table scan to find matching rows, which is slow for large tables. Creating a secondary index on `CustomerID` allows Cloud Spanner to directly locate the relevant splits and rows, dramatically reducing latency.

Exam trap

The trap here is that candidates often assume a primary key is always the best way to query any column, but Cloud Spanner requires the query predicate to match the primary key order for efficient access; otherwise, a secondary index is necessary.

How to eliminate wrong answers

Option A is wrong because the absence of an ORDER BY clause does not cause a query to take a long time; it merely affects the order of results, not the scan method. Option B is wrong because interleaving (table interleaving in Cloud Spanner) is a design pattern that can improve performance by co-locating parent and child rows; it does not inherently cause extra I/O and is not relevant to a simple filter on a non-key column. Option C is wrong because the primary key is already defined; the issue is that the query predicate does not match the primary key order, so the primary key cannot be used efficiently for this filter.

137
MCQhard

A financial firm uses Cloud Spanner with a single-region configuration. They must meet regulatory requirements for disaster recovery across continents. They need to recover within 1 hour RTO and RPO of 5 minutes. Current workload: 50k writes/sec. What should they do?

A.Use cross-region backups with 5-minute retention.
B.Use Cloud SQL for MySQL with cross-region replicas.
C.Use multi-region configuration with synchronous replication across two continents.
D.Use export to Cloud Storage every 5 minutes.
AnswerC

Synchronous replication ensures near-zero RPO and automatic failover meets RTO.

Why this answer

Cloud Spanner's multi-region configuration uses synchronous replication across continents, providing strong consistency and automatic failover. This meets the 1-hour RTO and 5-minute RPO requirements for disaster recovery, as synchronous replication ensures data is durable across regions with minimal lag, and Spanner handles failover transparently without manual intervention.

Exam trap

The trap here is that candidates often confuse backup-based recovery (like exports or snapshots) with synchronous replication, failing to realize that only synchronous replication can meet strict RPOs like 5 minutes across continents without data loss.

How to eliminate wrong answers

Option A is wrong because cross-region backups with 5-minute retention cannot achieve a 5-minute RPO; backups are point-in-time snapshots and restoring them takes longer than 1 hour, failing the RTO. Option B is wrong because Cloud SQL for MySQL does not support cross-region replicas with synchronous replication; it uses asynchronous replication, which cannot guarantee a 5-minute RPO across continents due to replication lag. Option D is wrong because exporting to Cloud Storage every 5 minutes introduces significant latency and data loss risk; exports are not incremental and cannot meet the 5-minute RPO or 1-hour RTO, as restoring from exports requires manual import and is not designed for disaster recovery.

138
MCQmedium

An e-commerce site uses Cloud SQL for MySQL. They need read scalability for product catalog queries. What should they do?

A.Add read replicas
B.Partition tables
C.Use Cloud Spanner
D.Enable automatic storage increase
AnswerA

Read replicas serve read queries, reducing load on the primary.

Why this answer

Adding read replicas in Cloud SQL for MySQL offloads read traffic from the primary instance, providing horizontal read scalability for product catalog queries. Replicas asynchronously replicate data using MySQL's native binary log replication, allowing the primary to focus on writes while replicas handle read-heavy workloads.

Exam trap

The trap here is that candidates confuse vertical scaling (storage increase) or schema-level optimizations (partitioning) with horizontal read scaling, or incorrectly assume a fully distributed database like Spanner is required for simple read offloading.

How to eliminate wrong answers

Option B is wrong because partitioning tables (e.g., range or hash partitioning) improves query performance on large tables by reducing scan scope, but it does not add read capacity or offload traffic from the primary instance. Option C is wrong because Cloud Spanner is a globally distributed, strongly consistent relational database designed for horizontal write scalability and global transactions, which is overkill and cost-prohibitive for a simple read-scaling need on an existing MySQL workload. Option D is wrong because enabling automatic storage increase only prevents out-of-disk errors by expanding storage capacity; it does not improve read throughput or distribute query load.

139
MCQhard

An organization is using Cloud SQL for MySQL with automated backups enabled. They need to restore a backup to a new instance in a different region for testing. The backup is stored in the same region as the source. How can they achieve this with minimal operational overhead?

A.Use gcloud sql backups restore with the --restore-instance flag pointing to a new instance in the target region.
B.Create a cross-region read replica from the source, then promote it in the target region.
C.Restore the backup directly to a new instance in the target region using the Cloud Console.
D.Restore the backup to a new instance in the same region, then use export/import to move data to the target region.
AnswerD

Export/import is a reliable cross-region data movement method.

Why this answer

Cloud SQL backups are region-specific and cannot be restored directly to a different region. The minimal-operational-overhead approach is to restore the backup to a new instance in the same region, then use the export/import feature (e.g., SQL dump or CSV) to move the data to the target region. This avoids the complexity and cost of maintaining a cross-region read replica, while still achieving the goal with built-in tools.

Exam trap

Google often tests the misconception that Cloud SQL backups are globally accessible and can be restored to any region, when in fact they are region-locked and require an export/import workflow for cross-region data transfer.

How to eliminate wrong answers

Option A is wrong because the `gcloud sql backups restore` command does not support a `--restore-instance` flag; backups can only be restored to an existing instance in the same region, not to a new instance in a different region. Option B is wrong because creating a cross-region read replica and promoting it incurs ongoing replication costs and operational overhead (e.g., managing replication lag, failover), which is not minimal for a one-time testing need. Option C is wrong because the Cloud Console does not allow restoring a backup directly to a new instance in a different region; the restore operation is constrained to the same region as the backup.

140
Multi-Selecthard

Your company runs a global e-commerce platform on Cloud Spanner. You need to capture real-time changes to a table (e.g., orders) and stream them to a downstream analytics pipeline in near real-time. Which TWO Google Cloud features or services should you combine to achieve this? (Choose two.)

Select 2 answers
A.Cloud Functions
B.Dataflow streaming pipeline
C.Cloud Pub/Sub
D.Cloud SQL for PostgreSQL
E.Cloud Spanner change streams
AnswersB, E

Dataflow is the recommended service to read and process Spanner change streams.

Why this answer

A Dataflow streaming pipeline can consume Cloud Spanner change streams in near real-time, process the data (e.g., transform, filter, aggregate), and write it to a downstream analytics system. Dataflow provides exactly-once processing semantics and auto-scaling, making it ideal for continuous change data capture (CDC) pipelines.

Exam trap

The trap here is that candidates often confuse Cloud Pub/Sub as a required component for streaming, but Cloud Spanner change streams can be read directly by Dataflow without Pub/Sub, making Pub/Sub an unnecessary intermediate step for this specific use case.

141
MCQmedium

A DevOps team wants to reduce toil by automating manual, repetitive tasks that have no enduring value and scale with service growth. Which two characteristics define toil according to SRE principles?

A.It is strategic and non-repetitive
B.It is automated and provides enduring value
C.It is manual and has enduring value
D.It is repetitive and scales with service growth
AnswerD

Repetitiveness and scaling with growth are key characteristics of toil.

Why this answer

According to Google's SRE principles, toil is manual, repetitive, automatable, tactical (no enduring value), and scales with service growth. The question asks for two, so the correct answer pairs two of these.

142
Multi-Selecthard

A company is migrating a monolithic application to a microservices architecture and plans to use multiple Google Cloud databases. The application has the following workloads: (1) user profiles with high read/write concurrency, (2) product catalog with complex queries, (3) session data that requires low-latency access. Which three Google Cloud databases should be used? (Choose three.)

Select 3 answers
A.Firestore
B.Cloud SQL
C.Cloud Bigtable
D.Memorystore (Redis)
E.Cloud Spanner
AnswersA, B, D

Firestore handles high concurrency for user profiles.

Why this answer

Cloud SQL is correct for the product catalog with complex queries because it is a fully managed relational database that supports standard SQL, enabling complex joins and aggregations. Firestore is correct for user profiles with high read/write concurrency because it is a NoSQL document database that scales horizontally and provides strong consistency. Memorystore (Redis) is correct for session data requiring low-latency access because it is an in-memory cache delivering sub-millisecond response times.

Cloud Bigtable is designed for high-throughput time-series or key-value data, not complex queries, and Cloud Spanner is more suited for globally distributed transactional workloads.

Exam trap

Google often tests the misconception that Cloud Bigtable can handle both high concurrency and complex queries, but it is optimized for wide-column storage and simple key-based lookups, not relational queries or low-latency session caching.

143
MCQhard

A financial services company uses Cloud Spanner for a ledger application. The ledger table has a primary key of 'transaction_id' which is a monotonically increasing integer. During peak hours, they observe high write latencies due to hot spots on the last tablet. They need to redesign the schema to distribute writes evenly while still allowing efficient point lookups by transaction ID. What is the best approach?

A.Reverse the timestamp and use it as the primary key.
B.Use a UUID as the primary key to ensure randomness.
C.Use a composite primary key with a timestamp and a random number.
D.Use a composite primary key with a hash prefix of the transaction ID as the first component, followed by the transaction ID.
AnswerD

The hash prefix evenly distributes writes, and the transaction ID allows efficient point lookups.

Why this answer

Using a hash prefix of the transaction ID as the first component of a composite primary key distributes writes across multiple tablets in Cloud Spanner, avoiding hot spots on a single tablet. The transaction ID as the second component still enables efficient point lookups by transaction ID, as Spanner can use the hash prefix to locate the tablet and then scan within it for the exact row.

Exam trap

A common mistake in Google Cloud Spanner design is thinking that simply adding randomness (like a UUID or random number) solves hot spots, but this fails to consider that the primary key must still support efficient point lookups by the original identifier, which a composite key with a hash prefix achieves.

How to eliminate wrong answers

Option A is wrong because reversing a timestamp does not guarantee even distribution; timestamps often have low cardinality in the leading digits, leading to similar reversed values and continued hot spots. Option B is wrong because a UUID as the primary key, while random, is not a composite key and would require a full table scan for point lookups by transaction ID, as the UUID replaces the transaction ID. Option C is wrong because a composite primary key with a timestamp and a random number does not directly support efficient point lookups by transaction ID; the transaction ID is not part of the key, so lookups would require scanning or a secondary index.

144
MCQmedium

You need to design a Cloud Bigtable row key for a time-series application that records user activity. The most common queries filter by user_id and then by timestamp (most recent first). Which row key design is MOST appropriate?

A.user_id#timestamp
B.user_id#reverse_timestamp
C.reverse_timestamp#user_id
D.timestamp#user_id
AnswerB

This ensures data for a user is together and the most recent entry comes first.

Why this answer

For time-series with frequent queries filtering by user_id and recent data, the recommended design is to put user_id first and then use a reverse timestamp. This ensures data for a user is co-located and the latest data appears first when scanning.

145
MCQmedium

A Cloud Firestore database in Native mode is used for a mobile app. The app queries a collection with a composite filter on two fields. Queries are slow and the app shows an error that an index is required. What should the developer do?

A.Use a database export and import to regenerate indexes.
B.Create a composite index in the Firebase Console or gcloud CLI.
C.Restructure the data to use a single field for the filter.
D.Enable the automatic index creation in the Firestore settings.
AnswerB

Composite indexes are manually created and are required for multi-field queries.

Why this answer

Cloud Firestore requires an index to support composite filters (queries filtering on multiple fields). When a query uses a composite filter and no matching index exists, Firestore returns an error indicating an index is required. The correct solution is to create the necessary composite index manually via the Firebase Console or the gcloud CLI, as Firestore does not automatically create composite indexes for queries with equality and range filters on different fields.

Exam trap

Google often tests the misconception that Firestore automatically creates all necessary indexes, but in reality, only single-field indexes are auto-created; composite indexes must be manually defined by the developer.

How to eliminate wrong answers

Option A is wrong because exporting and importing the database does not regenerate indexes; it only moves data and existing index definitions, not create new ones. Option C is wrong because restructuring data to use a single field would change the query logic and may not satisfy the app's requirements, and it avoids the proper solution of creating the needed composite index. Option D is wrong because Firestore automatically creates single-field indexes but does not automatically create composite indexes; enabling automatic index creation is not a setting available in Firestore.

146
Multi-Selectmedium

A Memorystore for Redis instance needs to be scaled to handle increased traffic. Which TWO methods can you use? (Choose 2)

Select 2 answers
A.Increase the maxmemory parameter.
B.Change the eviction policy to allkeys-lru.
C.Vertically scale by changing the tier to a larger machine type.
D.Horizontally scale by enabling Redis Cluster (clustering) for sharding.
E.Add read replicas in the same zone.
AnswersC, D

Memorystore supports vertical scaling by changing the tier.

147
Multi-Selectmedium

A company wants to enforce least-privilege IAM for their DevOps team. They need to grant permissions to manage Compute Engine instances but not to delete them. Which TWO approaches should they use?

Select 2 answers
A.Use a predefined role with an IAM condition that denies delete operations.
B.Grant the `roles/compute.instanceAdmin.v1` role.
C.Grant the `roles/owner` role at the project level.
D.Grant the `roles/compute.admin` role.
E.Create a custom role with only the necessary permissions (e.g., compute.instances.create, compute.instances.update) and assign it.
AnswersA, E

Conditions can be used to restrict actions even with predefined roles.

Why this answer

Predefined roles like `roles/compute.instanceAdmin.v1` include delete permissions. Custom roles allow fine-grained selection of specific permissions. Predefined roles with conditions can restrict actions (e.g., prevent delete), but conditions can be complex.

The simplest is to create a custom role with only the required permissions (e.g., compute.instances.create, etc., but not delete).

148
MCQhard

A game company uses Cloud Bigtable to store player session data. Access patterns include looking up a player's most recent sessions and scanning sessions by time range. Which row key design is most appropriate?

A.Use only player ID as row key with column qualifiers for timestamps.
B.Use a row key of player ID followed by reversed timestamp.
C.Prefix with timestamp and append player ID.
D.Use a hash of player ID as row key and store timestamps in cell versions.
AnswerB

Player ID distributes writes across tablets; reversed timestamp makes recent data appear at the start of the range for efficient scans.

Why this answer

It leverages Cloud Bigtable's sorted row key structure to group all sessions for a given player ID together, while the reversed timestamp ensures that the most recent session appears first within that group. This design enables efficient point lookups for a player's latest sessions and supports range scans over time ranges by using the timestamp portion of the key.

Exam trap

The trap here is that candidates often think hashing or using timestamps as a prefix will distribute load evenly, but they overlook that the primary access pattern requires grouping by player ID and ordering by time, which the reversed timestamp suffix elegantly satisfies.

How to eliminate wrong answers

Option A is wrong because using only player ID as the row key with column qualifiers for timestamps would create a single row per player that grows unboundedly, leading to hotspotting and poor performance as the number of sessions increases. Option C is wrong because prefixing with timestamp would scatter a single player's sessions across many tablets, making it impossible to efficiently retrieve all sessions for a player without a full table scan. Option D is wrong because hashing the player ID destroys the natural ordering of sessions, preventing efficient time-range scans, and relying on cell versions for timestamps is not designed for querying by time range and can lead to data loss due to garbage collection.

149
MCQmedium

A GKE cluster runs a mix of batch and latency-sensitive services. The batch jobs require occasional large CPU bursts, but the latency-sensitive services need consistent performance. The team wants to avoid CPU contention without over-provisioning nodes. Which approach should they take?

A.Configure a PodDisruptionBudget for the latency-sensitive services
B.Use Vertical Pod Autoscaler (VPA) for all pods
C.Create separate node pools: one with high-CPU machines for batch jobs and one with general-purpose machines for latency-sensitive services, and use taints/tolerations
D.Use Horizontal Pod Autoscaler (HPA) with CPU target
AnswerC

Separate node pools with taints ensure batch jobs run on appropriate hardware and do not interfere with other services.

Why this answer

Node pools with different machine types allow separating workloads onto appropriate hardware. Using taints and tolerations ensures that batch pods only run on the batch node pool, preventing interference with latency-sensitive services on the general pool. This approach avoids over-provisioning by right-sizing each pool.

VPA and HPA adjust resources/replicas but do not prevent CPU contention between different workloads on the same node. PDBs control disruptions, not resource contention.

150
Multi-Selecthard

A data team is migrating an Oracle database to Cloud SQL for PostgreSQL. They have used Ora2Pg to convert the schema. After conversion, they notice several issues with data type mappings. Which THREE Oracle-to-PostgreSQL mappings are correct? (Choose 3)

Select 3 answers
A.VARCHAR2(10) -> TEXT
B.DATE -> DATE
C.NUMBER(10,2) -> NUMERIC(10,2)
D.DATE -> TIMESTAMP
E.NUMBER(10) -> INTEGER
AnswersC, D, E

Correct mapping: same precision and scale.

Why this answer

NUMBER(10) -> INTEGER, NUMBER(10,2) -> NUMERIC(10,2), DATE -> TIMESTAMP are correct. CLOB -> TEXT is also correct but only three needed.

Page 1

Page 2 of 20

Page 3