Courseiva

Google Professional Cloud Database Engineer (PCDE) — Questions 676750

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

Page 9

Page 10 of 20

Page 11
676
MCQeasy

Your Memorystore for Redis instance needs to survive a zonal failure with minimal data loss. Which feature should you use?

A.Use a Basic tier instance and schedule periodic exports to Cloud Storage.
B.Use a Standard tier instance with replication across zones within the same region.
C.Enable persistence with RDB snapshots stored in Cloud Storage.
D.Create a cross-region replica (read replica in another region).
AnswerB

Standard tier provides multi-AZ replication for high availability.

Why this answer

A Standard tier Memorystore for Redis instance with replication across zones provides automatic failover to a replica in a different zone, ensuring high availability and minimal data loss during a zonal failure. The Standard tier uses synchronous replication within the region, so data written to the primary is replicated to the cross-zone replica before acknowledging the write, which minimizes data loss to only in-flight transactions that were not yet committed.

Exam trap

Google Cloud often tests the misconception that persistence (RDB/AOF) alone provides high availability, but persistence only protects against data loss from restarts, not against zonal failures; you need cross-zone replication (Standard tier) for automatic failover and minimal data loss during a zone outage.

How to eliminate wrong answers

Option A is wrong because Basic tier instances are single-zone and lack replication, so a zonal failure causes complete data loss; periodic exports to Cloud Storage only provide point-in-time recovery with potential data loss between exports, not real-time failover. Option C is wrong because enabling persistence with RDB snapshots stored in Cloud Storage is a backup mechanism, not a high-availability feature; it does not provide automatic failover or replication, so a zonal failure still results in downtime and data loss from the last snapshot. Option D is wrong because cross-region replicas (read replicas) are read-only and do not support automatic failover in Memorystore for Redis; they are designed for read scaling and disaster recovery across regions, not for surviving a zonal failure within the same region with minimal data loss.

677
MCQeasy

Your team is migrating an on-premises PostgreSQL database to Cloud SQL for PostgreSQL. The current schema uses table inheritance, which is not fully supported in Cloud SQL. What should you do to minimize application changes?

A.Continue using inheritance as Cloud SQL supports it fully
B.Use PostgreSQL foreign data wrappers to emulate inheritance
C.Use materialized views to combine data
D.Redesign the schema using separate tables with joins
AnswerD

Standard approach; can use views to simulate inheritance for read operations.

Why this answer

Cloud SQL for PostgreSQL does not support table inheritance, a PostgreSQL-specific feature that allows child tables to inherit columns from a parent table. Option D is correct because redesigning the schema using separate tables with joins is the standard relational approach that works across all PostgreSQL deployments, including Cloud SQL, and minimizes application changes by preserving the logical data model.

Exam trap

Google often tests the misconception that Cloud SQL for PostgreSQL is a fully compatible drop-in replacement for on-premises PostgreSQL, but table inheritance is a notable exception that requires schema redesign.

How to eliminate wrong answers

Option A is wrong because Cloud SQL for PostgreSQL does not fully support table inheritance; it is a known limitation documented by Google Cloud. Option B is wrong because foreign data wrappers (FDW) are used to access remote tables, not to emulate inheritance; they introduce network latency and complexity without solving the schema design issue. Option C is wrong because materialized views are read-only snapshots that do not support DML operations (INSERT/UPDATE/DELETE) on the underlying data, making them unsuitable for transactional workloads.

678
MCQhard

A company uses Cloud Profiler to identify performance bottlenecks. They notice that the CPU profile shows a function consuming high CPU, but they want to see the corresponding source code lines. What must they enable?

A.Enable flame graphs in the Profiler settings
B.Enable debug symbols in the application build
C.Instrument the application with OpenTelemetry SDK
D.Increase the Profiler sampling rate
AnswerB

Correct. Debug symbols (e.g., -g for Go, or /DEBUG for .NET) allow Profiler to map addresses to source lines.

Why this answer

Cloud Profiler can display source code locations if the application is built with debug symbols and the source code is available. For Google Cloud services, it automatically shows line numbers. For custom applications, you need to ensure the binary includes debug information (e.g., -g flag for Go, or pdb files for .NET).

Profiler does not require OpenTelemetry, Flame graphs are a visualization, not a requirement, and sampling rate is unrelated.

679
MCQeasy

A marketing team uses a BigQuery BI dashboard to analyze campaign performance. The table campaign_performance is 5 TB, partitioned by date, clustered by campaign_id. Queries filter on date range and campaign_id, and are fast. However, one query that joins this table with a user_dimensions table (10 GB, not partitioned) takes too long. The join is on user_id. What is the best improvement?

A.Denormalize user_dimensions into campaign_performance.
B.Cluster user_dimensions by user_id.
C.Partition user_dimensions by date.
D.Use a broadcast join hint.
AnswerA

Denormalizing adds user_dimension columns to the large table, avoiding the expensive join.

Why this answer

User_dimensions is only 10 GB, small relative to the 5 TB campaign_performance table. Denormalizing the user_dimensions data into campaign_performance eliminates the expensive join entirely, which is the most impactful improvement since joins on large tables are costly. Option B (clustering user_dimensions by user_id) can improve join performance but still requires a full shuffle; however, denormalization is superior.

Option C (partitioning user_dimensions by date) does not help because the join is on user_id, not date. Option D (using a broadcast join hint) can help if the small table is broadcast, but the join still occurs; denormalization avoids the join altogether.

680
MCQmedium

You are designing a dashboard for application latency. You want to visualize the distribution of latency values across different services using a chart that shows percentiles over time. Which chart type should you use?

A.Scatter chart
B.Stacked bar chart
C.Line chart
D.Heatmap chart
AnswerD

Heatmaps display distributions over time, ideal for visualizing percentiles and patterns.

Why this answer

A heatmap chart can show the distribution of values over time, with color intensity representing count. It allows visualizing percentiles and patterns. Line charts show trends, stacked bar shows component totals, and scatter shows individual data points.

681
MCQeasy

A DevOps engineer needs to create a custom IAM role that allows only the permission to create Compute Engine instances, but not to modify or delete them. What is the best practice for defining this role?

A.Create a custom role with permission `compute.instances.create`.
B.Use the predefined role `roles/compute.instanceAdmin.v1` and remove permissions.
C.Create a custom role with permission `compute.instances.*`.
D.Use the predefined role `roles/compute.instanceAdmin` and restrict it with conditions.
AnswerA

This grants exactly the required permission.

Why this answer

Custom roles are created with a list of permissions. To allow creation only, the role should include the `instances.create` permission. It should not include `instances.update`, `instances.delete`, or wildcards.

682
MCQmedium

An engineer uses Cloud Build with a private pool to build an application that needs to connect to a Cloud SQL database. The build step fails with a connection timeout. What is the most likely cause?

A.The Cloud Build service account lacks permissions to connect to Cloud SQL
B.The database name is incorrect
C.The private pool is not peered with the VPC that contains the Cloud SQL instance
D.The Cloud SQL instance requires SSL
AnswerC

Without VPC peering, the build cannot reach Cloud SQL, causing timeout.

Why this answer

A private Cloud Build pool runs in a customer-managed VPC, so it must be peered with the VPC hosting the Cloud SQL instance to establish network connectivity. Without VPC peering, the build step cannot reach the Cloud SQL private IP, resulting in a connection timeout. This is the most likely cause because the error is a timeout, not an authentication or configuration issue.

Exam trap

Google Cloud often tests the distinction between network connectivity failures (timeouts) and authentication/configuration errors (access denied, SSL errors) to see if candidates understand that a timeout points to a routing or firewall issue, not a permissions or SQL syntax problem.

How to eliminate wrong answers

Option A is wrong because a connection timeout indicates the network path is blocked, not that the service account lacks permissions; permissions would cause an access denied error, not a timeout. Option B is wrong because an incorrect database name would produce a database-specific error (e.g., 'unknown database') from the SQL client, not a connection timeout. Option D is wrong because SSL enforcement would cause a TLS handshake failure or an SSL-specific error, not a generic timeout; the build step could still establish a TCP connection before the SSL negotiation fails.

683
MCQmedium

A team is migrating a relational database to Cloud Bigtable. They need to design a row key that distributes write traffic evenly across nodes. The original table had a composite primary key of customer_id and order_date. Which row key design is BEST for high write throughput?

A.customer_id # order_date
B.hash(customer_id) # customer_id # order_date
C.order_date # customer_id
D.customer_id only
AnswerB

The hash prefix distributes writes evenly while preserving query ability on customer_id.

Why this answer

Adding a hash prefix (salting) to the row key distributes writes across multiple tablet servers, avoiding hotspots. The customer_id alone may cause hotspots if some customers are more active.

684
MCQmedium

A team wants to inject latency faults into their microservices running on Google Kubernetes Engine (GKE) to test resilience. Which tool or service should they use?

A.Cloud Build to orchestrate failure scenarios
B.Chaos Mesh
C.Traffic Director fault injection with HTTP fault filter
D.Cloud Functions to simulate latency by delaying responses
AnswerB

Chaos Mesh is purpose-built for chaos engineering on Kubernetes, including latency injection.

Why this answer

Chaos Mesh is a popular open-source chaos engineering platform for Kubernetes, capable of injecting faults like latency, pod failures, and network partitions. It integrates well with GKE.

685
Multi-Selecthard

You are designing a monitoring strategy for a hybrid cloud environment where on-premises services send metrics to Cloud Monitoring via the Monitoring API. The on-premises network has limited outbound connectivity and can only reach Google Cloud through a few static IPs. You need to ensure that custom metrics are ingested reliably and cost-effectively. Which THREE actions should you take? (Choose 3)

Select 3 answers
A.Use a service account with roles/monitoring.metricWriter on the on-premises application
B.Enable Cloud NAT to provide outbound connectivity
C.Configure VPC Service Controls to restrict data exfiltration
D.Set up a Cloud VPN tunnel between on-premises and VPC
E.Use Cloud Monitoring's Agent to pull metrics from on-premises
AnswersA, C, D

The service account is used to authenticate API calls from on-premises.

Why this answer

To handle limited connectivity, using a Cloud VPN tunnel ensures secure and reliable connectivity. The Monitoring API requires authentication via a service account, and a VPC Service Controls perimeter can protect data exfiltration. Pushing metrics from on-premises is the standard approach.

Pulling is not supported.

686
MCQmedium

A company runs a GKE cluster for a web application. During peak traffic, the application experiences increased latency. The team has enabled the Horizontal Pod Autoscaler (HPA) based on CPU utilization, but the scaling is not fast enough. Which approach would improve the responsiveness of the HPA?

A.Decrease the HPA sync period from 15 seconds to 5 seconds.
B.Decrease the CPU target utilization from 80% to 50%.
C.Increase the HPA sync period from 15 seconds to 60 seconds.
D.Increase the stabilization window from 5 minutes to 10 minutes.
AnswerA

A shorter sync period allows the HPA to evaluate metrics more frequently, scaling faster.

Why this answer

Decreasing the HPA sync period makes the controller evaluate metrics more frequently, reducing the time to react to load changes. Increasing stabilization window delays scaling up, making it worse.

687
MCQmedium

A company uses Cloud Bigtable for a real-time analytics pipeline. They have configured replication with a primary cluster in us-central1 and a secondary cluster in us-west1. They want to minimize data loss during a failover to the secondary cluster. What is the best approach to achieve the lowest possible RPO?

A.Use single-cluster routing with failover priority set to the secondary cluster.
B.Use any-replica routing and let Cloud Bigtable automatically direct reads and writes to the healthiest cluster.
C.Use single-cluster routing and regularly back up the Bigtable data.
D.Use multi-cluster routing with read-failover enabled and direct all writes to the primary cluster.
AnswerD

This configuration ensures writes go to primary (minimizing replication lag) and reads automatically fail over to secondary when primary is unhealthy, minimizing data loss.

Why this answer

Bigtable replication is asynchronous, so RPO is determined by replication lag. To minimize data loss, you should route writes to the primary cluster and use read-failover routing to consume from the secondary only when primary is unhealthy. During failover, switch writes to secondary manually.

688
MCQmedium

A DevOps engineer wants to automatically trigger a Cloud Build pipeline when a pull request is opened against the main branch. The pipeline should run unit tests and provide results as a status check on the PR. Which type of trigger should they configure?

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

Pull request triggers are designed for PR events and can report status checks.

Why this answer

A pull request trigger is the correct choice because it is specifically designed to initiate a Cloud Build pipeline in response to PR events, such as when a PR is opened or updated. This allows the pipeline to run unit tests and report results as a status check on the PR, providing immediate feedback to developers. The trigger can be configured to fire only for PRs targeting the main branch, ensuring the pipeline runs exactly when needed.

Exam trap

Google Cloud often tests the distinction between push-to-branch triggers and pull request triggers, where candidates mistakenly choose push triggers because they think 'opening a PR is like pushing to a branch,' but a PR event is a separate webhook that requires a dedicated trigger type.

How to eliminate wrong answers

Option B is wrong because a scheduled trigger runs the pipeline at fixed times (e.g., daily or hourly), not in response to a pull request event, so it cannot provide real-time status checks on a PR. Option C is wrong because a manual trigger requires a user to explicitly start the pipeline via the console or API, which defeats the goal of automatic triggering when a PR is opened. Option D is wrong because a push to branch trigger fires when commits are pushed directly to a branch, not when a pull request is opened; it would run tests on the branch itself but not tie results to a PR status check.

689
MCQhard

A company is migrating an Oracle database to Cloud SQL for PostgreSQL using Ora2Pg for schema conversion. After conversion, they want to test the correctness of converted stored procedures. Which tool should they use?

A.Database Migration Service validation
B.Ora2Pg --test flag
C.pgTAP
D.Cloud SQL Insights
AnswerC

pgTAP is a testing framework that can validate stored procedures and functions.

Why this answer

pgTAP is a unit testing framework for PostgreSQL that allows writing tests for functions, procedures, and other database objects.

690
MCQeasy

A data engineer is building a BI reporting layer in BigQuery. The source data includes JSON logs with nested fields. Analysts need to query nested arrays efficiently. Which approach is best?

A.Use SQL and UNNEST to directly query nested arrays.
B.Load the data into separate tables for each array.
C.Flatten all nested fields into separate tables.
D.Create a view that flattens the data.
AnswerA

UNNEST expands arrays efficiently without physically flattening storage.

Why this answer

BigQuery natively supports nested and repeated fields via the UNNEST operator, which flattens arrays into rows for SQL-based querying. This approach leverages BigQuery's columnar storage and efficient array handling, allowing analysts to query nested arrays directly without data duplication or additional ETL, which is optimal for BI reporting performance.

Exam trap

The trap here is that candidates assume flattening data into separate tables or views is always necessary for SQL compatibility, but BigQuery's UNNEST provides native, efficient array querying without data restructuring.

How to eliminate wrong answers

Option B is wrong because loading nested arrays into separate tables introduces data redundancy and requires complex JOIN operations, increasing query latency and maintenance overhead compared to BigQuery's native nested structure. Option C is wrong because flattening all nested fields into separate tables discards the relational context of nested data, leading to data duplication and loss of query efficiency that UNNEST provides. Option D is wrong because creating a view that flattens data does not change the underlying storage; it still requires UNNEST at query time and adds no performance benefit, while a view can obscure the schema and complicate debugging.

691
MCQhard

An e-commerce platform uses Cloud SQL for PostgreSQL with max_connections set to 500. They plan to increase the number of application instances requiring connections. The instance has 8 vCPUs and 32 GB RAM. What is the maximum number of connections Cloud SQL can support based on the default formula?

A.2048
B.4096
C.1024
D.500
AnswerA

The default formula for Cloud SQL for PostgreSQL is max_connections = min(4 * vCPUs + 100, 2048). With 8 vCPUs, the raw value is 132, but the cap of 2048 sets the maximum possible connections. Thus, the answer is 2048.

Why this answer

Cloud SQL for PostgreSQL uses a default formula to calculate max_connections: max_connections = min(4 * vCPUs + 100, 2048) for PostgreSQL instances. With 8 vCPUs, the raw calculation gives 132, but the cap of 2048 governs the maximum allowed. Since the question asks for the maximum based on the default formula, the correct answer is the cap value of 2048.

Candidates often mistakenly use the raw formula output (132) or confuse with MySQL's cap (4096).

Exam trap

Google Cloud often tests the distinction between Cloud SQL for PostgreSQL and MySQL caps; the trap here is that candidates assume the formula output is the final answer, or they confuse the PostgreSQL cap (2048) with MySQL's cap (4096).

How to eliminate wrong answers

Option B (4096) is wrong because Cloud SQL for PostgreSQL caps max_connections at 2048, not 4096; 4096 is the default limit for Cloud SQL for MySQL, not PostgreSQL. Option C (1024) is wrong because it is not the cap for PostgreSQL; it might be confused with the default formula result for a different vCPU count (e.g., 4 * 231 + 100 = 1024, but 231 vCPUs is unrealistic). Option D (500) is wrong because it simply repeats the current setting from the question, ignoring that Cloud SQL's default formula and cap override the user-configured value when determining the maximum supported.

692
MCQmedium

A company uses AlloyDB for PostgreSQL for their operational database. They want to ensure automatic failover with the shortest possible RTO. Which configuration should they use?

A.Deploy a single-zone AlloyDB cluster with a read pool
B.Configure a cross-region read replica and set up automated promotion scripts
C.Use an AlloyDB basic (single-node) instance
D.Deploy a multi-zone AlloyDB cluster with automatic failover enabled
AnswerD

AlloyDB's multi-zone cluster provides automatic failover to a standby in another zone, with RTO typically under 30 seconds.

Why this answer

AlloyDB provides automatic failover with RTO under 60 seconds. Cross-zone failover in a multi-zone cluster provides the best availability within a region. Cross-region replication is not automatic and requires manual promotion.

Basic instances offer no HA. Read pool failover is not automatic.

693
MCQeasy

A company runs a production Cloud SQL for PostgreSQL instance. They need to ensure high availability with automatic failover in case of a zone failure. Which configuration should they use?

A.Create a cross-region read replica and set it as failover target.
B.Use a zonal HA configuration by selecting a regional location.
C.Deploy a single Cloud SQL instance with multiple CPUs and high memory.
D.Enable high availability (HA) configuration during instance creation.
AnswerD

Cloud SQL HA provisions a standby in a different zone, with synchronous replication for automatic failover.

Why this answer

Enabling the high availability (HA) configuration during Cloud SQL for PostgreSQL instance creation automatically provisions a standby instance in a different zone within the same region. This synchronous replication setup ensures automatic failover with minimal data loss (typically under 1 second RPO) in the event of a zone failure, meeting the requirement for high availability.

Exam trap

Google Cloud often tests the misconception that a read replica can serve as a failover target for high availability, but in Cloud SQL, read replicas are asynchronous and require manual promotion, making them unsuitable for automatic zone-level failover.

How to eliminate wrong answers

Option A is wrong because a cross-region read replica is designed for read scaling and disaster recovery, not for automatic failover within the same region; failover to a cross-region replica would require manual promotion and introduces significant latency and potential data loss. Option B is wrong because 'zonal HA configuration' is not a valid Cloud SQL term; the correct approach is to use a regional HA configuration, which places the primary and standby in different zones automatically. Option C is wrong because scaling up CPUs and memory improves performance but does not provide any redundancy or automatic failover; a single instance remains a single point of failure.

694
MCQeasy

Which Google Cloud database service is designed for hybrid transactional and analytical processing (HTAP) with a built-in columnar engine?

A.BigQuery
B.Cloud SQL
C.Cloud Spanner
D.AlloyDB for PostgreSQL
AnswerD

AlloyDB includes a columnar engine for fast analytical queries on transactional data.

Why this answer

AlloyDB for PostgreSQL is a fully managed database with a columnar engine that accelerates analytical queries on transactional data. Cloud Spanner offers an analytics interface, but AlloyDB explicitly mentions a columnar engine for HTAP.

695
MCQmedium

An SRE team defines an SLI as the proportion of good requests to valid requests over a 1-minute window. They set an SLO of 99.9% availability over 30 days. Which error budget burn rate alert configuration should they use to detect rapid consumption of the error budget within 1 hour?

A.Alert on burn rate of 14x over a 1-hour window
B.Alert on burn rate of 2x over a 24-hour window
C.Alert on burn rate of 10x over a 30-minute window
D.Alert on burn rate of 5x over a 6-hour window
AnswerA

14x over 1h is the recommended fast burn alert configuration for SLO monitoring.

Why this answer

A fast burn alert uses a short window (1h) and a high burn rate (14x) to detect rapid error budget consumption quickly.

696
MCQhard

A Cloud Spanner database has a table 'Orders' with a column 'status'. The development team needs to add a new column 'priority INT64' to the table without downtime. Which statement should the database administrator execute?

A.CREATE INDEX idx_priority ON Orders (priority);
B.UPDATE Orders SET priority = 0; (no prior column)
C.ALTER TABLE Orders ADD priority INT64 NOT NULL DEFAULT 0;
D.ALTER TABLE Orders ADD COLUMN priority INT64;
AnswerD

Correct. This DDL statement adds the column online, non-blocking.

Why this answer

Spanner supports online schema changes that are non-blocking. ALTER TABLE ... ADD COLUMN is the correct DDL statement and executes without locking the table.

697
Multi-Selecteasy

Which TWO strategies reduce query costs for ad-hoc analysis in BigQuery? (Choose two.)

Select 2 answers
A.Use LIMIT 10 to preview data.
B.Use clustered tables on frequently filtered columns.
C.Use a flat table without partitioning.
D.Use SELECT * in all queries.
E.Use materialized views for common aggregations.
AnswersB, E

Clustering allows pruning of blocks.

Why this answer

Clustered tables in BigQuery physically sort data based on the specified columns, which allows the query engine to skip entire blocks of data that don't match filter predicates. This reduces the amount of data scanned and thus lowers query costs for ad-hoc analysis. Option E is correct because materialized views precompute and store the results of common aggregations, so queries against them only read the precomputed results rather than scanning the base table, significantly reducing bytes processed.

Exam trap

Google Cloud often tests the misconception that LIMIT reduces cost (it does not in BigQuery's serverless architecture) and that denormalized or flat tables are cheaper (they are not because they increase scan size).

698
Multi-Selectmedium

Which TWO options are valid ways to authenticate to Artifact Registry from a CI/CD pipeline? (Choose two.)

Select 2 answers
A.Configure Workload Identity federation for the CI provider
B.Use the Docker credential helper (gcloud auth configure-docker)
C.Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account key
D.Use gcloud auth login with user credentials
E.Use a service account JSON key in the pipeline
AnswersA, B

Workload Identity allows external workloads to impersonate a service account.

Why this answer

Workload Identity federation allows non-GCP CI systems to authenticate, and the Docker credential helper is used for Docker authentication.

699
MCQhard

A team uses Cloud Build with a private pool to build a Docker image that requires access to a Cloud SQL instance. The build fails because the builder cannot connect to the database. The network configuration uses VPC Service Controls. What is the MOST likely cause and solution?

A.Cloud SQL requires public IP; change to public IP and allowlist the builder's IP.
B.The Cloud Build service account lacks the Cloud SQL Client role; grant the role.
C.The private pool is in a different region; move the pool or Cloud SQL to the same region.
D.The private pool is not peered with the VPC containing Cloud SQL; set up VPC peering.
AnswerD

Private pools require VPC peering to access resources in the same VPC.

Why this answer

The most likely cause is that the private pool's underlying VPC is not peered with the VPC that hosts the Cloud SQL instance. Cloud Build private pools run in a Google-managed VPC, and to access resources in your own VPC (such as Cloud SQL), you must establish VPC peering between the two. Without this peering, the builder cannot route traffic to the Cloud SQL instance, even if VPC Service Controls are configured correctly.

Exam trap

Google Cloud often tests the distinction between IAM permissions (who can connect) and network connectivity (how to reach the resource), leading candidates to mistakenly choose a missing IAM role when the actual issue is a missing VPC peering or network route.

How to eliminate wrong answers

Option A is wrong because Cloud SQL can use private IP (RFC 1918) when connected via VPC peering, and requiring public IP would defeat the purpose of VPC Service Controls; also, allowlisting a builder's IP is not applicable for private pools. Option B is wrong because the Cloud SQL Client role grants permission to connect to the instance, but if the network path is blocked (no peering), IAM permissions alone cannot establish connectivity. Option C is wrong because private pools and Cloud SQL instances can be in different regions as long as VPC peering is configured and global routing is enabled; region mismatch is not the root cause here.

700
MCQmedium

Your team uses PagerDuty for incident notifications. You need to configure Cloud Monitoring to send alerts to PagerDuty. Which notification channel type should you select?

A.Slack
B.Cloud Pub/Sub
C.SMS
D.PagerDuty
AnswerD

PagerDuty is a supported notification channel type in Cloud Monitoring.

Why this answer

Cloud Monitoring supports PagerDuty as a notification channel type directly. You can configure it by providing the PagerDuty integration key. No other channel types (email, Slack, Pub/Sub) are needed.

701
MCQmedium

A DevOps team uses Terraform Cloud to manage infrastructure. They want to enforce that all Terraform plans must pass a set of policy checks before they can be applied. The policies include restricting resource types and ensuring proper tagging. Which Terraform Cloud feature should they use?

A.Use Terraform Cloud's Cost Estimation feature.
B.Use Terraform Cloud's Run Triggers to chain workspaces.
C.Use Terraform Cloud's Sentinel policies.
D.Use Terraform Cloud's API to run custom scripts after plan.
AnswerC

Sentinel is designed for policy enforcement in Terraform Cloud/Enterprise.

Why this answer

Sentinel is Terraform Cloud's policy-as-code framework. It allows writing policies (in Sentinel language) that are evaluated during the plan phase. Policies can enforce constraints on resources and tags.

702
MCQeasy

A data engineer is designing a BigQuery schema for a time-series dataset of IoT sensor readings. The queries will filter primarily on a timestamp column and also on sensor_id. To optimize query performance and cost, which table design is best?

A.Partition by timestamp, cluster by sensor_id
B.Partition by sensor_id, cluster by timestamp
C.Partition by timestamp, cluster by timestamp
D.No partitioning, cluster by timestamp
AnswerA

Reduces scan to relevant partitions and optimizes filtering on sensor_id.

Why this answer

Partitioning by timestamp allows BigQuery to prune entire partitions when queries filter on the timestamp column, reducing the amount of data scanned and thus lowering cost and improving performance. Clustering by sensor_id further organizes data within each partition, enabling block-level pruning for queries that filter on sensor_id. This combination optimizes for the primary filter (timestamp) and secondary filter (sensor_id) without the overhead of excessive partitions.

Exam trap

Google Cloud often tests the misconception that clustering can replace partitioning for time-based filtering, but in reality, partitioning is essential for pruning entire storage blocks, while clustering only optimizes within partitions.

How to eliminate wrong answers

Option B is wrong because partitioning by sensor_id would create a partition for each unique sensor_id, which can lead to a very large number of small partitions (exceeding BigQuery's partition limit of 4,000 per table) and does not optimize for the primary timestamp filter. Option C is wrong because clustering by timestamp when already partitioned by timestamp provides no additional benefit—clustering is redundant and wastes resources since partitioning already prunes by timestamp. Option D is wrong because no partitioning means every query must scan the entire table, even when filtering on timestamp, leading to higher costs and slower performance; clustering alone cannot prune entire partitions.

703
MCQmedium

A company is migrating an on-premises PostgreSQL database to Cloud SQL for PostgreSQL. The database uses several custom PL/pgSQL functions that perform complex calculations. The migration must minimize application changes and support high availability. Which strategy should the database engineer use for the schema migration?

A.Convert the functions to stored procedures in Cloud Spanner and migrate data separately.
B.Export the functions as SQL scripts and convert them to pgSQL syntax for Cloud SQL.
C.Export the functions as SQL scripts and rewrite them in JavaScript using Cloud Functions.
D.Use pg_dump to export the schema including functions and restore directly to Cloud SQL.
AnswerD

pg_dump preserves PL/pgSQL functions; restore works in Cloud SQL.

Why this answer

Pg_dump can export the entire PostgreSQL schema, including custom PL/pgSQL functions, in a format that Cloud SQL for PostgreSQL natively understands. Restoring directly with pg_restore or psql preserves the functions without requiring syntax conversion, minimizing application changes. Cloud SQL for PostgreSQL supports high availability through regional persistent disks and automatic failover replicas, meeting the HA requirement without altering the schema.

Exam trap

Google Cloud often tests the misconception that PL/pgSQL functions need to be converted or rewritten for Cloud SQL, when in fact Cloud SQL for PostgreSQL is a fully managed PostgreSQL service that supports the same procedural language natively.

How to eliminate wrong answers

Option A is wrong because Cloud Spanner does not support PL/pgSQL functions or stored procedures with the same syntax; migrating to Spanner would require rewriting all functions and changing application queries, violating the 'minimize application changes' requirement. Option B is wrong because PL/pgSQL is already the native procedural language for PostgreSQL; exporting as SQL scripts and 'converting to pgSQL syntax' is unnecessary and implies a false need for syntax conversion, as Cloud SQL for PostgreSQL uses the same PostgreSQL engine. Option C is wrong because rewriting PL/pgSQL functions in JavaScript using Cloud Functions would require significant application refactoring to call external HTTP-triggered functions instead of inline database functions, breaking the 'minimize application changes' constraint.

704
Multi-Selecteasy

Which TWO factors are important when selecting the location for a Cloud Spanner instance?

Select 2 answers
A.Number of other Spanner instances in the region
B.Data residency compliance
C.Proximity to users
D.Cost of Cloud Spanner nodes in the region
E.Availability of Cloud VPN
AnswersB, C

Some regulations require data to remain within specific geographical boundaries.

Why this answer

Data residency compliance (B) is critical because Cloud Spanner instances are regional resources; data is stored and processed within the chosen Google Cloud region, and many regulations (e.g., GDPR, HIPAA) mandate that data remain within specific geographic boundaries. Proximity to users (C) is important because Spanner's read and write latencies are directly affected by network distance; choosing a region close to your user base minimizes latency and improves application performance.

Exam trap

Google Cloud often tests the misconception that cost (Option D) or the number of existing instances (Option A) are primary location factors, when in reality the official Google Cloud documentation emphasizes data residency and user proximity as the two key considerations for single-region Spanner instance placement.

705
MCQmedium

An engineer needs to reduce toil. Which of the following tasks is considered toil according to SRE principles?

A.Writing a postmortem after an incident
B.Manually rotating service account keys every week
C.Designing a new microservice architecture
D.Reviewing code changes for a new feature
AnswerB

Repetitive, manual, can be automated — fits toil definition.

Why this answer

Toil is manual, repetitive, automatable, and has no enduring value. Manually rotating service account keys weekly is a classic example of toil.

706
MCQeasy

A team wants to implement policy-as-code to check Terraform plans for compliance before deployment. They prefer an open-source tool that works with any CI/CD pipeline and can evaluate policies expressed in Rego. Which tool should they use?

A.Conftest
B.Cloud Deployment Manager
C.Sentinel
D.Cloud Build
AnswerA

Conftest uses OPA/Rego and is open-source, suitable for any CI/CD.

Why this answer

Conftest is a CLI tool that uses OPA/Rego to evaluate configuration files and Terraform plans. It is open-source and can be integrated into CI/CD. Sentinel is proprietary to Terraform Cloud.

Cloud Build is not a policy engine.

707
Multi-Selectmedium

Which TWO statements about Cloud Spanner schema changes are correct? (Choose 2)

Select 2 answers
A.Schema changes are applied asynchronously and may take minutes to hours to complete.
B.Schema changes require the instance to be restarted.
C.ALTER TABLE statements are non-blocking and can be executed while the database is in use.
D.You can only add columns, not drop them.
E.Creating a secondary index requires taking the table offline.
AnswersA, C

Schema changes are applied in the background and can take time depending on data size.

708
MCQhard

A team uses Cloud Build private pools to build Docker images that need access to on-premises resources via VPC peering. The build step fails with a 'connection refused' error. What is the most likely missing configuration?

A.The build step is using a wrong Docker image
B.The private pool does not have a route to the on-premises network
C.The Cloud Build service account lacks permissions to use the private pool
D.The on-premises firewall is blocking egress from GCP
AnswerB

Private pools use VPC networks; without proper routing (e.g., VPC peering or Cloud VPN), the on-premises network is unreachable.

709
Multi-Selecthard

A Cloud Spanner database is experiencing high CPU utilization and latency. The workload is read-heavy with occasional writes. Which TWO actions would most effectively improve performance?

Select 2 answers
A.Create a secondary index on frequently queried columns.
B.Use a smaller instance configuration to reduce cost.
C.Add more nodes to the instance.
D.Use a split point to distribute hot rows.
E.Enable interleaved tables to reduce joins.
AnswersA, C

Indexes reduce the need for full table scans, lowering CPU usage and query latency.

Why this answer

Creating a secondary index on frequently queried columns allows Cloud Spanner to serve read queries directly from the index without scanning the full base table, reducing CPU usage and latency. This is especially effective in read-heavy workloads because it minimizes the number of rows that must be processed per query.

Exam trap

Google Cloud often tests the misconception that manual split points or interleaved tables are primary tools for read performance tuning, when in fact Spanner handles splits automatically and interleaving is mainly for write locality and join optimization.

710
MCQeasy

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

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

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

Why this answer

A pull request trigger in Cloud Build is specifically designed to initiate a build when a pull request is created or updated against a target branch, such as main. This trigger type evaluates the PR event and automatically runs the pipeline, enabling validation of proposed changes before merging.

Exam trap

Google often tests the distinction between push triggers (which react to commits) and pull request triggers (which react to PR events), trapping candidates who confuse a push to a branch with the creation of a pull request.

How to eliminate wrong answers

Option A is wrong because a push to branch trigger fires on direct commits or merges to a branch, not on pull request creation events; it would run the build only after code is already pushed to main, missing the pre-merge validation. Option C is wrong because a scheduled trigger runs builds at specified times (e.g., cron-based), independent of any code changes or pull request events, so it cannot respond to PR creation. Option D is wrong because a manual trigger requires explicit user invocation via the console or API, providing no automation for PR-based events.

711
MCQeasy

A Cloud Bigtable instance has a hot spot causing performance degradation. Which tool helps identify the hot spot?

A.Cloud Monitoring dashboard
B.Cloud Logging
C.Key Visualizer
D.Bigtable Admin API
AnswerC

Key Visualizer is specifically designed to analyze access distribution and detect hot spots.

Why this answer

Key Visualizer is a built-in Bigtable tool that visualizes access patterns and helps identify hot spots (uneven load across row keys).

712
MCQeasy

A BI team queries this table with a WHERE clause that filters on product_id but does not include a sale_date filter. What is the outcome?

A.The query fails with an error.
B.The query runs successfully and only scans partitions containing product_id values.
C.The query runs successfully and scans only the latest partition.
D.The query runs successfully but scans all partitions.
AnswerD

The query runs successfully and scans all partitions because no partition pruning is possible.

Why this answer

In BigQuery, when a table is partitioned on sale_date but the WHERE clause filters only on product_id (without sale_date), the query cannot prune partitions. Without the require_partition_filter option, the query runs successfully but scans all partitions. Option D correctly describes this outcome.

Exam trap

Candidates often assume that any column filter enables partition pruning, but only the partition key can prune partitions. Without require_partition_filter, omitting the partition key results in a full scan, not an error.

How to eliminate wrong answers

Option B is wrong because scanning only partitions containing specific `product_id` values would require partition pruning on `product_id`, which is not a partition key; partition pruning only works on the partition column (`sale_date`). Option C is wrong because scanning only the latest partition assumes an implicit default or a system behavior that does not exist; without a `sale_date` filter, the engine has no basis to select a single partition. Option D is wrong because while a full partition scan is a common outcome in many systems, the question explicitly states the query fails with an error, indicating a stricter environment (e.g., a system that enforces partition key inclusion in WHERE clauses) where the query is rejected rather than executed.

713
MCQeasy

A mobile app backend uses Firestore for user profiles. The schema has a single collection 'users' where each document contains: user_id (used as document ID), name, email, and friends (an array of user IDs). The friends array can grow large (thousands of IDs). When a user adds a friend, the application updates the array, causing the document to grow and leading to write contention and size limit warnings. The team needs to redesign the schema to scale better. What is the best approach?

A.Move the friends list to a subcollection under each user document.
B.Migrate user profiles and friendships to Cloud SQL for relational capabilities.
C.Limit the maximum size of the friends array to 1000 at the application level.
D.Create a new 'friendships' collection with documents containing user_id_1 and user_id_2 fields.
AnswerD

A separate collection for relationships scales well and avoids large documents.

Why this answer

It normalizes the friendship relationship into a separate 'friendships' collection, where each document represents a single bidirectional link between two users. This avoids unbounded document growth and write contention on user documents, as adding a friend only requires a small write to a new friendship document rather than updating a potentially large array. Firestore's 1 MiB document size limit and 1 write per second per document limit are no longer risk factors.

Exam trap

The trap here is that candidates often assume subcollections (Option A) are the universal solution for nested data growth, but they fail to recognize that subcollections still tie writes to a parent document's write limit and do not solve the array-size problem; the correct approach is to normalize the relationship into a separate top-level collection.

How to eliminate wrong answers

Option A is wrong because moving the friends list to a subcollection still requires updating a parent document (or a subcollection document that can grow) and does not eliminate the fundamental issue of array growth and write contention; subcollections are not inherently better for large arrays and still suffer from the same per-document write limits. Option B is wrong because migrating to Cloud SQL is an overengineered solution that introduces relational complexity and operational overhead, while Firestore is fully capable of handling this relationship with a normalized collection design; the question asks for a schema redesign within Firestore, not a database migration. Option C is wrong because arbitrarily limiting the array size to 1000 at the application level is a brittle workaround that does not solve the underlying scalability problem and may break user functionality; it also fails to address write contention on the document.

714
MCQeasy

A company is designing a star schema for a BI dashboard that tracks sales performance. The dashboard needs to aggregate sales by product, store, and date. Which schema design is most appropriate?

A.Store all data in a single table using nested JSON arrays for product and store details
B.Create a single wide table with all attributes (product, store, date, sales)
C.Create a fact table with foreign keys to dimension tables for product, store, and date
D.Use a fully normalized snowflake schema with separate tables for each level of hierarchy
AnswerC

A star schema with fact and dimension tables is the standard for BI reporting, enabling fast aggregations.

Why this answer

A star schema uses a central fact table with foreign keys to dimension tables, which is optimal for BI aggregation queries. Option A is wrong because a single wide table with all attributes leads to data redundancy and slower queries. Option B is wrong because a fully normalized schema (e.g., snowflake) introduces extra joins that can slow BI queries.

Option D is wrong because storing data as JSON arrays in a single table is not suitable for efficient SQL aggregation.

715
MCQeasy

You are monitoring a Cloud Spanner instance and see that the average commit latency is high. The application performs many single-row inserts. Which metric would you check first to understand the root cause?

A.Read latency.
B.Lock conflicts (e.g., Spanner/API/Lock_wait).
C.Storage utilization.
D.CPU utilization per node.
AnswerB

Lock conflicts directly indicate contention causing commit delays.

Why this answer

High commit latency for single-row inserts in Cloud Spanner is often caused by lock conflicts, as concurrent transactions may contend for the same row or index. The metric Spanner/API/Lock_wait directly measures time spent waiting for locks, making it the first metric to check. High commit latency without high lock wait suggests other issues, but lock conflicts are the most common root cause for write-heavy single-row workloads.

Exam trap

Google Cloud often tests the misconception that CPU or storage metrics are the first indicators of write performance issues, when in fact lock contention is the primary driver for high commit latency in transactional workloads.

How to eliminate wrong answers

Option A is wrong because read latency measures time for read operations, not write commit latency, and single-row inserts are writes. Option C is wrong because storage utilization affects capacity and cost, not commit latency directly; Spanner handles storage scaling automatically. Option D is wrong because CPU utilization per node indicates compute load but does not directly measure lock contention, which is the primary cause of high commit latency for single-row inserts.

716
Multi-Selectmedium

You have a Memorystore for Redis instance used as a cache. You need to scale it to handle increased load. The current instance is Basic Tier with 2 GB memory. Which TWO actions can you take to scale the instance? (Choose two.)

Select 2 answers
A.Vertically scale the instance by increasing its memory size or changing to a higher-tier (e.g., Standard Tier).
B.Create additional instances and implement client-side sharding.
C.Change the eviction policy to noeviction to allow more data.
D.Add read replicas to offload read traffic.
E.Enable Redis Cluster to horizontally scale across multiple shards.
AnswersA, E

Vertical scaling increases capacity by adding more memory to a single node.

Why this answer

Memorystore supports vertical scaling by increasing memory size or changing to a higher tier (e.g., Basic to Standard, or Standard to Standard with more memory) – this is option A. Horizontal scaling is achieved by enabling Redis Cluster, which automatically shards data across multiple nodes – this is option E. Option B (creating additional instances with client-side sharding) is not a supported scaling method for Memorystore because it requires manual management and is not integrated with the service.

Option C (changing eviction policy to noeviction) does not scale the instance and risks data loss when memory is full. Option D (adding read replicas) is available only in Standard Tier, but it offloads read traffic, not scales the cache capacity.

717
MCQmedium

Your Cloud Run service experiences cold starts that add 5 seconds of latency to user requests. You want to eliminate cold starts for a baseline traffic level of 10 requests per second. The service uses about 2 GiB of memory. What should you do?

A.Use the Gen2 execution environment to reduce cold start time.
B.Increase the concurrency to 1 to minimize instance count.
C.Set minInstances to 2 to keep instances always warm.
D.Set CPU always-on to keep the instance active.
AnswerC

minInstances keeps the specified number of instances always running, eliminating cold starts for baseline traffic.

Why this answer

Cloud Run cold starts can be eliminated by setting a minimum number of instances that are always warm. The minInstances flag ensures that the specified number of instances are always running and ready to serve requests. For a baseline of 10 RPS, you need to estimate how many instances are needed; but the question asks to eliminate cold starts, so setting minInstances to at least 1 (or more) will keep instances warm.

Setting CPU always-on does not eliminate cold starts. Gen2 execution environment may reduce cold start time but not eliminate them.

718
MCQmedium

An SRE team wants to reduce toil by automating the response to common alert notifications. For example, when a disk usage alert fires, they want to automatically run a script to clean up temporary files. Which Google Cloud service is best suited for this?

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

Cloud Functions can be triggered by Cloud Monitoring alert notifications via Pub/Sub to execute a cleanup script.

Why this answer

Cloud Functions can be triggered by Cloud Monitoring alerts via Pub/Sub and execute arbitrary code (e.g., script to clean disk). This is a common pattern for automated remediation. Workflows could orchestrate multiple steps but adds complexity.

Cloud Build is CI/CD, not event-driven. Cloud Scheduler is for scheduled tasks.

719
MCQmedium

A company is migrating an application from Datastore to Firestore in Datastore mode. They need to ensure zero downtime during the migration. What is the recommended approach?

A.Export all data from Datastore to Cloud Storage, then import into a new Firestore database.
B.Run both Datastore and Firestore in parallel, writing to both until migration is complete.
C.Create a new Firestore database and redirect traffic gradually.
D.Upgrade the existing Datastore project to Firestore in Datastore mode using the Cloud Console.
AnswerD

Firestore in Datastore mode is a seamless upgrade with full compatibility.

Why this answer

Upgrading an existing Datastore project to Firestore in Datastore mode via the Cloud Console is a built-in, one-way migration that preserves the existing database name, indexes, and data without requiring any export/import or application code changes. This process is designed to be a live upgrade with no downtime, as Firestore in Datastore mode is fully backward-compatible with the Datastore API, allowing existing queries and transactions to continue uninterrupted during the transition.

Exam trap

The trap here is that candidates often assume a migration requires an export/import or dual-write strategy, but Google tests the specific knowledge that Firestore in Datastore mode is a direct upgrade path from Datastore with zero downtime, not a separate service that needs data copied over.

How to eliminate wrong answers

Option A is wrong because exporting all data to Cloud Storage and then importing into a new Firestore database introduces significant downtime during the export and import operations, and it does not preserve the original database name or existing indexes without manual reconfiguration. Option B is wrong because running both Datastore and Firestore in parallel and writing to both is not a supported approach; there is no built-in mechanism to dual-write to Datastore and Firestore simultaneously, and this would require complex application-level changes and risk data inconsistency. Option C is wrong because creating a new Firestore database and redirecting traffic gradually still requires a cutover period where the application must be modified to point to the new database, and the existing Datastore data must be migrated separately, causing downtime or data staleness during the transition.

720
MCQhard

An engineer needs to deploy an application to Cloud Run with a canary traffic split: 95% to the stable revision and 5% to a new revision. They also want to test the new revision with specific headers without affecting user traffic. Which approach meets these requirements?

A.Deploy the new revision with a tag and use traffic splitting with --to-revisions
B.Use Cloud Load Balancing with URL maps to route 5% of traffic
C.Deploy the new revision without any tag and use gcloud run services update-traffic
D.Use a separate Cloud Run service for the canary and split traffic via HTTP redirects
AnswerA

Deploy with a tag allows testing via the tag URL, and traffic splitting can route a percentage of traffic to the new revision.

721
MCQeasy

What is the primary purpose of an error budget?

A.To track the number of bugs in production
B.To allocate budget for cloud resources
C.To measure customer satisfaction
D.To determine how much risk the service can tolerate while maintaining the SLO
AnswerD

Error budget = 100% - SLO; it defines the maximum allowed downtime/errors before violating the SLO.

Why this answer

An error budget is the amount of acceptable unreliability (e.g., downtime) within an SLO. It allows teams to balance reliability with innovation by permitting some failures.

722
MCQmedium

An organization wants to enforce that no Compute Engine VM has an external IP address. Which approach should be used?

A.Use an organization policy with constraint `compute.vmExternalIpAccess`
B.Set IAM roles to deny `compute.instances.create` on all projects
C.Configure a firewall rule to block all traffic to 0.0.0.0/0
D.Use Shared VPC and only allow internal IPs
AnswerA

This policy prevents VMs from having external IPs.

Why this answer

The organization policy constraint `compute.vmExternalIpAccess` is specifically designed to prevent Compute Engine VMs from being assigned external IP addresses. This policy can be applied at the organization, folder, or project level to enforce that no VM in the scope can have an external IP, regardless of how the VM is created. It directly addresses the requirement without affecting other resources or relying on indirect controls.

Exam trap

The trap here is that candidates often confuse network-level controls (firewall rules or Shared VPC) with resource-level enforcement, thinking that blocking traffic or using internal-only networks prevents the VM from having an external IP, when in fact the VM can still be assigned an external IP but simply be unreachable.

How to eliminate wrong answers

Option B is wrong because denying `compute.instances.create` prevents all VM creation, which is overly restrictive and does not specifically target external IP assignment; VMs could still be created with external IPs if the permission is granted elsewhere. Option C is wrong because a firewall rule blocking traffic to `0.0.0.0/0` would block all outbound traffic, not just external IP assignment, and does not prevent a VM from being configured with an external IP address; the VM would still have an external IP but be unable to communicate. Option D is wrong because Shared VPC only controls network configuration and internal IP assignment, but it does not enforce that VMs cannot have external IPs; users could still attach external IPs to VMs in the Shared VPC if not explicitly prohibited.

723
MCQmedium

A company uses BigQuery for BI reporting. They have a table 'orders' with columns: order_id, customer_id, order_date, amount, status. The BI team frequently runs queries that filter on order_date and group by customer_id to compute total sales per customer. Which partitioning and clustering strategy optimizes query performance and cost?

A.Partition by order_date, cluster by status
B.Do not partition, cluster by customer_id
C.Partition by customer_id, cluster by order_date
D.Partition by order_date, cluster by customer_id
AnswerD

Partitioning on order_date prunes partitions for date filters; clustering on customer_id improves group by performance.

Why this answer

Partitioning by order_date allows BigQuery to prune partitions for queries filtering on order_date, reducing the amount of data scanned. Clustering by customer_id organizes data within each partition so that GROUP BY customer_id queries can efficiently read only relevant blocks, minimizing shuffle and cost. This combination directly aligns with the BI team's query pattern of filtering by date and aggregating by customer.

Exam trap

Google Cloud often tests the misconception that clustering alone is sufficient for performance, ignoring that partitioning is essential for date-range filters to avoid full table scans, or that clustering on a high-cardinality column like customer_id is ideal for GROUP BY but must be paired with a partition key that matches the filter pattern.

How to eliminate wrong answers

Option A is wrong because clustering by status does not optimize the GROUP BY on customer_id, and status is not used in filtering or grouping, so it provides no benefit for the described workload. Option B is wrong because without partitioning, queries filtering on order_date must scan the entire table, increasing cost and latency, even if clustering by customer_id helps the GROUP BY. Option C is wrong because partitioning by customer_id is not practical (high cardinality, many small partitions) and does not help date-range filtering, while clustering by order_date does not optimize the GROUP BY on customer_id.

724
MCQmedium

A company is migrating a MySQL 5.7 database to Cloud SQL for MySQL 8.0 using Database Migration Service (DMS). The source database has binary logging disabled. The team needs to perform a continuous migration with minimal downtime. What must be done before creating the DMS migration job?

A.Create a Cloud SQL Auth Proxy connection to the source.
B.Create a service account with Cloud SQL Admin role.
C.Enable binary logging on the source MySQL instance.
D.Set up VPC peering between the source network and Cloud SQL.
AnswerC

Binary logging must be enabled for DMS to support continuous (CDC) migration.

Why this answer

DMS continuous migration requires binary logging enabled on the source to capture ongoing changes via CDC. Without it, DMS can only perform a one-time dump. Thus, enabling binary logging is a prerequisite.

725
Multi-Selecthard

You need to reduce the cost of Cloud Monitoring custom metrics while retaining the ability to create alerts on those metrics. Which THREE actions should you take? (Choose three.)

Select 3 answers
A.Use GAUGE metric kind instead of DELTA or CUMULATIVE
B.Use OpenTelemetry SDK to batch metric reports
C.Set a longer alignment period in your alerting policy
D.Report custom metrics every 60 seconds instead of every 10 seconds
E.Use distribution metric kind to aggregate data
AnswersA, B, D

GAUGE metrics only report when value changes, reducing samples.

Why this answer

Custom metrics are charged per sample. Using GAUGE metrics reduces sample count as DELTA and CUMULATIVE require periodic reporting. Increasing the sampling interval reduces volume.

Using OpenTelemetry allows batching. Setting longer alignment periods in alerts reduces query cost. Using distribution metrics may increase cost due to multiple buckets.

726
MCQeasy

You are a database engineer for an e-commerce company. The company uses BigQuery for its BI and analytics. The data pipeline stages raw event data into a table 'raw_events' with columns: event_id, user_id, event_time, event_type, and a JSON string 'event_data'. The BI team wants to query this data for user behavior analysis, but the JSON parsing makes queries slow. They need to perform frequent queries that extract specific fields from the JSON and filter by event_time. The table 'raw_events' is not partitioned and has 2 billion rows. What is the most effective single step to improve query performance and reduce cost?

A.Create a view that extracts JSON fields into columns
B.Partition the table on event_time and cluster on event_type
C.Increase BigQuery slots to maximum
D.Use a materialized view to precompute common queries
AnswerB

Partitioning reduces scanned data; clustering helps with event_type filters.

Why this answer

Partitioning the table on event_time allows BigQuery to prune entire partitions when queries filter by event_time, drastically reducing the amount of data scanned. Clustering on event_type further organizes data within each partition, enabling block-level pruning for queries that filter or aggregate by event_type. This combination directly addresses the slow JSON parsing and high cost by minimizing scanned bytes, which is the most effective single step for a 2-billion-row table.

Exam trap

Google Cloud often tests the misconception that a view or materialized view alone can solve performance issues, but the trap here is that without physical data reorganization (partitioning and clustering), the underlying full table scan and JSON parsing remain the bottleneck.

How to eliminate wrong answers

Option A is wrong because a view does not physically reorganize data; it only stores a query definition, so the underlying table still requires full scans and JSON parsing on every query, providing no performance or cost benefit. Option C is wrong because increasing BigQuery slots only improves concurrency and execution speed for compute-bound queries, but does not reduce the amount of data scanned; the bottleneck here is I/O from scanning billions of rows, not CPU. Option D is wrong because a materialized view would precompute results, but it still requires the base table to be partitioned and clustered to be efficient; without partitioning, the materialized view would need to scan the entire table on refresh, and it cannot dynamically prune partitions for ad-hoc filters on event_time.

727
Multi-Selecteasy

A data engineering team wants to monitor BigQuery query performance and slot utilization. Which TWO tools or features should they use? (Choose two.)

Select 2 answers
A.INFORMATION_SCHEMA tables (e.g., JOBS_BY_PROJECT)
B.Cloud Monitoring (Metrics like 'bigquery.googleapis.com/scheduler/slot_allocation')
C.Cloud Logging (audit logs)
D.bq command-line tool with the '--format=prettyjson' flag
E.Cloud Profiler
AnswersA, B

INFORMATION_SCHEMA provides historical query performance and slot usage.

Why this answer

INFORMATION_SCHEMA tables like `JOBS_BY_PROJECT` provide detailed metadata about query execution, including slot usage, job timing, and user-level performance metrics. This allows the team to analyze historical query performance and identify inefficiencies directly within BigQuery without external tools.

Exam trap

Candidates often mistakenly choose audit logs for performance data because they conflate 'logging' with 'monitoring'. However, Cloud Logging audit logs focus on administrative activities, not detailed query performance metrics.

728
MCQmedium

An SRE team wants to track the amount of toil each week and ensure it does not exceed 50% of the team's time. Which approach is most aligned with SRE best practices?

A.Use Cloud Monitoring to automatically classify all tasks as toil
B.Use Cloud Tasks to queue up toil items and measure completion time
C.Have each team member log their time and estimate toil percentage weekly
D.Set a Cloud Scheduler job to remind team members to automate toil
AnswerC

This is the standard practice: self-estimation and tracking.

Why this answer

SRE best practice is to have team members estimate and track toil time weekly, aiming for under 50%. Using a simple spreadsheet is a valid approach to start.

729
MCQhard

A company is migrating a legacy on-premises MySQL database to Cloud SQL for PostgreSQL. The database uses composite primary keys on multiple tables and heavily relies on cross-table joins with foreign keys. The team wants to minimize application code changes during migration. Which schema design strategy should the Cloud Database Engineer recommend to ensure compatibility and performance?

A.Maintain the same schema and rewrite joins as materialized views in PostgreSQL to optimize queries.
B.Use the same composite primary keys and foreign key constraints in Cloud SQL for PostgreSQL, leveraging its full support for these features.
C.Migrate to Cloud Spanner instead, using interleaved tables to replace join-heavy operations.
D.Remove composite primary keys and replace them with surrogate keys; use look-up tables for foreign key relationships.
AnswerB

Cloud SQL for PostgreSQL fully supports composite primary keys and foreign keys, minimizing application changes.

Why this answer

Cloud SQL for PostgreSQL fully supports composite primary keys and foreign key constraints, which are standard SQL features. By maintaining the same schema, the team minimizes application code changes while preserving referential integrity and join performance, as PostgreSQL's query planner handles these constructs efficiently.

Exam trap

For the Google Cloud Professional Cloud Database Engineer exam, candidates may assume that migrating to Cloud SQL for PostgreSQL requires schema redesign, but PostgreSQL’s full SQL compliance allows direct lift-and-shift of composite keys and foreign keys, minimizing application code changes.

How to eliminate wrong answers

Option A is wrong because materialized views are not a direct replacement for joins; they store precomputed results and require manual refresh, which adds complexity and does not eliminate the need for application code changes to query the views instead of the original tables. Option C is wrong because migrating to Cloud Spanner would require significant schema redesign (e.g., denormalization into interleaved tables) and application code changes, contradicting the goal of minimizing changes. Option D is wrong because removing composite primary keys and replacing them with surrogate keys would break existing application logic that relies on composite keys for joins and lookups, requiring extensive code modifications.

730
Multi-Selecthard

A team uses Cloud Monitoring SLOs for a service that has an SLO of 99.9% availability. They want to create alerts that notify the on-call engineer when the error budget is burning too fast. Which TWO conditions should they configure? (Choose 2.)

Select 2 answers
A.30-minute window with 20x burn rate
B.24-hour window with 2x burn rate
C.1-hour window with 14x burn rate
D.6-hour window with 5x burn rate
E.1-hour window with 5x burn rate
AnswersC, D

Fast burn alert: 1h window, 14x burn rate.

Why this answer

Standard SRE practice recommends a multi-window, multi-burn-rate alerting strategy: a fast burn rate alert with a 1-hour window and 14x burn rate, and a slow burn rate alert with a 6-hour window and 5x burn rate. These two alerts cover different exhaustion times.

731
MCQeasy

An organization wants to enforce that all Compute Engine instances are created in a specific set of regions. Which Google Cloud feature should be used?

A.Organization policies
B.VPC Service Controls
C.IAM conditions
D.Firewall rules
AnswerA

Organization policies with the `gcp.resourceLocations` constraint can restrict the regions where resources can be created.

Why this answer

Organization policies allow you to set constraints on resources, such as the allowed locations for resource creation. The constraint `gcp.resourceLocations` restricts the regions where resources can be created.

732
MCQeasy

A database administrator needs to restore a Cloud SQL for PostgreSQL instance to a specific point in time within the last 3 hours. Which configurations must be enabled to perform a point-in-time recovery (PITR)?

A.Automated backups and binary logging
B.On-demand backups and binary logging
C.Automated backups and WAL archiving with a retention period
D.Automated backups and cross-region replicas
AnswerC

Correct. PITR requires automated backups and WAL archiving (transaction logs) with retention between 1-7 days.

Why this answer

PITR in Cloud SQL for PostgreSQL requires automated backups enabled and write-ahead log (WAL) archiving with a specified transaction log retention period (1-7 days). Binary logging is for MySQL, not PostgreSQL.

733
Multi-Selecthard

Which THREE metrics should you set up alerts for to proactively monitor the health of a Cloud SQL for MySQL instance? (Choose 3)

Select 3 answers
A.Replication lag (for instances with replicas)
B.Number of queries per second
C.CPU utilization > 80%
D.Network throughput
E.Disk usage
AnswersA, C, E

Replication lag indicates data consistency and is a key health metric for instances with replicas.

Why this answer

Replication lag (for instances with replicas) is critical because high lag can cause stale reads and data inconsistency. CPU utilization above 80% indicates resource exhaustion, leading to performance degradation. Disk usage must be monitored to prevent storage full conditions that can cause instance downtime.

These three metrics directly reflect instance health, whereas queries per second and network throughput are more related to workload performance, not health.

Exam trap

Google often tests the distinction between metrics that indicate instance health (e.g., replication lag, CPU utilization, disk usage) versus metrics that indicate performance or throughput (e.g., queries per second, network throughput), leading candidates to select the latter as health indicators.

734
Multi-Selecteasy

Which two of the following are best practices when designing BigQuery schemas? (Choose two.)

Select 2 answers
A.Use column-level security to restrict access
B.Use denormalization to reduce the number of joins
C.Use the type RECORD for structured data
D.Use repeated fields to avoid joins when querying parent-child data
E.Use a single table for all data to simplify queries
AnswersB, D

Denormalization improves query performance by reducing joins.

Why this answer

Best practices in BigQuery schema design include denormalization (option B) to reduce joins and improve query performance, and using repeated fields (option D) to model parent-child relationships without expensive JOIN operations. Options A and C are incorrect: column-level security (option A) is a data governance feature, not a schema design best practice; using RECORD type (option C) is a way to model nested data but is not a standalone best practice—repeated fields are more appropriate for avoiding joins. Option E is incorrect because using a single table for all data leads to poor performance and maintenance issues; BigQuery supports multiple tables and logical data models.

735
MCQmedium

A company is running a financial application on Cloud Spanner and needs to ensure strong transactional consistency across regions. The application requires both high write throughput (2000 mutations/second) and read throughput (2000 reads/second). According to Spanner capacity planning, how many processing units (PUs) are needed for the combined workload?

A.2 processing units (PUs)
B.4 processing units (PUs)
C.0.5 processing units (PUs)
D.1 processing unit (PU)
AnswerD

One PU provides 2000 writes/s and 2000 reads/s, exactly matching the requirement.

Why this answer

Spanner capacity: write throughput 2000 mutations/second per PU, read throughput 2000 reads/second per PU. For 2000 writes/s and 2000 reads/s, you need 1 PU for writes and 1 PU for reads, but the reads and writes share the same PU. Actually, the formula is: PUs needed = max(write_throughput/2000, read_throughput/2000).

For 2000 each, that's max(1,1)=1 PU. However, the question states 'high write throughput (2000 mutations/second) and read throughput (2000 reads/second)'. So 1 PU is sufficient.

But note: in practice, you might need more for other factors. The question tests the calculation. The answer is 1 PU.

736
Multi-Selecthard

An organization wants to enforce policy as code for Terraform configurations. Which TWO tools can be used to validate Terraform plans against custom policies before apply? (Choose 2)

Select 2 answers
A.Cloud Build
B.Cloud Audit Logs
C.gcloud CLI
D.Open Policy Agent (OPA) with Conftest
E.Sentinel
AnswersD, E

OPA/Conftest can evaluate policies against Terraform plans.

Why this answer

Sentinel is a policy-as-code framework for Terraform Enterprise/Cloud, and OPA (Open Policy Agent) with Conftest can be used to evaluate policies against Terraform plans or HCL files. Both can be integrated into CI/CD.

737
MCQeasy

A company wants to store and analyze data with BigQuery. They have customers in Europe and need to comply with GDPR data residency requirements. What should they do to ensure data stays within the European Union?

A.Use the default dataset location and rely on BigQuery's automatic compliance.
B.Create the dataset with the location set to 'EU'.
C.Set the query job location to 'EU' for all queries.
D.Choose a dataset location of 'us-central1' for performance.
AnswerB

Dataset location determines where data is stored.

Why this answer

BigQuery enforces data residency at the dataset level. When you create a dataset with the location set to 'EU', all tables, views, and data within that dataset are physically stored in a Google Cloud region within the European Union. This ensures compliance with GDPR data residency requirements, as data will not be moved or replicated outside the EU without explicit user action.

Exam trap

Google Cloud often tests the misconception that query job location controls data residency, when in fact it only controls query processing location, while data storage is determined by the dataset location.

How to eliminate wrong answers

Option A is wrong because the default dataset location is 'US', which stores data in the United States and does not automatically comply with GDPR data residency requirements; BigQuery does not have an 'automatic compliance' feature. Option C is wrong because setting the query job location to 'EU' only affects where the query is processed, not where the underlying data is stored; data could still reside in a non-EU dataset. Option D is wrong because 'us-central1' is a location in the United States, which would violate GDPR data residency requirements by storing data outside the European Union.

738
Multi-Selecthard

Which TWO optimizations best address slow join performance caused by excessive broadcasting in BigQuery? (Choose two.)

Select 2 answers
A.Use a large query timeout.
B.Set the dimension table to be very large to prevent broadcast.
C.Increase the number of slots.
D.Use a materialized view that pre-joins the tables.
E.Cluster the fact table on the join key.
AnswersD, E

Materialized views avoid runtime joins.

Why this answer

A materialized view can pre-compute and store the join result, eliminating the need to re-execute the join at query time. This avoids the overhead of broadcasting the dimension table repeatedly, as the materialized view is incrementally refreshed and queried directly, reducing both shuffle and broadcast costs.

Exam trap

Google Cloud often tests the misconception that increasing resources (slots or timeout) or making a table larger can fix join performance issues, when the correct approach is to restructure the data or use pre-computed results like materialized views.

739
MCQhard

A company's application using Cloud Bigtable is experiencing high read latency. The row keys are based on a timestamp prefix. Which design change is most likely to improve performance?

A.Increase the number of column families.
B.Use a single node cluster.
C.Use monotonically increasing row keys.
D.Reverse the timestamp in row keys to distribute writes.
AnswerD

Reversing the timestamp spreads writes across tablets, reducing hot spots and improving read latency.

Why this answer

In Cloud Bigtable, monotonically increasing row keys (like timestamps) cause all writes to hit a single tablet server, creating a hotspot that degrades read and write performance. Reversing the timestamp (e.g., using `Long.MAX_VALUE - timestamp`) distributes writes across the key space, preventing hotspots and reducing read latency by balancing load across nodes.

Exam trap

Google Cloud often tests the misconception that adding more nodes or column families solves performance issues, when the real fix is designing row keys to avoid hotspots by distributing writes evenly across the key space.

How to eliminate wrong answers

Option A is wrong because increasing column families does not address the root cause of hotspotting from sequential row keys; column families affect storage and schema design, not write distribution. Option B is wrong because a single node cluster would exacerbate the problem by concentrating all traffic on one node, increasing latency further. Option C is wrong because monotonically increasing row keys are exactly the pattern that causes hotspotting in Bigtable; this option describes the problematic behavior, not a fix.

740
MCQhard

A company uses Argo CD on GKE for GitOps deployments. They want to ensure that when a developer pushes a change to a Kubernetes manifest, Argo CD automatically syncs the cluster. What must be configured?

A.Use a Cloud Build trigger to run `argocd app sync`
B.Configure a webhook in the git repository that notifies Argo CD of changes
C.Set the sync policy to Automatic with Prune
D.Enable Config Sync instead of Argo CD for automatic sync
AnswerB

Webhook triggers immediate sync.

Why this answer

Argo CD can be configured to automatically sync a cluster when a developer pushes a change to a Kubernetes manifest by setting up a webhook in the Git repository. The webhook notifies Argo CD of the push event, triggering a sync operation without manual intervention or polling. This is the standard GitOps pattern for event-driven synchronization.

Exam trap

A common misconception is that setting the sync policy to 'Automatic' alone enables immediate sync, but automatic sync relies on polling (default 3 minutes) unless a webhook is configured for real-time notification.

How to eliminate wrong answers

Option A is wrong because using a Cloud Build trigger to run `argocd app sync` introduces an unnecessary external CI step that bypasses Argo CD's native webhook mechanism, adding latency and complexity. Option C is wrong because setting the sync policy to Automatic with Prune only enables periodic polling (default 3 minutes) or manual sync, not real-time event-driven sync from a Git push. Option D is wrong because Config Sync is a separate Google Cloud tool for GitOps on GKE, not a configuration within Argo CD, and the question specifically asks about using Argo CD.

741
MCQmedium

You need to monitor the number of ERROR-level log entries in Cloud Logging and trigger an alert when the count exceeds 100 in 5 minutes. Which approach should you use?

A.Create a log-based distribution metric and set an alert on the count
B.Use a logs-based alerting policy directly from Cloud Logging
C.Create a log-based counter metric with filter 'severity=ERROR' and then set an alert on that metric
D.Export logs to BigQuery and run a scheduled query to trigger a custom alert
AnswerC

Log-based metrics can count log entries, and alerts can be set on them.

Why this answer

Log-based metrics allow you to define a counter metric that counts log entries matching a filter. You can then create an alerting policy on that metric. Logs-based alerting directly from logs is not available; you must use a log-based metric.

742
MCQeasy

A Dataflow streaming pipeline that writes to a BigQuery table fails with the error above. Which change should be made to the table schema to prevent this error?

A.Add a clustering column
B.Partition the table by ingestion time
C.Increase the streaming buffer size in the table definition
D.Change the table to use a wildcard table pattern
AnswerB

Partitioning spreads writes across multiple partition buffers, preventing overflow.

Why this answer

Partitioning the table by ingestion time (e.g., _PARTITIONTIME) distributes the streaming buffer across multiple partitions, avoiding the per-partition buffer limit. Increasing the buffer size is a workaround but not a schema change. Clustering does not affect the streaming buffer.

Using a wildcard table is unrelated.

743
MCQhard

A DevOps engineer is setting up a GKE cluster for a batch processing job that can tolerate interruptions. The job runs for a few hours daily. To optimize cost, they want to use preemptible VMs. What must they configure to ensure the job completes despite node preemptions?

A.Disable cluster autoscaler to avoid node churn
B.Use a stateful workload with persistent volumes
C.Set the cluster autoscaler min and max nodes to the same value
D.Set the cluster autoscaler min nodes low and max nodes high to allow replacement
AnswerD

This ensures that when preemptible nodes are preempted, the cluster autoscaler can provision new nodes.

Why this answer

To ensure the batch job completes despite node preemptions, the cluster autoscaler must be able to replace preempted nodes. Option D sets the minimum nodes low (to avoid unnecessary cost) and maximum nodes high (to allow scaling up when nodes are preempted). This allows the autoscaler to launch new preemptible nodes as replacements.

The job itself must be fault-tolerant and handle restarts, but the autoscaler configuration is what enables node replacement. Option A disables autoscaling, preventing replacement. Option B is unrelated to node replacement.

Option C prevents scaling, so preempted nodes cannot be replaced.

744
MCQhard

A Cloud SQL for MySQL instance is configured with 8 vCPUs and 30GB RAM. The Database Advisor suggests adding an index on a table, but after adding, write performance degrades. The table has 10 million rows and receives 500 writes per second. What is the most likely reason?

A.The instance needs more CPU.
B.The index is too large for memory.
C.The index is not used for reads.
D.The index is on a highly selective column causing write amplification.
AnswerD

High selectivity means many unique values, requiring many index page splits and updates, increasing write latency.

Why this answer

Adding an index on a highly selective column (e.g., a column with many unique values) forces MySQL to update the B-tree index structure on every write operation. With 500 writes per second and 10 million rows, each INSERT or UPDATE must maintain the index, causing write amplification that degrades write throughput. The 8 vCPUs and 30GB RAM are sufficient for the workload, but the index maintenance overhead becomes the bottleneck.

Exam trap

Google Cloud often tests the misconception that write degradation after adding an index is caused by insufficient resources (CPU or memory), when the real issue is the overhead of index maintenance on a highly selective column, known as write amplification.

How to eliminate wrong answers

Option A is wrong because the instance has 8 vCPUs, which is typically adequate for 500 writes per second; the degradation is due to index maintenance, not CPU starvation. Option B is wrong because the index size depends on the column data type and row count, but 30GB RAM is ample for a single index on a 10-million-row table; the issue is write amplification, not memory pressure. Option C is wrong because whether the index is used for reads is irrelevant to write performance degradation; the problem is the overhead of maintaining the index during writes, not its read usage.

745
MCQmedium

You are designing a BigQuery schema for IoT sensor data. The sensor readings have varying fields depending on the sensor type. You want to minimize storage costs and avoid schema maintenance when new sensor types are added. What is the best schema design?

A.Use a separate table per sensor type
B.Store the sensor data in a JSON column
C.Use a schema with a STRUCT containing all possible fields as optional
D.Use a wide table with many nullable columns
AnswerB

JSON provides schema flexibility and cost-effective storage for varying fields.

Why this answer

Storing sensor data in a JSON column leverages BigQuery's native support for semi-structured data (the `JSON` data type), allowing you to ingest records with varying fields without schema changes. This minimizes storage costs by avoiding the overhead of many NULL columns and eliminates the need for schema maintenance when new sensor types are added, as BigQuery can query JSON fields directly using functions like `JSON_EXTRACT` or dot notation.

Exam trap

Google Cloud often tests the misconception that a STRUCT with optional fields is equivalent to a JSON column, but the trap is that a STRUCT still requires a fixed schema definition, whereas JSON allows fully dynamic fields without schema changes.

How to eliminate wrong answers

Option A is wrong because using a separate table per sensor type increases storage costs (due to table metadata overhead) and requires schema maintenance (creating new tables for each new sensor type), which contradicts the goal of minimizing maintenance. Option C is wrong because a STRUCT with all possible fields as optional still requires you to know and define every potential field in advance, leading to schema maintenance when new sensor types introduce new fields; it also incurs storage cost for NULL values in unused fields. Option D is wrong because a wide table with many nullable columns wastes storage on NULL values (BigQuery charges for NULL storage in fixed-length types) and requires schema updates to add columns for new sensor types, failing the 'avoid schema maintenance' requirement.

746
MCQhard

A financial application uses Cloud Spanner and requires daily full backups stored in another region for compliance. The backups must be restorable without exporting/importing. Which backup method should they use?

A.Export the database to Avro files in Cloud Storage in another region, then import when needed.
B.Use Cloud Scheduler to trigger a script that takes a snapshot of the database in Cloud Storage.
C.Use Spanner's scheduled backups and configure a cross-region backup policy.
D.Create on-demand backups and copy them to another region manually.
AnswerC

Spanner backups can be created and stored in another region, restorable directly.

Why this answer

Spanner supports scheduled backups that can be configured for cross-region storage, allowing direct restoration to a new database without export/import. This meets the requirement of daily backups in another region with import-free restore. Option A (export to Avro files in Cloud Storage) requires import to restore, so it's incorrect.

Option B (Cloud Scheduler triggering a script that takes a snapshot in Cloud Storage) is not a built-in Spanner feature and would require export/import, making it unsuitable. Option D (on-demand backups copied manually) is possible but not ideal for daily backups as it lacks automation.

747
MCQmedium

An engineer is designing a Cloud Spanner schema for a chat application where users send messages. Messages are ordered by timestamp per conversation. The primary key chosen is (ConversationId, MessageId) where MessageId is a monotonically increasing integer. What potential issue might arise with this key design?

A.Queries by conversation will be slow.
B.Writes will be concentrated on a single split causing hotspots.
C.The table cannot be interleaved with another table.
D.The table will not support secondary indexes.
AnswerB

Monotonically increasing keys lead to hotspots in Spanner.

Why this answer

Using a monotonically increasing integer as the second part of the primary key (MessageId) in Cloud Spanner causes all new writes to be concentrated on a single split (tablet) that handles the highest key range. This creates a hotspot, degrading write throughput and latency, as Cloud Spanner splits data by key range and sequential inserts target the same node.

Exam trap

In Google Cloud Spanner, monotonically increasing keys cause write hotspots because Spanner splits data by key range and sequential inserts target the same tablet, unlike traditional single-node databases where such keys are safe.

How to eliminate wrong answers

Option A is wrong because queries by conversation (using ConversationId as the leading key) are efficient; Cloud Spanner can use the primary key prefix to locate data quickly via a split scan. Option C is wrong because interleaving tables in Cloud Spanner requires a parent-child relationship based on the primary key prefix, which this design supports (ConversationId as the parent key). Option D is wrong because Cloud Spanner supports secondary indexes regardless of the primary key design; the issue is write performance, not index capability.

748
MCQeasy

A startup needs a database for its new web application that will serve a global user base. The application requires low-latency reads and writes (single-digit milliseconds), strong consistency, and the ability to handle high concurrency (thousands of transactions per second). Which Google Cloud database service should the startup choose?

A.Cloud SQL for MySQL
B.Cloud Spanner
C.Bigtable
D.Firestore
AnswerB

Spanner provides global scalability, strong consistency, and ACID transactions with low latency.

Why this answer

Cloud Spanner offers global distribution, strong consistency, and low-latency transactions at high concurrency. It is designed for globally scaled OLTP workloads.

749
Multi-Selecteasy

An engineer is designing a Bigtable schema for a weather data application. The data is written by thousands of sensors, each generating a reading every minute. Queries typically retrieve all readings for a sensor in a time range. The row key should be designed to avoid hotspots and support these queries. Which two row key components are recommended? (Choose two.)

Select 2 answers
A.Sensor ID (raw) as the only key
B.Sensor location as a column
C.Reversed timestamp
D.Timestamp in natural order
E.Hash of sensor ID as prefix
AnswersC, E

Reversed timestamp spreads writes and allows recent-first queries.

Why this answer

Using a reversed timestamp (e.g., Long.MAX_VALUE - timestamp) as part of the row key spreads writes across Bigtable tablets, avoiding hotspots that occur when sensors write sequentially in natural time order. This design also supports efficient range scans for a sensor's data over a time range when combined with a sensor ID prefix.

Exam trap

Google often tests the misconception that natural-order timestamps are optimal for time-range queries, but the trap here is that they cause write hotspots in Bigtable, so a reversed timestamp is required to distribute writes while still supporting range scans.

750
MCQmedium

A DevOps team is bootstrapping a new Google Cloud organization. They want to enforce that all Compute Engine instances must use Shielded VM features (Secure Boot, vTPM, Integrity Monitoring). Which organization policy should they set at the organization level?

A.Set the 'constraints/compute.disableSerialPortAccess' policy to true.
B.Set the 'constraints/compute.requireOsLogin' policy to true.
C.Set the 'constraints/compute.requireShieldedVm' policy to true.
D.Set the 'iam.allowedPolicyMemberDomains' policy to restrict membership.
AnswerC

Correct. This policy requires Shielded VM on all VMs.

Why this answer

The 'constraints/compute.requireShieldedVm' policy enforces that all new VMs must have Shielded VM enabled. Policies are set at the organization, folder, or project level using the Org Policy Service.

Page 9

Page 10 of 20

Page 11