Courseiva

Google Professional Cloud Database Engineer (PCDE) — Questions 9761050

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

Page 13

Page 14 of 20

Page 15
976
MCQmedium

The user runs a BigQuery query on a non-partitioned table and receives the error shown. Which optimization should be applied first to resolve the issue?

A.Partition the table by the event_date column
B.Increase the BigQuery reservation slot count
C.Create a materialized view that pre-aggregates the data
D.Cluster the table by event_date
AnswerA

Partitioning limits scans to relevant date ranges, reducing resource consumption.

Why this answer

The error indicates that the query is scanning too much data, likely exceeding the free tier or slot quota. Partitioning the non-partitioned table by `event_date` allows BigQuery to perform partition pruning, scanning only the relevant date range instead of the entire table. This directly reduces the data processed, which is the most effective first optimization for cost and performance.

Exam trap

Google Cloud often tests the distinction between partitioning (which prunes entire storage shards) and clustering (which only sorts within shards), leading candidates to mistakenly choose clustering as a solution for reducing data scanned when partitioning is required first.

How to eliminate wrong answers

Option B is wrong because increasing the reservation slot count only adds compute resources but does not reduce the amount of data scanned; the query would still fail if the issue is data volume limits. Option C is wrong because creating a materialized view pre-aggregates data but still requires scanning the base table unless the view is used with query rewriting, and it does not address the root cause of scanning too much raw data. Option D is wrong because clustering by `event_date` improves query performance by reducing the data read for range-based filters, but it does not enable partition pruning; clustering only sorts data within partitions, and without partitioning, the entire table is still scanned.

977
MCQmedium

An organization wants to deploy a Cloud Run service using Cloud Deploy. They need to run a database migration script before each new revision starts serving traffic. Which Cloud Deploy feature should they use?

A.Use a Cloud Build step in the delivery pipeline
B.Configure a preDeploy hook that runs a Cloud Run Job
C.Add a manual approval gate before deployment
D.Use a postDeploy hook to run the migration after traffic is switched
AnswerB

PreDeploy hooks run before the new revision is deployed, allowing database migrations or other preparation.

Why this answer

Cloud Deploy supports deployment hooks that execute Cloud Run Jobs before (preDeploy) or after (postDeploy) a rollout. PreDeploy hooks run before the new revision starts serving traffic, making them ideal for database migrations.

978
MCQhard

Refer to the exhibit. A company creates these Cloud Spanner tables. What happens when a customer record is deleted?

A.The deletion fails if there are orders.
B.The orders are deleted only if the order date is older than 30 days.
C.All orders for that customer are automatically deleted.
D.The orders remain orphaned.
AnswerC

Cascade delete removes all child rows associated with the deleted parent row.

Why this answer

Cloud Spanner enforces referential integrity through interleaved tables. When a parent row in the Customers table is deleted, all child rows in the Orders table that are interleaved under that customer are automatically deleted via a cascading delete. This behavior is inherent to the interleaved table structure, not an explicit ON DELETE CASCADE clause.

Exam trap

The trap here is that candidates may assume Cloud Spanner behaves like traditional relational databases (e.g., requiring explicit ON DELETE CASCADE or failing on foreign key violations), but interleaved tables automatically cascade deletes without any additional syntax.

How to eliminate wrong answers

Option A is wrong because Cloud Spanner interleaved tables automatically delete child rows, so the deletion does not fail even if orders exist. Option B is wrong because there is no time-based condition in the table schema; deletion of orders is unconditional and not filtered by order date. Option D is wrong because orphaned rows cannot occur in interleaved tables; the parent-child relationship ensures child rows are removed when the parent is deleted.

979
MCQhard

A company has a BigQuery dataset with many views. They need to ensure that only the latest 30 days of data is used in BI reports for performance. The source table is partitioned by ingestion_time. Which approach reduces query cost and improves performance?

A.Use BigQuery BI Engine to cache results
B.Create a view with WHERE _PARTITIONTIME >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
C.Create a materialized view with the date filter
D.Use a scheduled query to copy the last 30 days to a separate table
AnswerC

Materialized views precompute and store the filtered results, reducing query cost and improving performance through incremental updates.

Why this answer

A materialized view precomputes and stores the filtered result set, allowing BigQuery to serve BI queries directly from the materialized view's storage without scanning the entire source table. This eliminates the need to re-process the full table on every query, significantly reducing query cost and improving performance for the 30-day sliding window.

Exam trap

Google Cloud often tests the distinction between standard views (which are just saved queries) and materialized views (which store results), leading candidates to incorrectly choose a standard view with a WHERE clause, thinking it will reduce cost, when in fact it does not reduce data scanned.

How to eliminate wrong answers

Option A is wrong because BI Engine caches query results in memory, but it does not reduce the amount of data scanned on the first query or when the cache is invalidated; the source table must still be fully scanned initially, and the 30-day filter is not automatically applied. Option B is wrong because a standard view with a WHERE clause on _PARTITIONTIME does not precompute or store results; each query against the view still scans all partitions that match the filter, and BigQuery must evaluate the filter on every execution, which does not reduce cost or improve performance compared to querying the table directly. Option D is wrong because a scheduled query that copies the last 30 days to a separate table introduces data duplication, additional storage costs, and maintenance overhead (e.g., scheduling, cleanup of old data), and it does not provide the automatic, real-time sliding window that a materialized view offers.

980
MCQhard

You are building a globally distributed leaderboard application that requires strongly consistent reads with latency under 10 ms and high write throughput. Which Google Cloud database service is most suitable?

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

Spanner offers strong consistency across regions, low latency, and high write throughput.

Why this answer

Cloud Spanner is the correct choice because it provides strongly consistent reads across globally distributed regions with latency under 10 ms, while also supporting high write throughput. It uses TrueTime and synchronous replication to ensure ACID transactions and global consistency, meeting the exact requirements of a globally distributed leaderboard application.

Exam trap

The trap here is that candidates often confuse 'low latency' with 'strong consistency' and choose Cloud Bigtable or Memorystore for their speed, overlooking the critical requirement for globally consistent reads that only Spanner can provide.

How to eliminate wrong answers

Option A is wrong because Cloud Bigtable is a NoSQL wide-column database designed for high throughput and low latency, but it offers only eventual consistency, not strongly consistent reads. Option C is wrong because Memorystore is an in-memory cache (Redis/Memcached) that provides low latency but lacks native global distribution and strong consistency across regions; it is typically used as a caching layer, not a primary globally consistent database. Option D is wrong because Firestore provides strong consistency within a single region but offers eventual consistency for multi-region deployments, and its write throughput is limited compared to Spanner, making it unsuitable for a globally distributed leaderboard with high write throughput.

981
MCQeasy

Which of the following is a benefit of using parent-child interleaved tables in Cloud Spanner?

A.Improved read performance for queries joining parent and child
B.Increased write throughput by distributing writes
C.Automatic sharding across regions
D.Eliminates the need for secondary indexes
AnswerA

Co-locating rows reduces the need for distributed reads.

Why this answer

Interleaving stores child rows physically close to their parent row, enabling fast joins and reducing read latency. It does not improve write throughput or eliminate the need for secondary indexes.

982
MCQeasy

Refer to the exhibit. You are reviewing a Firestore security rules file. What is the main security flaw in the database schema design that these rules expose?

A.The rules do not protect against brute force attacks
B.The senderId field is not indexed
C.The delete rule allows admin to delete any message
D.Users can set the visibility field, allowing them to make messages public
AnswerD

The create rule does not restrict the visibility value, so users can bypass intended privacy.

Why this answer

The Firestore security rules allow any authenticated user to set the `visibility` field on a message document. This means a user could change the visibility to 'public', making private messages accessible to all users regardless of the intended audience. The rules do not validate that the user setting the visibility is the sender or an admin, exposing a data access control flaw.

Exam trap

The Google Cloud Professional Data Engineer exam often tests the misconception that indexing or brute force protection are security concerns in Firestore, when the real flaw is unvalidated field writes that bypass intended access control.

How to eliminate wrong answers

Option A is wrong because brute force attacks are mitigated by Firebase Authentication's built-in rate limiting and account locking, not by Firestore security rules; the rules shown do not expose any vulnerability to brute force. Option B is wrong because indexing is a performance optimization for queries, not a security mechanism; the absence of an index does not create a security flaw in the schema design. Option C is wrong because the delete rule shown allows only the sender or an admin to delete a message, which is a legitimate access control pattern; the flaw is not that admins can delete messages, but that users can arbitrarily set visibility.

983
Multi-Selecteasy

A DevOps team is using Pub/Sub to process high-volume event streams. They notice that the subscriber is falling behind and messages are being redelivered frequently. They need to increase throughput. Which TWO actions should they take? (Choose TWO)

Select 2 answers
A.Increase the acknowledgement deadline to give subscribers more time to process messages
B.Enable message ordering keys to ensure orderly processing
C.Change the subscription type from pull to push for faster delivery
D.Increase the number of parallel pull consumers in the subscriber
E.Decrease the flow control max outstanding messages to reduce load on subscribers
AnswersA, D

A longer acknowledgement deadline reduces the chance of redelivery due to timeout, allowing more time for processing.

Why this answer

Increasing the acknowledgement deadline gives subscribers more time to process messages, reducing redeliveries. Using multiple parallel pull consumers increases the rate at which messages are pulled. Flow control should be increased, not decreased, to allow more outstanding messages.

Ordering keys reduce throughput because they limit parallelism. Subscription type is fixed at creation time.

984
MCQmedium

A financial company runs BI queries on a BigQuery table that is partitioned by ingestion time. The table is 1 TB and receives streaming inserts every minute. Analysts query the last 24 hours of data. The queries are slow. The table is clustered by transaction_id. What is the likely cause?

A.Streaming buffer causes delays.
B.Queries use SELECT *.
C.Partition expiration is set too short.
D.The cluster column is not used in queries.
AnswerD

Without a filter on transaction_id, clustering provides no benefit; data within partitions is unordered.

Why this answer

Clustering sorts data within partitions based on the cluster column. If queries filter or aggregate by `transaction_id`, clustering can significantly reduce the amount of data scanned. However, if analysts query the last 24 hours of data without referencing `transaction_id` in WHERE or GROUP BY clauses, the clustering provides no benefit, and the query must scan the entire partition, leading to slow performance.

Exam trap

Google often tests the misconception that clustering alone speeds up all queries, when in reality it only helps if the cluster column is used in filters or aggregations; the trap is assuming any table with clustering will automatically improve query performance regardless of query patterns.

How to eliminate wrong answers

Option A is wrong because the streaming buffer primarily affects data consistency and latency for recently inserted rows, not the overall query speed on a 1 TB table queried over 24 hours. Option B is wrong because while SELECT * can increase data scanned, it is not the likely cause of slowness given the table is partitioned and clustered; the core issue is that clustering is not being leveraged. Option C is wrong because partition expiration controls data retention, not query performance; a short expiration would remove old data, not slow queries on existing data.

985
MCQhard

You are designing a Bigtable schema for a messaging application where users have conversations. Each row represents a message with row key 'userID#conversationID#timestamp'. The application queries the most recent messages for a given conversation. How should you modify the row key to optimize for this query pattern?

A.Promote the conversationID before userID
B.Store timestamp as a column instead of part of row key
C.Use a hash prefix of the conversationID as the first part
D.Reverse the timestamp
AnswerD

Reversing timestamp makes recent messages sort first, optimizing scans for latest messages.

Why this answer

To get the most recent messages, you want to scan recent rows. If timestamp is increasing, the most recent messages have the highest timestamp but at the end of the scan range. By reversing the timestamp, you make recent messages appear first in a scan.

Field promotion doesn't apply here. Salting would help writes but not the read pattern. The best approach is to reverse the timestamp so that most recent messages have lexicographically smaller keys.

986
MCQeasy

A developer wants to deploy a containerized application to Cloud Run using the command line. They need to set the maximum number of concurrent requests per container instance to 80. Which flag should they use with 'gcloud run deploy'?

A.--platform
B.--cpu-throttling
C.--max-instances
D.--concurrency
AnswerD

--concurrency sets the maximum number of concurrent requests per instance.

Why this answer

The `--concurrency` flag in `gcloud run deploy` directly sets the maximum number of simultaneous requests that a single container instance can handle. By specifying `--concurrency=80`, the developer limits each instance to processing up to 80 concurrent requests, which helps control resource usage and scaling behavior in Cloud Run.

Exam trap

Candidates often confuse the --max-instances flag (which limits the total number of container instances) with the --concurrency flag (which limits requests per instance). This question tests the specific flag for controlling concurrent request handling per container instance.

How to eliminate wrong answers

Option A is wrong because `--platform` specifies the target platform (e.g., `managed` or `gke`) for the deployment, not the request concurrency limit. Option B is wrong because `--cpu-throttling` does not exist as a valid flag in `gcloud run deploy`; Cloud Run uses CPU throttling based on request activity, but there is no such flag to set concurrency. Option C is wrong because `--max-instances` sets the maximum number of container instances that can be created for the service, not the number of concurrent requests per instance.

987
MCQmedium

An organization is implementing Binary Authorization for GKE. They need to ensure that only container images signed by their CI system are deployed. Which service must be enabled and configured to enforce this?

A.Cloud Key Management Service (KMS)
B.Artifact Registry with Container Analysis
C.Binary Authorization attestor and policy
D.Cloud Build service account with 'iam.serviceAccountUser' role
AnswerC

Binary Authorization uses attestors and policies to enforce that only signed images are deployed.

Why this answer

Binary Authorization is a managed service that requires an attestor to verify signatures. The attestor is configured with a public key, and the CI system signs images with the private key.

988
MCQhard

A developer reports that their application cannot connect to a Cloud SQL instance using private IP, but public IP works. The Cloud SQL instance is in VPC peering with the application's VPC. The application is in the same region. What is the most likely cause?

A.The VPC peering connection is not established.
B.The private IP range of the Cloud SQL instance conflicts with the application's VPC.
C.The Cloud SQL proxy is not running.
D.The Cloud SQL instance has 'require SSL' enabled.
AnswerB

IP overlap in peered VPCs causes routing issues, preventing private IP connectivity while public IP remains unaffected.

Why this answer

When a Cloud SQL instance is configured with a private IP address that overlaps with the application's VPC CIDR range, the VPC peering connection cannot route traffic correctly. This is due to the fact that VPC peering requires non-overlapping IP ranges to establish proper routing tables; overlapping ranges cause route conflicts and connectivity failures. Since public IP works, the issue is isolated to private IP routing, making IP range conflict the most likely cause.

Exam trap

Google Cloud often tests the misconception that VPC peering automatically handles overlapping IP ranges, when in fact overlapping ranges cause routing failures that prevent private IP connectivity even if the peering connection itself is established.

How to eliminate wrong answers

Option A is wrong because if the VPC peering connection were not established, public IP would also fail (since the application would be in a different network), and the question states public IP works. Option C is wrong because the Cloud SQL proxy is a tool for connecting to Cloud SQL via public IP or IAM authentication, but it is not required for private IP connectivity; the application can connect directly to the private IP without the proxy. Option D is wrong because requiring SSL affects encryption of the connection, not the ability to establish a TCP connection; if SSL were required, the connection would fail with an SSL error, not a complete inability to connect via private IP.

989
Multi-Selectmedium

A database engineer is designing a schema for a Cloud Spanner database. Which three practices should they follow to ensure good performance? (Choose three.)

Select 3 answers
A.Use split points to distribute data across nodes.
B.Use locking read (SELECT ... FOR UPDATE) for all transactional reads.
C.Design primary keys to avoid monotonically increasing values near the beginning of the key.
D.Use interleaved tables for parent-child relationships to colocate data.
E.Create secondary indexes on every column to speed up queries.
AnswersA, C, D

Explicit splits help avoid hot spots.

Why this answer

Explicitly defining split points in Cloud Spanner allows you to control how data is distributed across nodes, which can prevent hot spots and improve read/write throughput. By specifying split boundaries, you ensure that frequently accessed data is spread evenly, avoiding performance bottlenecks.

Exam trap

Google Cloud often tests the misconception that all transactional reads require locking to ensure consistency, but Cloud Spanner's snapshot isolation provides serializable reads without locks, making SELECT ... FOR UPDATE an anti-pattern for most workloads.

990
MCQmedium

A DevOps engineer needs to set up billing export to analyze costs by team and environment. They have organized projects with labels: team (e.g., 'platform', 'data') and environment (e.g., 'prod', 'dev'). Which billing export configuration should they use?

A.Use the Cloud Billing API to stream costs and store them in Firestore.
B.Export billing data to a Cloud Storage bucket and use a custom script to parse labels.
C.Set up BigQuery billing export in the billing account. The export includes labels, enabling cost analysis by team and environment.
D.Configure budgets and alerts for each label combination.
AnswerC

BigQuery export includes labels, resource IDs, and more, allowing straightforward SQL queries.

Why this answer

BigQuery billing export automatically includes resource labels in the exported tables, allowing direct SQL-based cost analysis by team and environment without custom scripting. This is the native, scalable, and recommended approach for multi-dimensional cost breakdowns in Google Cloud.

Exam trap

The trap here is that candidates confuse budgets/alerts (Option D) with cost analysis exports, or assume that Cloud Storage export (Option B) is simpler than BigQuery, missing that BigQuery's native label support eliminates the need for custom parsing.

How to eliminate wrong answers

Option A is wrong because the Cloud Billing API streams cost data but does not automatically include labels in a queryable format, and Firestore is not designed for analytical cost queries. Option B is wrong because exporting to Cloud Storage requires a custom script to parse labels from the CSV/JSON files, adding complexity and maintenance overhead compared to BigQuery's native label support. Option D is wrong because budgets and alerts only notify on spending thresholds; they do not provide historical cost analysis or label-based breakdowns.

991
MCQeasy

A team wants to visualize real-time CPU utilization across a fleet of Compute Engine instances in a single dashboard. Which chart type in Cloud Monitoring is most appropriate?

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

Correct. Line charts are designed for time-series data, showing how metrics change over time.

Why this answer

Line charts are ideal for time-series data like CPU utilization over time, showing trends and variations. Stacked bar charts are better for categorical comparisons, heatmaps for density, and scatter plots for correlation. For multiple instances over time, line charts are standard.

992
MCQmedium

A Cloud SQL for PostgreSQL instance is experiencing high read traffic. You need to offload read queries and ensure the solution can survive a regional outage. What should you do?

A.Set up Cloud Memorystore as a cache in front of the database.
B.Increase the machine type of the primary instance to handle the load.
C.Create a read replica in the same region and use it for read queries.
D.Create a cross-region read replica and direct read traffic to it.
AnswerD

A cross-region read replica serves read traffic and can be promoted if the primary region fails, meeting both requirements.

Why this answer

Cross-region read replicas serve read traffic and provide disaster recovery if the primary fails. Creating a cross-region read replica reduces read load and can be promoted if the primary region fails. Option D is correct.

Option A (Cloud Memorystore cache) reduces latency but does not survive a regional outage. Option B (increasing machine type) helps performance but not regional failover. Option C (same-region read replica) does not survive a regional outage.

993
MCQmedium

A company has multiple teams in a GCP organization. They want to isolate environments (prod, staging, dev) and give each team a separate project for development. Which folder structure is recommended?

A.Create a flat list of projects with naming conventions like `team-project-env`
B.Create a single folder per team, with projects for each environment inside
C.Create folders for each environment (prod, staging, dev), and within each, folders for teams/products containing projects
D.Create folders per product, and within each, environment folders
AnswerC

This is the Google-recommended structure for environment isolation and policy inheritance.

Why this answer

It aligns with Google Cloud's recommended resource hierarchy for multi-team, multi-environment isolation. By creating folders for each environment (prod, staging, dev) and then sub-folders for teams/products, you can apply consistent IAM policies and organization policies at the environment level (e.g., restrict prod access) while delegating project-level control to teams. This structure also supports the principle of least privilege and simplifies auditing.

Exam trap

A common mistake is to organize folders by team first (Option B), but this ignores the need for environment-wide policy enforcement in GCP, which is essential for compliance and security.

How to eliminate wrong answers

Option A is wrong because a flat list of projects with naming conventions does not provide hierarchical isolation; IAM policies must be applied per project, leading to management overhead and increased risk of misconfiguration. Option B is wrong because creating a single folder per team with environment projects inside prevents applying environment-wide policies (e.g., deny public IPs on all prod projects) without duplicating policies across team folders. Option D is wrong because organizing by product first and then environment makes it difficult to apply consistent environment-level controls (e.g., compliance rules for prod) across different products, and it mixes team boundaries with environment boundaries, complicating access management.

994
Multi-Selectmedium

A team wants to use Cloud Profiler to identify CPU hot functions in a production service. Which TWO statements about Cloud Profiler are correct? (Choose 2)

Select 2 answers
A.It provides flame graphs to visualize function call stacks
B.It can profile only Java applications
C.It has a typical overhead of about 0.5% of CPU
D.It requires modifying application code to add profiling calls
E.It profiles all functions by default with no configuration
AnswersA, C

Flame graphs are a key visualization in Cloud Profiler.

995
MCQmedium

A company runs an e-commerce platform on Cloud SQL for PostgreSQL. They need to perform point-in-time recovery (PITR) to recover from a user error that occurred 30 minutes ago. Which configuration is required to enable PITR?

A.Enable automated backups and configure a retention of 1-7 days; PITR uses WAL archiving automatically.
B.Enable binary logging and set a backup retention of 1-7 days.
C.Set up cross-region backup replicas and configure a retention of 1-7 days.
D.Enable PITR by setting the 'pitr_enabled' flag to true in the database flags.
AnswerA

In Cloud SQL for PostgreSQL, PITR is enabled by automated backups with a retention of 1-7 days; WAL archiving is handled automatically.

996
MCQmedium

Your application uses structured logging in JSON format. You want to ensure that each log entry is automatically correlated with the corresponding trace in Cloud Trace. Which field must be included in the JSON payload?

A."severity" field set to "ERROR"
B."httpRequest" object with requestUrl and status
C."trace" field with the trace ID formatted as projects/PROJECT_ID/traces/TRACE_ID
D."labels" field containing custom metadata
AnswerC

Correct. The trace field in structured logs enables correlation with Cloud Trace.

Why this answer

Cloud Logging correlates logs with traces via the 'logging.googleapis.com/trace' field (or 'trace' in the LogEntry), which should contain the trace ID in the format 'projects/[PROJECT_ID]/traces/[TRACE_ID]'. The 'httpRequest' field is for HTTP request data, 'severity' for log level, and 'labels' for custom metadata. Only the trace field provides correlation.

997
MCQhard

Refer to the exhibit. A database administrator notices that the Spanner instance has only 3 nodes, but the application experiences high read latency during peak hours. The team needs to improve performance without over-provisioning. What should they do?

A.Increase node count to 6
B.Use an interleaved table
C.Enable point-in-time recovery
D.Change to a multi-region configuration
E.Create a secondary index
AnswerE

Secondary indexes enable faster lookups and avoid full table scans, improving read latency.

Why this answer

Creating a secondary index on frequently queried columns allows Spanner to avoid full table scans, reducing read latency without increasing nodes. Option A (increase node count) would provision more compute and storage capacity, but if CPU utilization is not high, it constitutes over-provisioning. Option B (interleaved table) improves performance for parent-child joins but does not help general read queries.

Option C (enable point-in-time recovery) adds storage costs for versioned data without directly improving read latency. Option D (change to multi-region configuration) increases write latency and cost due to replication across regions, and may not reduce read latency in a single-region setup.

998
MCQmedium

Your Cloud SQL for MySQL instance is experiencing high CPU usage due to a burst of concurrent connections. You want to handle up to 500 concurrent connections without over-provisioning the instance. What should you do?

A.Create read replicas to distribute read traffic.
B.Right-size the instance to a tier that supports 500 concurrent connections.
C.Enable automatic storage increase to handle the load.
D.Use Cloud SQL Auth Proxy with a connection pooler like PgBouncer.
AnswerB

Choosing a tier with enough vCPU and memory allows 500 connections without over-provisioning.

Why this answer

Cloud SQL for MySQL has a maximum connections limit (based on tier). To handle 500 concurrent connections, you need to choose a tier with sufficient vCPU and memory. The max_connections is typically calculated as (available memory)/1257280 * 500, but the simplest approach is to use a tier that supports at least 500 connections (e.g., db-n1-standard-2 or higher).

However, using Cloud SQL Auth Proxy with PgBouncer is for PostgreSQL, not MySQL. Connection pooling with ProxySQL or a similar tool could help, but the question says 'without over-provisioning', so right-sizing the tier is key.

999
Multi-Selecthard

Which THREE are valid considerations when designing BigQuery tables for BI reporting?

Select 3 answers
A.Use nested and repeated fields to avoid JOINs
B.Create indexes on frequently queried columns
C.Use partitioning on date columns to reduce query cost
D.Cluster tables on high-cardinality columns used in filters
E.Denormalize dimension tables into fact tables for common queries
AnswersC, D, E

Partitioning is a key cost-control feature.

Why this answer

Partitioning BigQuery tables by date columns (e.g., using _PARTITIONTIME or a DATE/TIMESTAMP column) allows the query engine to prune entire partitions during query execution. This significantly reduces the amount of data scanned, directly lowering query costs (since BigQuery charges per byte processed) and improving performance for time-range filters.

Exam trap

Google Cloud often tests the misconception that traditional relational database features like indexes apply to BigQuery, but BigQuery's architecture relies on partitioning and clustering instead of indexes for query optimization.

1000
Multi-Selectmedium

A DevOps team uses Cloud Build to build a multi-service application. They have three services: frontend, backend, and worker. They want to run builds for all three services in parallel to speed up the pipeline. Which of the following cloudbuild.yaml configurations are valid for achieving parallel execution? (Choose TWO).

Select 2 answers
A.Set waitFor: ['-'] on the first step and omit waitFor on the others.
B.Set waitFor: ['frontend', 'backend', 'worker'] on a subsequent step to run after all three.
C.Set waitFor: ['-'] on all three steps.
D.Use a single step with multiple entrypoints and args.
E.Define three steps (frontend, backend, worker) without any waitFor field.
AnswersC, E

Correct. Setting waitFor: ['-'] on all three steps tells Cloud Build that each step has no dependencies, so all start simultaneously, achieving parallel execution.

Why this answer

Both options C and E achieve parallel execution of the three services. In option C, setting `waitFor: ['-']` on all three steps explicitly tells Cloud Build that each step has no dependencies, so they all start simultaneously. In option E, defining the three steps without any `waitFor` field also results in parallel execution because Cloud Build treats steps with no `waitFor` as having no dependencies and starts them at the same time.

Options A, B, and D do not produce parallel execution: A runs only the first step immediately and the others sequentially, B defines a step that runs after all three (not parallel for the three), and D uses a single step which runs commands sequentially.

1001
Multi-Selectmedium

A company is designing a disaster recovery strategy for a Cloud SQL for PostgreSQL instance. They require an RPO of less than 5 minutes and an RTO of less than 2 minutes in the event of a regional outage. Which three components should they include in their solution? (Choose three.)

Select 3 answers
A.Cross-region read replica
B.Global external HTTP(S) load balancer with backend health checks
C.Automated promotion script (e.g., using Cloud Functions)
D.Point-in-time recovery enabled with 7-day retention
E.Automated backup with 5-minute frequency
AnswersA, B, C

A read replica in another region provides asynchronous replication, achieving RPO of seconds to minutes.

Why this answer

To achieve RPO <5 minutes and RTO <2 minutes across regions, you need a solution that can recover quickly with minimal data loss. Cloud SQL cross-region read replicas replicate asynchronously, so RPO is the replication lag (which can be <5 minutes if the network is fast). Promoting a read replica manually takes minutes, but you can automate the promotion using Cloud Functions or scripts to reduce RTO.

Alternatively, you could use a standby instance in another region with synchronous replication (but Cloud SQL does not support that). The best approach is to use a cross-region read replica with automated promotion (e.g., via Cloud Functions triggered by a health check). Additionally, you need to update application connection strings to point to the new primary.

Using a load balancer with health checks can also help route traffic. The three correct components are: cross-region read replica, automated promotion script, and a global load balancer to redirect traffic.

1002
MCQmedium

A financial services company runs a critical application on Cloud SQL for PostgreSQL. They require point-in-time recovery (PITR) with the ability to recover to any second within the past 7 days. However, their current backup configuration only allows recovery to the previous 7 days, but not within seconds. What should they do to enable PITR?

A.Enable point-in-time recovery and set the transaction log retention to 7 days.
B.Use the Cloud SQL query insight feature to replay queries.
C.Enable binary logging and set the binary log retention period to 7 days.
D.Increase the number of automated backups to 7 per day.
AnswerA

PITR in Cloud SQL for PostgreSQL uses transaction logs (WAL) retained for the specified period.

Why this answer

Enabling point-in-time recovery (PITR) on Cloud SQL for PostgreSQL automatically uses write-ahead log (WAL) archiving to allow recovery to any second within a specified retention period. Setting the transaction log retention to 7 days ensures that the archived WAL segments are kept for exactly 7 days, enabling recovery to any point within that window. This directly satisfies the requirement for second-granularity recovery over the past 7 days.

Exam trap

The trap here is that candidates confuse the number of automated backups (full backups) with the retention of transaction logs required for PITR, leading them to select Option D, or they mistakenly apply MySQL binary logging concepts (Option C) to a PostgreSQL environment.

How to eliminate wrong answers

Option B is wrong because Cloud SQL Query Insights is a performance monitoring and diagnostic feature that captures query metrics and execution plans; it does not replay queries or provide any recovery capability. Option C is wrong because binary logging is a MySQL-specific feature; Cloud SQL for PostgreSQL uses WAL (write-ahead logging) for PITR, not binary logs, and there is no 'binary log retention period' setting for PostgreSQL. Option D is wrong because increasing the number of automated backups (e.g., to 7 per day) only increases the frequency of full backups, not the retention of transaction logs; PITR requires transaction log retention, not more full backups.

1003
Matchingmedium

Match each Cloud SQL backup type to its retention policy.

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

Concepts
Matches

Configurable retention up to 365 days

Retained until manually deleted

Retained for point-in-time recovery window

Stored in a different region for disaster recovery

Defined start time and window for automated backups

Why these pairings

Cloud SQL backup types: Automated backups have configurable retention (default 7 days). On-demand backups are retained until deleted (max 365 days). Point-in-time recovery logs are kept for the same period as automated backup retention.

Common confusions involve swapping these policies.

1004
MCQmedium

A company needs to control cost by setting a budget alert on their billing account. They want to be notified when spending exceeds 80% of the budget. What should they configure?

A.Export billing data to BigQuery and set up a scheduled query with a Cloud Function to send alerts.
B.Create a budget in the GCP Billing console with alert threshold at 80%.
C.Create a budget alert rule in Cloud Monitoring with a metric threshold.
D.Use Cloud Scheduler to run a script that checks billing API and sends email.
AnswerB

Budgets and alerts are configured in the Billing console with threshold rules.

Why this answer

Google Cloud's native budget alerts in the Billing console allow you to set a threshold (e.g., 80%) and automatically send email notifications when actual spending exceeds that percentage of the budget. This is the simplest, most direct, and recommended approach for cost control without needing additional services or custom code.

Exam trap

The trap here is that candidates often over-engineer the solution by choosing complex automation (like BigQuery exports or Cloud Scheduler scripts) instead of recognizing that Google Cloud provides a simple, built-in budget alert feature in the Billing console that directly meets the requirement.

How to eliminate wrong answers

Option A is wrong because exporting billing data to BigQuery and setting up a scheduled query with a Cloud Function is overly complex and unnecessary for a simple threshold alert; it introduces latency, additional cost, and maintenance overhead when the built-in budget alert already provides the same functionality. Option C is wrong because Cloud Monitoring alert rules are designed for monitoring resource metrics (e.g., CPU, memory), not billing amounts; billing data is not exposed as a metric in Cloud Monitoring, so a metric threshold alert cannot be created for spending. Option D is wrong because using Cloud Scheduler to run a script that checks the billing API and sends email is a custom, brittle solution that requires managing authentication, error handling, and scheduling, whereas the native budget alert handles all of this automatically and reliably.

1005
Multi-Selectmedium

A DevOps engineer is designing a landing zone for a large enterprise. Which THREE components are essential for a well-architected landing zone? (Choose THREE.)

Select 3 answers
A.A shared VPC project to host common network resources.
B.A centralized security project for services like Cloud Armor, Security Command Center, and Cloud DLP.
C.A centralized logging project to store audit logs from all projects.
D.A single billing account per team.
E.A separate project per developer for sandbox environments.
AnswersA, B, C

Shared VPC allows centralized network management and connectivity.

Why this answer

A landing zone typically includes a shared VPC for network connectivity, a centralized logging project for audit logs, and a security project for centralized security services like Cloud Armor and Security Command Center.

1006
MCQmedium

An application running on Cloud SQL experiences high read latency. The team wants to offload read traffic from the primary instance and improve performance. Which approach should they take?

A.Create a single read replica and route read-only queries to it
B.Add more memory to the primary instance
C.Enable the query cache
D.Use Cloud SQL Auth Proxy
AnswerA

Read replicas handle SELECT queries, offloading the primary.

Why this answer

Cloud SQL read replicas allow distributing read traffic, reducing load on the primary instance and improving read performance.

1007
MCQhard

A data analyst runs a query that joins two large tables on a high-cardinality column with many NULL values. Which action is most likely to resolve the error?

A.Use a DISTINCT clause on the join key.
B.Increase the query timeout setting.
C.Add a WHERE clause to filter out NULLs from the join key.
D.Use a UNION ALL to combine tables.
AnswerC

Filtering NULLs reduces row count and shuffle.

Why this answer

Filtering out NULLs from the join key with a WHERE clause prevents the database from attempting to match NULL values, which cannot be equated in a standard SQL join (since NULL != NULL). This reduces the cardinality of the join operation and avoids potential performance degradation or errors caused by the large number of NULLs being processed in a high-cardinality column.

Exam trap

The trap here is that candidates may think increasing the timeout (Option B) is a universal fix for any query error, when in reality the error is often due to resource exhaustion from NULL handling, not insufficient execution time.

How to eliminate wrong answers

Option A is wrong because using DISTINCT on the join key does not resolve the issue of NULLs in the join; it only removes duplicate non-NULL values from the result set, which does not address the underlying problem of NULL mismatches or performance. Option B is wrong because increasing the query timeout setting only allows the query to run longer without failing, but does not fix the root cause of the error (e.g., excessive memory or disk usage from NULL handling). Option D is wrong because UNION ALL combines results from two queries vertically, not horizontally; it does not perform a join and therefore cannot resolve errors related to joining on a high-cardinality column with NULLs.

1008
MCQhard

Your Cloud SQL for PostgreSQL instance is experiencing high CPU utilization during peak hours. You notice that the query `SELECT * FROM orders WHERE order_date >= '2024-01-01'` is frequently run against a table with 10 million rows. The table has a B-tree index on `order_date`. What is the most likely cause of the high CPU usage, and how should you address it?

A.The index is fragmented; rebuild the index to improve performance.
B.Increase the instance machine type to provide more CPU capacity.
C.The query retrieves all columns, causing significant heap lookup overhead; rewrite the query to select only required columns.
D.The index on `order_date` is not being used; add a hint to force index usage.
AnswerC

Selecting only needed columns reduces I/O and CPU, as fewer heap lookups are required.

Why this answer

The query uses `SELECT *`, which forces PostgreSQL to fetch all columns from the heap (the main table storage) even though the index on `order_date` can efficiently locate the matching rows. This results in significant heap lookup (also known as bitmap heap scan or index scan with tuple retrieval) overhead, consuming CPU cycles for each row fetched. Reducing the selected columns to only those needed minimizes I/O and CPU usage by avoiding unnecessary data retrieval from the heap.

Exam trap

Google Cloud often tests the misconception that high CPU is always due to missing or unused indexes, but here the index is used and the real problem is the overhead of fetching all columns from the heap, which candidates overlook when they focus solely on index usage.

How to eliminate wrong answers

Option A is wrong because B-tree index fragmentation in PostgreSQL is typically not a primary cause of high CPU usage; while index bloat can affect performance, the main issue here is the `SELECT *` causing excessive heap lookups, not index fragmentation. Option B is wrong because increasing the instance machine type treats the symptom (high CPU) rather than the root cause (inefficient query design), and it incurs unnecessary cost without addressing the underlying query pattern. Option D is wrong because the index on `order_date` is very likely being used (PostgreSQL's planner will use it for a range scan on a large table), but the high CPU stems from the heap lookups for all columns, not from the index being ignored; forcing index usage would not reduce the heap access overhead.

1009
MCQeasy

A team wants to automatically adjust the node count in a GKE cluster based on pending pod resource requests. Which component should they enable?

A.Cluster Autoscaler
B.Vertical Pod Autoscaler
C.Node auto-provisioning
D.Horizontal Pod Autoscaler
AnswerA

Cluster Autoscaler adjusts node count based on resource demands.

Why this answer

The Cluster Autoscaler automatically adds or removes nodes from the cluster based on pending pods or underutilized nodes.

1010
MCQeasy

You need to monitor the replication lag between a Cloud SQL for MySQL primary instance and its read replica. Which metric should you use to set up an alert?

A.cloudsql.googleapis.com/database/replication/replica_count
B.cloudsql.googleapis.com/database/cpu/utilization
C.cloudsql.googleapis.com/database/memory/utilization
D.cloudsql.googleapis.com/database/replication/replication_lag
AnswerD

This is the correct metric for replication lag.

Why this answer

Cloud SQL exposes a metric 'replication/replication_lag' (or 'cloudsql.googleapis.com/database/replication/replication_lag') that measures the lag in seconds between the primary and replica. This is the correct metric for alerting.

1011
MCQhard

A Memorystore for Redis instance is running out of memory. The application can tolerate some data loss but not crashes. The team wants to ensure the instance remains available without manual intervention. Which eviction policy should they configure?

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

Correct. This evicts the least recently used keys across all keys, ensuring availability.

Why this answer

(allkeys-lru) is correct because it allows Redis to evict the least recently used keys from the entire keyspace when memory is full, which keeps the instance available without crashing. Since the application can tolerate some data loss but not crashes, this policy ensures memory pressure is relieved automatically, preventing out-of-memory errors that would cause the instance to become unavailable.

Exam trap

A common trap is to assume volatile policies (like volatile-lru or volatile-ttl) are safer because they only affect keys with TTL. However, if most keys lack expiration, these policies fail to free memory, leading to crashes—whereas allkeys-lru guarantees eviction across all keys to maintain availability.

How to eliminate wrong answers

Option A (volatile-lru) is wrong because it only evicts keys with an expiration set, leaving keys without TTL untouched; if the majority of data lacks expiration, memory may still fill up and cause instability. Option B (volatile-ttl) is wrong because it evicts keys based on shortest remaining TTL among volatile keys, which is unpredictable and may not free enough memory in time, risking crashes. Option C (noeviction) is wrong because it returns errors on write operations when memory is full, which would cause application crashes or unavailability, directly contradicting the requirement to avoid crashes.

1012
MCQmedium

A company is running a Cloud SQL for PostgreSQL instance for an e-commerce application. They need to enable point-in-time recovery (PITR) with a 7-day retention period. What configuration steps must be taken?

A.Create a cross-region backup replica with a 7-day retention.
B.Enable WAL archiving and configure backup retention to 7 days using gcloud sql instances patch --backup-retention-days 7.
C.Enable binary logging and set backup retention to 7 days.
D.Enable automated backups with a 7-day retention; WAL archiving is automatic.
AnswerB

Correct. WAL archiving is needed for PITR, and backup retention is set via the flag.

Why this answer

Cloud SQL for PostgreSQL uses Write-Ahead Log (WAL) archiving to enable point-in-time recovery (PITR). You must enable automated backups (which automatically enables WAL archiving) and then set the backup retention period to 7 days using the `gcloud sql instances patch --backup-retention-days 7` command. This ensures that WAL logs are retained for the specified duration, allowing PITR within that window.

Exam trap

Candidates often mistakenly think that enabling automated backups in Cloud SQL automatically sets the retention period for point-in-time recovery (PITR) to 7 days. However, you must explicitly configure backup retention using the gcloud command to retain WAL logs for the desired duration. Additionally, some confuse the process with MySQL binary logging, but PostgreSQL uses WAL archiving for PITR.

How to eliminate wrong answers

Option A is wrong because cross-region backup replicas are used for disaster recovery and high availability, not for enabling PITR; they do not provide the WAL log retention required for point-in-time recovery. Option C is wrong because binary logging is a MySQL/MariaDB concept, not applicable to PostgreSQL; PostgreSQL uses WAL (Write-Ahead Log) for PITR, not binary logs. Option D is wrong because while enabling automated backups is necessary, the statement 'WAL archiving is automatic' is misleading; WAL archiving is automatically enabled only when automated backups are turned on, but the retention period must be explicitly configured via the `--backup-retention-days` flag—simply enabling automated backups with a 7-day retention without the patch command does not guarantee the correct configuration.

1013
MCQhard

You need to monitor a critical batch job that runs daily on Compute Engine. If the job does not complete within 2 hours, you want to be paged via PagerDuty. The job emits a custom metric 'batch_duration' as a GAUGE that records the duration of the last completed run. What alerting policy condition should you use?

A.Forecast condition: predict that duration will exceed 2 hours.
B.Metric absent condition: with duration of 2 hours on the 'batch_duration' metric.
C.Log-based metric alert: count log entries indicating job failure.
D.Metric threshold condition: threshold > 7200 (seconds) on the 'batch_duration' metric.
AnswerB

This triggers if the metric stops reporting for 2 hours, indicating the job did not complete.

Why this answer

Since the metric only has a value when the job completes, you need to detect the absence of data. If the job fails or doesn't run, the metric will stop reporting. A 'metric absent' condition triggers if no data is received for a specified duration (e.g., 2 hours).

This is more reliable than a threshold on the gauge value, which might still show an old value.

1014
MCQmedium

An engineer needs to create a backup of a Cloud SQL for MySQL instance that is retained for 400 days to meet compliance requirements. What is the correct approach?

A.Use Cloud SQL export to Cloud Storage and store the export for 400 days using object lifecycle management.
B.Set the backup retention to 400 days in the Cloud SQL instance settings.
C.Create a cross-region read replica and use it as a backup source.
D.Use the gcloud command: gcloud sql backups create --instance=myinstance --async and rely on default retention.
AnswerA

Export to Cloud Storage creates a durable backup that can be retained indefinitely via object lifecycle rules, meeting the 400-day requirement.

Why this answer

Cloud SQL for MySQL allows automated backups with a maximum retention of 365 days. To retain a backup for longer, the engineer must create an on-demand export to Cloud Storage. The export can be stored indefinitely.

Automated backup retention cannot be extended beyond 365 days. Using Cloud SQL's backup retention setting to 400 days is not supported. Using a read replica is not a backup.

Using PITR does not create a separate backup file.

1015
MCQmedium

A DevOps engineer needs to create a dashboard as code for Cloud Monitoring. They want to version-control the dashboard definition. Which method should they use?

A.Use gcloud alpha monitoring dashboards create command with a JSON file
B.Create the dashboard via the Cloud Console and export the JSON representation
C.Use Grafana with Cloud Monitoring data source and export dashboard JSON
D.Use the Cloud Monitoring API to create dashboards from a Terraform resource
AnswerD

Terraform supports google_monitoring_dashboard resource, allowing infrastructure-as-code for dashboards.

Why this answer

Cloud Monitoring dashboards can be defined using the REST API or gcloud commands, and the JSON/YAML definition can be stored in version control.

1016
Multi-Selectmedium

A team is designing a schema for a user activity logging system using Bigtable. Each log entry includes a user ID, activity type, timestamp, and details. The access pattern requires retrieving all activities for a specific user within a time range. Which TWO row key designs are suitable? (Choose TWO.)

Select 2 answers
A.timestamp#user_id
B.random_uuid
C.reverse_timestamp
D.user_id#activity_type#timestamp
E.user_id#timestamp
AnswersD, E

Allows filtering by activity type within a user.

Why this answer

(user_id#activity_type#timestamp) is correct because it groups all activities for a user under a single row key prefix, enabling efficient row range scans for a specific user. The activity_type suffix allows filtering by activity type if needed, while the timestamp ensures uniqueness and ordered storage. Option E (user_id#timestamp) is correct because it directly supports the access pattern of retrieving all activities for a user within a time range by scanning rows with the user_id prefix and filtering on the timestamp component.

Exam trap

Google Cloud often tests the misconception that a timestamp-first key is optimal for time-range queries, but the actual requirement is user-specific retrieval, which demands a user-first key design to avoid full-table scans.

1017
MCQhard

A company uses BigQuery for BI reporting with a star schema. The fact table 'sales' is partitioned by date and clustered by 'product_id'. The dimensions 'product' and 'customer' are updated nightly via merge statements. Recently, a report that joins 'sales' with 'product' on 'product_id' and filters on sale_date for the last 7 days started timing out. The query plan shows a 'SCAN' of the entire 'product' table. Which optimization should be applied to improve performance?

A.Partition the 'product' table by 'product_id'
B.Partition the 'sales' table by 'product_id' instead of date
C.Remove clustering from the 'sales' table
D.Cluster the 'product' table on 'product_id'
AnswerD

Clustering on product_id improves join performance by collocating rows with the same product_id, reducing data scanned.

Why this answer

Clustering the 'product' table on 'product_id' physically co-locates rows with the same product_id into the same blocks, drastically reducing the amount of data scanned when the report joins on that column. The query plan's full SCAN of the 'product' table indicates that BigQuery must read every row, even though only a subset of products are referenced by the last 7 days of sales. Clustering on product_id enables block-level pruning, so only the relevant blocks are read, eliminating the full table scan.

Exam trap

Google Cloud often tests the misconception that partitioning is the universal solution for all performance issues, but here the problem is a full scan of the dimension table during a join, which clustering on the join key solves without the limitations and overhead of partitioning.

How to eliminate wrong answers

Option A is wrong because partitioning the 'product' table by 'product_id' is not supported in BigQuery — partitioning requires a date, timestamp, or integer range column, not an arbitrary ID, and it would create an excessive number of partitions, degrading performance. Option B is wrong because partitioning the 'sales' table by 'product_id' instead of date would break the existing date-based pruning for the last-7-days filter, likely increasing the scan size and defeating the purpose of the optimization. Option C is wrong because removing clustering from the 'sales' table would worsen performance by eliminating the existing block-level pruning on product_id, making the join even slower.

1018
MCQhard

An engineer wants to create a dashboard that shows the number of HTTP 5xx errors per minute from an application that writes structured logs. The application logs are in Cloud Logging. Which approach should be used?

A.Export logs to BigQuery and run a query every minute to count errors.
B.Use the Cloud Monitoring API to create a custom metric for error counts from logs.
C.Create an alert policy that triggers on error logs and counts them via a notification channel.
D.Create a log-based metric with a counter for log entries containing '5xx' and use it in a dashboard.
AnswerD

Log-based counter metrics count matching log entries per minute.

1019
MCQeasy

A team is adopting GitOps for infrastructure. They want to ensure that all Terraform configuration changes are automatically applied after merging to the main branch. Which CI/CD approach best supports this?

A.Run `terraform plan` on every commit and require manual approval before apply.
B.Have developers apply changes locally using `terraform apply`.
C.Use Cloud Deployment Manager with a trigger on Cloud Source Repository commits.
D.Use a CI/CD pipeline that runs `terraform apply` after a merge to the main branch.
AnswerD

This automates application on merge, aligning with GitOps principles.

Why this answer

GitOps uses Git as the single source of truth, and changes are automatically applied to the target environment when merged to the main branch. A CI/CD pipeline triggered on merge that runs `terraform apply` achieves this.

1020
Multi-Selectmedium

Which TWO actions are required to set up point-in-time recovery (PITR) for Cloud SQL for MySQL? (Choose 2)

Select 2 answers
A.Enable binary logging.
B.Set the 'log_bin' flag to ON in the database flags.
C.Create a read replica in a different region.
D.Configure a cross-region backup replica.
E.Enable automated backups with a retention period between 1 and 7 days.
AnswersA, E

Binary logging is required for PITR in MySQL to capture point-in-time changes.

1021
MCQmedium

A company uses Cloud SQL for MySQL and wants to run complex analytical queries on the same data without affecting OLTP performance. They need a solution with minimal data movement and low operational overhead. Which approach should they take?

A.Migrate to Cloud Spanner
B.Export data to BigQuery periodically
C.Set up a Cloud SQL read replica and run analytical queries on it
D.Use AlloyDB for PostgreSQL with its columnar engine
AnswerD

AlloyDB provides HTAP with a built-in columnar engine for analytics without impacting OLTP.

Why this answer

AlloyDB is a PostgreSQL-compatible database that includes a columnar engine for analytical queries, providing HTAP capabilities with minimal performance impact on OLTP. BigQuery requires exporting data, which adds latency and overhead. Read replicas still run on MySQL engines optimized for OLTP.

Spanner is overkill and requires migration. AlloyDB is the best fit for HTAP.

1022
Multi-Selecthard

A Cloud Pub/Sub subscription is used to ingest real-time events. The subscriber's processing rate is slower than the publish rate, causing messages to back up. The team needs to increase throughput without losing messages. Which three actions should they take? (Choose three.)

Select 3 answers
A.Increase the number of subscriber clients (parallel pull consumers)
B.Set ordering keys on the subscription
C.Use a push subscription instead of pull
D.Increase the max outstanding messages per subscriber client
E.Use a pull subscription with an asynchronous puller
AnswersA, D, E

More subscribers pull messages concurrently, increasing overall throughput.

Why this answer

To increase throughput in Cloud Pub/Sub when subscribers are slower than publishers, the key is to allow more parallel processing. Increasing the number of subscriber clients (option A) distributes the message load across multiple consumers. Increasing max outstanding messages per client (option D) lets each client buffer more messages, enabling higher concurrency within a single subscriber.

Using an asynchronous puller (option E) avoids blocking on each message, improving efficiency. Ordering keys (option B) are not needed and can reduce throughput due to per-key ordering constraints. Push subscriptions (option C) are less scalable for high-volume ingestion because they rely on a single endpoint and have stricter timeout limits.

1023
Multi-Selecthard

A financial services company uses BigQuery for BI reporting. They need to design a data model that ensures data consistency and avoids duplicate records in the fact table. Which three practices should they follow? (Choose three.)

Select 3 answers
A.Use the OVERWRITE partition option for incremental loads.
B.Apply a unique constraint on the fact table.
C.Use a daily load job that replaces the entire table with WRITE_TRUNCATE.
D.Implement a staging table with a unique identifier and use INSERT ... SELECT DISTINCT.
E.Use DML statements with MERGE to upsert data.
AnswersA, D, E

Overwriting specific partitions avoids duplicates within those partitions.

Why this answer

Using the OVERWRITE partition option for incremental loads ensures that only the specific partition being loaded is replaced, preventing duplicate records within that partition while preserving data in other partitions. This approach maintains data consistency by avoiding full table overwrites and is efficient for incremental updates in BigQuery.

Exam trap

The trap here is that candidates often assume BigQuery supports traditional database constraints like unique constraints (Option B) or that full table overwrites (Option C) are acceptable for incremental loads, when in fact BigQuery's architecture requires partition-level or DML-based deduplication strategies.

1024
MCQeasy

Which of the following is an example of toil according to SRE principles?

A.Manually restarting failed pods in a Kubernetes cluster
B.Reviewing code from a junior developer
C.Writing a new feature for the application
D.Designing a new microservice architecture
AnswerA

Manual, repetitive, and can be automated — classic toil.

Why this answer

Toil is manual, repetitive, automatable work with no enduring value. Manually restarting failed pods is a classic example.

1025
Multi-Selecteasy

Which TWO actions improve query performance and reduce cost in BigQuery for BI workloads?

Select 2 answers
A.Cluster tables on columns used in GROUP BY
B.Partition tables on columns frequently used in WHERE clauses
C.Load data using batch loads instead of streaming
D.Store data in CSV format
E.Use SELECT * in all queries
AnswersA, B

Clustering improves aggregation performance.

Why this answer

Clustering tables on columns used in GROUP BY improves query performance by physically co-locating rows with similar values, reducing the amount of data scanned during aggregation. Partitioning on columns frequently used in WHERE clauses allows BigQuery to prune entire partitions from the scan, directly reducing both cost (bytes billed) and query execution time. These two optimizations are specifically recommended for BI workloads where repeated, selective queries are common.

Exam trap

Google Cloud often tests the misconception that any data loading method (batch vs. streaming) or any file format (CSV) directly improves query performance, when in fact only storage and query-time optimizations like partitioning and clustering reduce bytes scanned.

1026
MCQmedium

A Cloud Bigtable cluster is currently using HDD storage. The team wants to switch to SSD for better performance. What is the correct approach?

A.Create a new cluster in the same instance with SSD, then delete the old HDD cluster.
B.Use the gcloud bigtable clusters update command with the --storage-type flag.
C.Export the table to Cloud Storage, delete the instance, create a new one with SSD, and import.
D.Delete the existing cluster and recreate it with SSD. Data is retained in the instance.
AnswerA

Correct. A Bigtable instance can have multiple clusters; add a new SSD cluster, replicate data, then remove the HDD cluster.

Why this answer

In Cloud Bigtable, storage type is a property of the cluster, not the instance. You cannot change the storage type of an existing cluster. The correct approach is to add a new cluster with SSD storage to the same instance, then delete the original HDD cluster.

This allows you to migrate without data loss or downtime, as data is replicated across clusters in the same instance.

Exam trap

A common misconception is that you can update storage type on an existing cluster or that deleting a cluster preserves data in the instance. However, in Cloud Bigtable, storage type is immutable per cluster and data is tied to the cluster's existence.

How to eliminate wrong answers

Option B is wrong because the `gcloud bigtable clusters update` command does not support a `--storage-type` flag; storage type is immutable after cluster creation and cannot be changed via any command. Option C is wrong because it unnecessarily involves exporting to Cloud Storage and recreating the instance, which is complex and risks data loss or extended downtime; Cloud Bigtable supports multiple clusters per instance, making a simple cluster swap possible. Option D is wrong because deleting the cluster also deletes all data stored in that cluster; data is not retained in the instance when the only cluster is removed, as Cloud Bigtable stores data only in clusters.

1027
MCQeasy

A company runs a critical application on Cloud SQL for PostgreSQL with a 5-minute RPO and 30-minute RTO. They have a cross-region read replica for disaster recovery. During a planned failover test, what is the expected RPO and RTO when promoting the read replica?

A.RPO = 0, RTO = less than 1 minute
B.RPO = replication lag, RTO = minutes
C.RPO = 0, RTO = minutes
D.RPO = backup age, RTO = hours
AnswerB

Correct: cross-region read replicas are asynchronous, so promotion results in loss of unsynchronized data (RPO = lag) and takes minutes to promote (RTO).

Why this answer

Cross-region read replica promotion has an RPO equal to the replication lag (data not yet replicated) and an RTO of minutes (time to promote and make writable).

1028
MCQeasy

A team wants to create a Cloud Spanner database backup and store it in a Cloud Storage bucket for long-term archival. Which method should they use?

A.Use gcloud spanner instances create-backup to create a backup of the instance.
B.Use the gcloud spanner databases backup command to create a backup that resides in Cloud Storage.
C.Take a snapshot of the Spanner instance using Cloud Storage snapshots.
D.Use the gcloud spanner databases export command to export to Cloud Storage.
AnswerB

Correct. Backup creates a full backup in Cloud Storage (Avro + Protobuf) that can be restored.

Why this answer

Cloud Spanner provides database-level backups directly to Cloud Storage in Avro + Protobuf format. Export/import is for migration, not archival backups.

1029
MCQmedium

An e-commerce platform uses Cloud Bigtable for real-time analytics on customer behavior. The table uses a row key of 'customer_id#timestamp' (customer ID followed by reverse timestamp). Queries for a specific customer's recent events are fast, but queries that filter by event type (e.g., 'purchase') across many customers are slow. What schema change can improve query performance for event-type filtering?

A.Create a separate column family for each event type.
B.Add a secondary index on the event_type column.
C.Use a separate Bigtable instance for each event type.
D.Change the row key to 'event_type#customer_id#timestamp'.
AnswerD

This allows efficient range scans for a specific event type across all customers.

Why this answer

Cloud Bigtable's performance depends heavily on row key design for efficient scans. By changing the row key to 'event_type#customer_id#timestamp', queries filtering by event type can use a single row key prefix scan, which is fast and avoids full table scans. This leverages Bigtable's lexicographic ordering to group all events of the same type together, making event-type filtering a range scan rather than a filter across unrelated rows.

Exam trap

Many candidates mistakenly think Bigtable supports secondary indexes like a relational database, leading them to choose Option B. However, Bigtable's architecture requires all access patterns to be designed into the row key for optimal performance.

How to eliminate wrong answers

Option A is wrong because column families in Bigtable are used for grouping related columns and access control, not for indexing or partitioning data by value; they do not improve query performance for filtering on a column value like event type. Option B is wrong because Bigtable does not support secondary indexes; it relies solely on the row key for data access, and adding a secondary index is not a feature of Bigtable. Option C is wrong because using a separate Bigtable instance for each event type would introduce significant operational overhead, data duplication, and cross-instance query complexity without solving the fundamental row key design issue.

1030
MCQmedium

A data engineering team needs to run complex analytical queries on terabytes of data stored in Cloud Storage. The queries are ad-hoc and require scanning large portions of the dataset. The team needs a serverless solution that optimizes for cost by charging only for the data processed. Which Google Cloud service should they use?

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

BigQuery is a serverless data warehouse with pay-per-query pricing, suited for ad-hoc analytics.

Why this answer

BigQuery is a serverless data warehouse that uses columnar storage and charges for the data scanned by queries. It is ideal for ad-hoc analytical queries on large datasets.

1031
MCQhard

You are optimizing a Cloud SQL for MySQL instance for an OLTP application. You observe frequent buffer pool contention and high disk reads per second. The instance has 16 vCPUs and 120 GB memory. What is the most effective initial tuning action?

A.Increase the max_connections parameter to handle more concurrent sessions.
B.Reduce max_heap_table_size to avoid in-memory temp tables spilling to disk.
C.Increase innodb_buffer_pool_size to 80% of available memory.
D.Enable query cache to cache SELECT results.
AnswerC

This allows more data in memory, reducing disk I/O.

Why this answer

Buffer pool contention and high disk reads per second are classic symptoms of an undersized InnoDB buffer pool. For a dedicated Cloud SQL for MySQL OLTP instance with 120 GB memory, increasing innodb_buffer_pool_size to 80% (96 GB) maximizes cached data and index pages in memory, reducing physical disk I/O and contention. This directly addresses the root cause—insufficient memory for the working set—without introducing side effects like connection overhead or query cache invalidation.

Exam trap

Google Cloud often tests the misconception that increasing max_connections or enabling the query cache is a universal performance fix, but the trap here is that buffer pool contention and high disk reads specifically point to an undersized innodb_buffer_pool_size, not to connection limits or caching of SELECT results.

How to eliminate wrong answers

Option A is wrong because increasing max_connections does not reduce buffer pool contention or disk reads; it may actually worsen contention by allowing more concurrent sessions to compete for the same limited buffer pool resources. Option B is wrong because reducing max_heap_table_size would force more temporary tables to disk, increasing disk reads per second, which is the opposite of the desired effect. Option D is wrong because the query cache is deprecated and removed in MySQL 8.0; even in earlier versions, it introduces mutex contention and is ineffective for write-heavy OLTP workloads, failing to address buffer pool contention or disk I/O.

1032
MCQhard

An organization has a Cloud Deploy delivery pipeline with a canary deployment strategy to GKE. They want to automatically pause the rollout if the canary revision's error rate exceeds 5% for 5 minutes. Which feature should they use?

A.Canary deployment strategy with metric analysis
B.PreDeploy hook
C.Rollback on deploy failure
D.Manual approval gate
AnswerA

Cloud Deploy's canary strategy can use Cloud Monitoring metrics to automatically verify and progress or rollback.

Why this answer

Cloud Deploy can integrate with Cloud Monitoring metrics to automate canary verification. By defining a canary deployment strategy with metric-based analysis, the rollout can be paused or rolled back if predefined thresholds are breached.

1033
MCQmedium

A company is migrating a MySQL database to Cloud SQL using Database Migration Service (DMS). The source database is on-premises and uses InnoDB tables. The migration job is configured as continuous (CDC). After starting the job, the full dump phase completes successfully, but the CDC phase shows no replicated changes. What is the most likely cause?

A.The Cloud SQL destination does not have public IP connectivity.
B.The source database is using MyISAM tables instead of InnoDB.
C.The DMS migration job was configured as one-time instead of continuous.
D.The source database does not have binary logging enabled.
AnswerD

Correct. DMS CDC requires binary logging on the source to capture ongoing changes.

Why this answer

Continuous CDC replication in DMS requires binary logging to be enabled on the source database. If binary logging is disabled, DMS cannot capture change data. The full dump works because it uses mysqldump, which does not rely on binary logs.

1034
Multi-Selecthard

You are designing a Cloud Bigtable row key for a social media feed where users see posts from friends. Queries are: get posts for a user (by user_id) ordered by timestamp most recent first, and get posts for a specific topic (by topic_id) ordered by timestamp. To support both access patterns efficiently, which TWO design strategies are appropriate? (Choose two.)

Select 2 answers
A.Use a single table with a row key composed of user_id#topic_id#timestamp
B.Create two tables: one with row key user_id#reverse_timestamp and another with topic_id#reverse_timestamp
C.Create a single table and use a secondary index on topic_id
D.Denormalize the data: store posts in two different tables for each access pattern
E.Use a row key that starts with a hash of the user_id and then includes topic_id and timestamp
AnswersB, D

Separate tables allow optimal row key for each access pattern.

Why this answer

To support multiple access patterns in Bigtable, you can either denormalize data into two tables with different row keys, or use a secondary index (but Bigtable doesn't support secondary indexes natively; you would create a separate table). The common approach is to create two tables: one with row key user_id#reverse_timestamp and another with topic_id#reverse_timestamp. Alternatively, you can use a single table with a composite key but scanning for topic would be inefficient.

The question asks for strategies. Two correct strategies: create separate tables for each pattern, or use a row key that combines user_id and topic_id but then you need to scan, so not ideal. Actually, the best practice is to have two tables.

So the correct answers are: 'Create two tables: one with row key user_id#reverse_timestamp and another with topic_id#reverse_timestamp' and 'Use row key design that includes both user_id and topic_id as a composite key'? The latter is not efficient. Let me think. For multiple access patterns, the standard Bigtable design is to duplicate data into multiple tables with different row keys.

So the correct options are those that mention separate tables. Among the options: 'Create a single table with a row key that starts with a hash of user_id and topic_id' would scatter data, not good. 'Use a secondary index on the table' is not supported. 'Create two tables with different row keys' is correct. 'Use a row key with user_id and topic_id concatenated and then timestamp' would allow scanning for a user but not for a topic unless you do a full scan. So the best two are: create two tables, and maybe use a row key that allows scanning for both? But that's not possible with a single key.

I'll set the correct answers to: 'Create two tables: one optimized for user queries and one for topic queries' and 'Use a row key that includes both user_id and topic_id as a composite key'? That would be inefficient for topic queries. I think the intended correct answers are the ones that mention duplication. Let me write plausible options.

To be accurate: The correct ones are: 'Create two tables: one with row key user_id#reverse_timestamp and another with topic_id#reverse_timestamp' and 'Denormalize the data into a separate table for topic queries'. So I'll set those as correct.

1035
MCQeasy

A team is migrating a MySQL database to Cloud SQL using mysqldump for the initial snapshot. The source database uses InnoDB tables. Which mysqldump flags should be used to ensure a consistent snapshot without locking tables?

A.--single-transaction --skip-lock-tables
B.--all-databases --routines
C.--lock-tables --single-transaction
D.--flush-logs --master-data=2
AnswerA

--single-transaction provides a consistent snapshot; --skip-lock-tables avoids additional locks.

Why this answer

--single-transaction uses a read transaction to get a consistent snapshot without table locks for InnoDB.

1036
MCQhard

A large e-commerce platform uses BigQuery for business intelligence. They have a fact table `orders` (10 TB, partitioned by order_date, clustered by customer_id) and a dimension table `customers` (2 TB, not partitioned, not clustered). The BI team runs a daily dashboard query that joins these tables on customer_id and filters on order_date = CURRENT_DATE() and customer_country = 'US'. The query currently scans the full `customers` table and 2 GB of the `orders` table, taking 30 seconds. The business wants to reduce cost and latency. The `customers` table has 500 million rows and is updated incrementally every hour. Which action will most effectively reduce the amount of data scanned and query time?

A.Cluster the `customers` table on customer_id.
B.Denormalize customer country and other attributes into the `orders` table.
C.Create a materialized view that joins `orders` and `customers` on customer_id.
D.Partition the `customers` table by customer_id.
AnswerA

Clustering by customer_id enables block-level pruning during the join, drastically reducing data scanned.

Why this answer

Clustering the `customers` table on `customer_id` will physically co-locate rows with the same `customer_id`, allowing the query to use block-level pruning when joining with the filtered `orders` table. Since the query filters `orders` by `order_date = CURRENT_DATE()` (2 GB scanned) and then joins on `customer_id`, BigQuery can skip reading most of the `customers` table if it is clustered on the join key, drastically reducing the 2 TB full scan and lowering both cost and latency.

Exam trap

Google Cloud often tests the misconception that partitioning is always the best optimization for large tables, but here partitioning by `customer_id` is invalid in BigQuery, and the real performance gain comes from clustering on the join key to enable block-level pruning.

How to eliminate wrong answers

Option B is wrong because denormalizing customer attributes into the `orders` table would increase storage costs and data duplication (10 TB fact table would grow significantly), and while it might avoid the join, it does not address the root cause of scanning the full `customers` table; it also complicates incremental updates. Option C is wrong because a materialized view that joins both tables would need to be refreshed every hour to reflect incremental customer updates, and it would still require scanning the full `customers` table during creation or refresh, not reducing the per-query scan for the current daily filter. Option D is wrong because partitioning the `customers` table by `customer_id` is not supported in BigQuery (partitioning must be on a date/timestamp or integer range column), and even if possible, it would not help since the query does not filter on a partition column for `customers`.

1037
MCQmedium

An e-commerce application uses Cloud Spanner for its global inventory database. The application experiences high write latency during peak hours. After reviewing the schema, the database engineer notices that the primary key is an auto-incrementing integer. What is the most likely cause of the high write latency?

A.The application is using read-only transactions instead of read-write transactions.
B.The database is configured with a backup retention period of 2 seconds.
C.The application is using read replicas that are out of date.
D.The monotonically increasing primary key creates a hotspot.
AnswerD

Spanner distributes data by key range; sequential keys cause all new rows to be written to a single node, creating a hotspot.

Why this answer

Cloud Spanner distributes data across splits based on the primary key range. A monotonically increasing integer primary key, such as an auto-incrementing ID, causes all new writes to target the same split (the highest key range), creating a hotspot. This single split becomes a bottleneck, leading to high write latency during peak hours, as Spanner cannot parallelize the writes across multiple nodes.

Exam trap

Google Cloud often tests the misconception that auto-incrementing keys are always optimal for performance, but in distributed databases like Spanner, they cause hotspots; candidates may incorrectly attribute latency to backup settings or read replicas instead of the key design flaw.

How to eliminate wrong answers

Option A is wrong because read-only transactions do not cause write latency; they are used for reading data and do not impact write performance. Option B is wrong because a backup retention period of 2 seconds is not a valid configuration (minimum retention is typically 1 day) and has no direct effect on write latency. Option C is wrong because read replicas (read-only nodes) are used for scaling reads, not writes; stale replicas do not cause high write latency.

1038
MCQhard

You are configuring error budget burn rate alerts for an SLO with a 30-day window. The SLO target is 99.9%. You want to set up a fast burn rate alert to quickly detect high consumption. Which alerting policy configuration should you use?

A.Burn rate threshold: 14, lookback window: 6 hours
B.Burn rate threshold: 14, lookback window: 1 hour
C.Burn rate threshold: 5, lookback window: 1 hour
D.Burn rate threshold: 5, lookback window: 6 hours
AnswerB

Correct: burn rate 14 with 1-hour lookback window detects when error budget is being consumed at a rate that would exhaust it in about 2.14 days, suitable for fast burn rate alerts.

Why this answer

A burn rate of 14 with a 1-hour lookback is the standard configuration for a fast burn rate alert in Google Cloud SRE practices. It detects when the error budget is being consumed significantly faster than allowed, providing rapid alerting. Option A uses a 6-hour window (delaying the alert), option C uses burn rate 5 (slow burn rate, exhaustion in ~6 days), and option D uses both wrong settings.

1039
MCQeasy

A small business runs a MySQL OLTP database for their inventory management system. They need high availability with automatic failover and regional disaster recovery. Which Google Cloud database service meets these requirements with minimal operational overhead?

A.Cloud Spanner
B.Cloud Bigtable
C.Cloud SQL with HA and cross-region read replicas
D.Compute Engine with self-managed MySQL
AnswerC

Cloud SQL HA provides automatic failover, and cross-region replicas enable disaster recovery.

Why this answer

Cloud SQL for MySQL with high availability (HA) configuration provides automatic failover within a region and can be configured with cross-region replicas for disaster recovery.

1040
Matchingmedium

Match each Google Cloud tool to its purpose in database management.

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

Concepts
Matches

Web-based UI for managing resources

Command-line tool for managing Google Cloud services

Browser-based terminal with pre-installed tools

Infrastructure as code for provisioning databases

Observability and alerting for database performance

Why these pairings

Cloud SQL, Cloud Spanner, and BigQuery are core Google Cloud database tools. Cloud SQL is for managed relational databases, Cloud Spanner for globally distributed relational databases, and BigQuery for analytics. Distractors confuse Cloud SQL with NoSQL services and Cloud Spanner with caching services.

1041
MCQhard

A data engineer is migrating a legacy on-premises Oracle data warehouse to Google Cloud. The source schema uses star schemas and advanced Oracle features like materialized views. The target must support real-time data from streaming sources and run complex SQL joins over 50 TB of data with low latency. Which architecture is most appropriate?

A.Migrate to AlloyDB and use columnar engine for analytics.
B.Migrate to Cloud Spanner and use its analytics interface.
C.Migrate to BigQuery and use streaming inserts for real-time data.
D.Migrate to Cloud SQL for PostgreSQL and use read replicas for analytics.
AnswerC

BigQuery is a data warehouse that supports streaming and complex queries.

Why this answer

BigQuery is the most appropriate target because it supports real-time streaming inserts, can handle complex SQL joins over 50 TB of data with low latency via its columnar storage and distributed query engine, and can replace Oracle materialized views with logical views or scheduled queries. It also natively integrates with streaming sources like Pub/Sub, making it ideal for the real-time data requirement.

Exam trap

A common misconception is that AlloyDB or Cloud Spanner can handle large-scale analytics workloads, but the key differentiator is that BigQuery is purpose-built for serverless analytics with streaming ingestion, while the others are primarily transactional databases with limited analytical capabilities at this scale.

How to eliminate wrong answers

Option A is wrong because AlloyDB is optimized for transactional workloads and its columnar engine is designed for hybrid transactional/analytical processing (HTAP), not for petabyte-scale analytics with low-latency complex joins over 50 TB. Option B is wrong because Cloud Spanner is a globally distributed relational database for strong consistency and high availability, but its analytics interface is limited and not designed for the scale and complexity of star-schema joins over 50 TB with real-time streaming. Option D is wrong because Cloud SQL for PostgreSQL is a managed OLTP database with limited storage (up to 30 TB) and read replicas that do not support real-time streaming inserts or the analytical performance needed for complex joins over 50 TB.

1042
Multi-Selecteasy

A company wants to use Cloud Logging to monitor for a specific error pattern in their application logs. They want to create a metric that counts occurrences of the error and then set up an alert when the count exceeds 100 in 5 minutes. Which TWO components are required? (Choose 2)

Select 2 answers
A.Notification channel (e.g., email)
B.Log-based distribution metric
C.Alerting policy with metric threshold condition
D.Cloud Monitoring dashboard
E.Log-based counter metric
AnswersC, E

Triggers when the counter metric exceeds 100 over a sliding window.

Why this answer

A log-based counter metric counts matching log entries. An alerting policy can then be configured to trigger when the metric exceeds a threshold. The metric itself does not need to be distribution-based (that's for histogram values).

The alignment period is part of the alert condition, not a separate component.

1043
Multi-Selecteasy

Which TWO are effective strategies to control costs when running BI queries on BigQuery? (Choose two.)

Select 2 answers
A.Set a maximum bytes billed limit for user projects.
B.Create materialized copies of tables for each dashboard.
C.Schedule queries to run every minute to keep the cache warm.
D.Enable BI Engine for all tables to speed up queries.
E.Use flat-rate reservations for predictable workloads.
AnswersA, E

It prevents queries from scanning too much data.

Why this answer

Setting a maximum bytes billed limit for user projects in BigQuery allows you to cap the amount of data processed per query, preventing runaway costs from accidental or inefficient queries. This is a direct cost control mechanism that enforces a hard stop on query bytes processed, ensuring that users cannot exceed a predefined budget.

Exam trap

The trap here is that candidates often confuse performance optimization strategies (like BI Engine or caching) with cost control measures, but the question specifically asks for strategies that control costs, not improve speed.

1044
MCQeasy

A DevOps engineer is bootstrapping a new Google Cloud organization. They need to enforce that all Compute Engine VM instances must use Shielded VM features. Which method should they use?

A.Create a custom IAM role that grants compute.instances.create permission only for Shielded VM projects.
B.Use Deployment Manager templates that include Shielded VM initialization config.
C.Apply an organization policy with constraint constraints/compute.requireShieldedVm at the organization level.
D.Enable Shielded VM as a default in the Compute Engine service quota settings.
AnswerC

Organization policies enforce resource constraints across the hierarchy, and requireShieldedVm ensures all VMs have Shielded VM enabled.

Why this answer

Organization policies allow you to centrally constrain resource usage across the entire resource hierarchy. The 'constraints/compute.requireShieldedVm' policy enforces Shielded VM on all new VMs. IAM roles control access but not resource configurations.

1045
MCQmedium

A Cloud Spanner instance is backing up a 2 TB database daily to Cloud Storage using the built-in backup feature. The compliance team requires the backup to be stored in a specific regional bucket with a retention policy of 14 days. How should the database administrator configure this?

A.Schedule a cron job to copy the backup from Spanner's default location to the regional bucket
B.Use the gcloud spanner databases export command to export the database to a Cloud Storage bucket in the desired region, then set a retention policy on the bucket
C.Use the CREATE BACKUP statement and specify a Cloud Storage bucket in the desired region
D.Use the backup retention period in Spanner's backup settings to keep backups for 14 days
AnswerB

Correct. Export to Cloud Storage allows specifying a regional bucket. Object lifecycle rules can enforce a 14-day retention.

Why this answer

Spanner database backups are stored as managed backups within the Spanner service, not directly as files in Cloud Storage. However, they can be exported to Cloud Storage using the export API. The export can be configured to a specific bucket and region, and object lifecycle rules can enforce retention.

1046
Multi-Selectmedium

A company is migrating a monolithic application to Google Cloud and needs to modernize the database layer. The application has both OLTP (high-volume transactions) and OLAP (complex reporting) workloads. The team wants to use a single database to simplify operations but with high performance for both. Which TWO Google Cloud database services support hybrid transactional/analytical processing (HTAP)? (Choose two.)

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

AlloyDB includes a columnar engine for analytics on transactional data.

Why this answer

AlloyDB with columnar engine and Spanner with analytics interface support HTAP. Cloud SQL and Bigtable do not natively support HTAP. BigQuery is purely analytical.

1047
MCQmedium

A site reliability engineer is defining an SLO for a service that processes user uploads. The team wants to measure success as the proportion of uploads completed within 2 seconds. Which type of SLI should they use?

A.Throughput-based SLI measuring requests per second
B.Freshness-based SLI measuring time since last successful upload
C.Latency-based SLI measuring proportion of requests under a threshold
D.Availability-based SLI using successful/total requests
AnswerC

This directly captures the requirement: fraction of uploads completed within 2 seconds.

Why this answer

This scenario describes a request-based SLI where each upload is a request, and success is defined by latency being under a threshold (2 seconds). Request-based SLIs count good requests (those meeting the criteria) over total requests.

1048
MCQhard

An organization wants to implement privileged access management (PAM) for their Google Cloud environment. They need to grant temporary, just-in-time access to production projects for incident responders. Which GCP service should they use?

A.Use Cloud IAM Conditions to grant roles with a time constraint (e.g., request.time < timestamp).
B.Create custom roles that are only granted during incident response drills.
C.Use Cloud Audit Logs to monitor and revoke access after the incident.
D.Use VPC Service Controls to allow access only from specific IPs.
AnswerA

IAM Conditions can include temporal conditions, providing just-in-time access that expires automatically.

Why this answer

Cloud IAM Conditions with Access Context Manager can be used to enforce time-based conditions on IAM roles. Additionally, using Cloud IAM's 'iam.roles.update' with time-based conditions or using the Cloud Asset Inventory for access approval are not standard. The best approach is to use Cloud IAM Conditions to grant roles that expire after a defined duration, combined with Access Approval for review.

1049
MCQmedium

A company needs to perform real-time analytics on streaming data from IoT devices with millisecond latency for alerts, and also run complex historical analytics. Which Google Cloud database architecture supports both?

A.Cloud Bigtable for real-time and BigQuery for analytics
B.Cloud SQL (read-only replica) for analytics
C.Cloud Spanner with interleaved tables
D.AlloyDB with columnar engine
AnswerD

AlloyDB's HTAP capability supports both real-time and analytical workloads.

Why this answer

AlloyDB with columnar engine handles real-time inserts and fast analytical queries on the same data, ideal for HTAP workloads.

1050
MCQmedium

Refer to the exhibit. Which of the following statements is true regarding this schema design?

A.Deleting a Singer row will automatically delete all associated Album rows.
B.The Albums table cannot have any secondary indexes because of the INTERLEAVE clause.
C.The Albums table's rows are physically stored independent of the Singer table.
D.The Albums table's primary key must include the SingerId column only.
E.The ON DELETE CASCADE clause ensures that deleting an Album row will delete the corresponding Singer row.
AnswerA

The ON DELETE CASCADE clause enforces this behavior.

Why this answer

The `ON DELETE CASCADE` clause on the foreign key from `Albums` to `Singer` ensures that when a row in the `Singer` table is deleted, all rows in the `Albums` table that reference that singer are automatically deleted. This is a standard referential integrity behavior in relational databases, and in Cloud Spanner (the technology context for PCDE), it is enforced at the database level to maintain consistency.

Exam trap

Google Cloud often tests the direction of `ON DELETE CASCADE` — candidates mistakenly think it deletes the parent when a child is deleted, but it only propagates from parent to child.

How to eliminate wrong answers

Option B is wrong because the `INTERLEAVE` clause does not prevent secondary indexes on the `Albums` table; Cloud Spanner allows secondary indexes on interleaved tables, though they must be created with the `INTERLEAVE IN` option to maintain locality. Option C is wrong because the `INTERLEAVE` clause physically stores child rows (Albums) adjacent to their parent row (Singer) in the same split, not independently. Option D is wrong because the `Albums` table's primary key must include `SingerId` as the first column (due to interleaving), but it can and typically does include additional columns (e.g., `AlbumId`) to uniquely identify rows.

Option E is wrong because `ON DELETE CASCADE` propagates deletion from the parent (Singer) to the child (Albums), not the reverse; deleting an `Album` row does not delete the corresponding `Singer` row.

Page 13

Page 14 of 20

Page 15