Google

Professional Cloud Developer Free Practice Questions — Page 10

Question 91

You work on an application that relies on Cloud Spanner as its main datastore. New application features have occasionally caused performance regressions. You want to prevent performance issues by running an automated performance test with Cloud Build for each commit made. If multiple commits are made at the same time, the tests might run concurrently. What should you do?

A. Create a new project with a random name for every build. Load the required data. Delete the project after the test is run.
B. Create a new Cloud Spanner instance for every build. Load the required data. Delete the Cloud Spanner instance after the test is run.
C. Create a project with a Cloud Spanner instance and the required data. Adjust the Cloud Build build file to automatically restore the data to its previous state after the test is run.
D. Start the Cloud Spanner emulator locally. Load the required data. Shut down the emulator after the test is run.
Show Answer
Correct Answer: B
Explanation:
You need reliable, isolated, and realistic performance testing that can run concurrently for multiple commits. Creating a separate Cloud Spanner instance per build provides full isolation, avoids test interference, and uses the real managed service so performance characteristics (latency, throughput, locking, scaling) are accurate. The Cloud Spanner emulator is not suitable for performance testing because it does not replicate production performance or scalability. Reusing a single instance or project risks data contention and inconsistent results under concurrent runs. Although more costly, per-build instances are the correct approach for automated performance regression testing.

Question 92

You manage a system that runs on stateless Compute Engine VMs and Cloud Run instances. Cloud Run is connected to a VPC, and the ingress setting is set to Internal. You want to schedule tasks on Cloud Run. You create a service account and grant it the roles/run.invoker Identity and Access Management (IAM) role. When you create a schedule and test it, a 403 Permission Denied error is returned in Cloud Logging. What should you do?

A. Grant the service account the roles/run.developer IAM role.
B. Configure a cron job on the Compute Engine VMs to trigger Cloud Run on schedule.
C. Change the Cloud Run ingress setting to 'Internal and Cloud Load Balancing.'
D. Use Cloud Scheduler with Pub/Sub to invoke Cloud Run.
Show Answer
Correct Answer: D
Explanation:
Cloud Run with ingress set to Internal cannot be invoked directly by Cloud Scheduler’s HTTP target, which runs outside the VPC and results in a 403 error even with the run.invoker role. Using Cloud Scheduler to publish messages to Pub/Sub, and configuring a Pub/Sub push subscription (or event trigger) to invoke the Cloud Run service with the proper service account, allows scheduled execution while respecting the internal-only ingress setting.

Question 93

You need to containerize a web application that will be hosted on Google Cloud behind a global load balancer with SSL certificates. You don’t have the time to develop authentication at the application level, and you want to offload SSL encryption and management from your application. You want to configure the architecture using managed services where possible. What should you do?

A. Host the application on Google Kubernetes Engine, and deploy an NGINX Ingress Controller to handle authentication.
B. Host the application on Google Kubernetes Engine, and deploy cert-manager to manage SSL certificates.
C. Host the application on Compute Engine, and configure Cloud Endpoints for your application.
D. Host the application on Google Kubernetes Engine, and use Identity-Aware Proxy (IAP) with Cloud Load Balancing and Google-managed certificates.
Show Answer
Correct Answer: D
Explanation:
The requirements are to avoid building application-level authentication, offload SSL termination and certificate management, use a global HTTPS load balancer, and prefer managed services. Identity-Aware Proxy provides authentication and access control in front of the application without code changes. Cloud Load Balancing with Google‑managed certificates handles global HTTPS and SSL offloading. Running the containerized app on GKE integrates natively with these services. The other options either do not provide authentication (B), add unnecessary custom components (A), or are less aligned with containerized, managed architectures (C).

Question 94

You manage a microservice-based ecommerce platform on Google Cloud that sends confirmation emails to a third-party email service provider using a Cloud Function. Your company just launched a marketing campaign, and some customers are reporting that they have not received order confirmation emails. You discover that the services triggering the Cloud Function are receiving HTTP 500 errors. You need to change the way emails are handled to minimize email loss. What should you do?

A. Increase the Cloud Function's timeout to nine minutes.
B. Configure the sender application to publish the outgoing emails in a message to a Pub/Sub topic. Update the Cloud Function configuration to consume the Pub/Sub queue.
C. Configure the sender application to write emails to Memorystore and then trigger the Cloud Function. When the function is triggered, it reads the email details from Memorystore and sends them to the email service.
D. Configure the sender application to retry the execution of the Cloud Function every one second if a request fails.
Show Answer
Correct Answer: B
Explanation:
Using Pub/Sub decouples email production from delivery by introducing a durable queue. Messages are retained even if the Cloud Function or third‑party email service fails, enabling retries and smoothing traffic spikes from the campaign. This minimizes email loss and improves reliability and scalability compared to synchronous HTTP calls or simple retries.

Question 95

Your team recently deployed an application on Google Kubernetes Engine (GKE). You are monitoring your application and want to be alerted when the average memory consumption of your containers is under 20% or above 80%. How should you configure the alerts?

A. Create a Cloud Function that consumes the Monitoring API. Create a schedule to trigger the Cloud Function hourly and alert you if the average memory consumption is outside the defined range.
B. In Cloud Monitoring, create an alerting policy to notify you if the average memory consumption is outside the defined range.
C. Create a Cloud Function that runs on a schedule, executes kubectl top on all the workloads on the cluster, and sends an email alert if the average memory consumption is outside the defined range.
D. Write a script that pulls the memory consumption of the instance at the OS level and sends an email alert if the average memory consumption is outside the defined range.
Show Answer
Correct Answer: B
Explanation:
Google Cloud Monitoring natively collects container-level memory metrics from GKE. Creating an alerting policy there allows you to define thresholds (below 20% or above 80%) on average memory utilization and receive notifications without custom code. The other options add unnecessary complexity and are less reliable than built-in monitoring.

Question 96

You are tasked with using C++ to build and deploy a microservice for an application hosted on Google Cloud. The code needs to be containerized and use several custom software libraries that your team has built. You do not want to maintain the underlying infrastructure of the application. How should you deploy the microservice?

A. Use Cloud Functions to deploy the microservice.
B. Use Cloud Build to create the container, and deploy it on Cloud Run.
C. Use Cloud Shell to containerize your microservice, and deploy it on a Container-Optimized OS Compute Engine instance.
D. Use Cloud Shell to containerize your microservice, and deploy it on standard Google Kubernetes Engine.
Show Answer
Correct Answer: B
Explanation:
Cloud Run is a fully managed, serverless platform for running containerized applications, so you do not need to manage servers or clusters. It supports any language, including C++, as long as the app is packaged as a container, and it works well with custom libraries. Cloud Build can build the container image automatically. Cloud Functions does not natively support C++, and Compute Engine or GKE would require managing infrastructure, which the requirement explicitly avoids.

Question 97

You are defining your system tests for an application running in Cloud Run in a Google Cloud project. You need to create a testing environment that is isolated from the production environment. You want to fully automate the creation of the testing environment with the least amount of effort and execute automated tests. What should you do?

A. Using Cloud Build, execute Terraform scripts to create a new Google Cloud project and a Cloud Run instance of your application in the Google Cloud project.
B. Using Cloud Build, execute a Terraform script to deploy a new Cloud Run revision in the existing Google Cloud project. Use traffic splitting to send traffic to your test environment.
C. Using Cloud Build, execute gcloud commands to create a new Google Cloud project and a Cloud Run instance of your application in the Google Cloud project.
D. Using Cloud Build, execute gcloud commands to deploy a new Cloud Run revision in the existing Google Cloud project. Use traffic splitting to send traffic to your test environment.
Show Answer
Correct Answer: A
Explanation:
You need an environment that is isolated from production, fully automated, and requires the least ongoing effort. Creating a separate Google Cloud project provides the strongest isolation boundary. Using Cloud Build with Terraform enables fully automated, repeatable, infrastructure-as-code provisioning of both the project and the Cloud Run service, which aligns with best practices for system tests. Options that deploy revisions into the same project rely on traffic splitting and do not provide full isolation, and using ad‑hoc gcloud commands is less maintainable and reproducible than Terraform.

Question 98

You are developing a new application. You want the application to be triggered only when a given file is updated in your Cloud Storage bucket. Your trigger might change, so your process must support different types of triggers. You want the configuration to be simple so that multiple team members can update the triggers in the future. What should you do?

A. Configure Cloud Storage events to be sent to Pub/Sub, and use Pub/Sub events to trigger a Cloud Build job that executes your application.
B. Create an Eventarc trigger that monitors your Cloud Storage bucket for a specific filename, and set the target as Cloud Run.
C. Configure a Cloud Function that executes your application and is triggered when an object is updated in Cloud Storage.
D. Configure a Firebase function that executes your application and is triggered when an object is updated in Cloud Storage.
Show Answer
Correct Answer: B
Explanation:
The requirements emphasize flexibility in triggers, future changes, and simple configuration for multiple team members. Eventarc is designed for event-driven architectures and supports multiple event sources and flexible filtering (such as specific filenames) without changing application code. Using Eventarc with Cloud Run cleanly decouples the trigger from the application and makes it easy to add or modify triggers later. Cloud Functions (C) are simpler for basic cases but are more tightly coupled to a specific trigger type and are less flexible as requirements evolve.

Question 99

Your ecommerce application receives external requests and forwards them to third-party API services for credit card processing, shipping, and inventory management as shown in the diagram. Your customers are reporting that your application is running slowly at unpredictable times. The application doesn’t report any metrics. You need to determine the cause of the inconsistent performance. What should you do?

A. Install the OpenTelemetry library for your respective language, and instrument your application.
B. Install the Ops Agent inside your container and configure it to gather application metrics.
C. Modify your application to read and forward the X-Cloud-Trace-Context header when it calls the downstream services.
D. Enable Managed Service for Prometheus on the Google Kubernetes Engine cluster to gather application metrics.
Show Answer
Correct Answer: A
Explanation:
The problem describes slow, unpredictable performance and no existing application metrics. Because the application forwards requests to multiple third‑party services, the key need is distributed tracing and in‑application instrumentation to see where latency occurs. Installing and instrumenting with OpenTelemetry provides end‑to‑end traces (and metrics/logs if needed) across inbound requests and downstream API calls, allowing you to pinpoint which dependency or code path causes delays. Ops Agent or Prometheus focus on infrastructure or exposed metrics, not detailed request tracing, and forwarding only the X‑Cloud‑Trace‑Context header is insufficient without proper instrumentation.

Question 100

You are using Cloud Run to host a global ecommerce web application. Your company’s design team is creating a new color scheme for the web app. You have been tasked with determining whether the new color scheme will increase sales. You want to conduct testing on live production traffic. How should you design the study?

A. Use an external HTTP(S) load balancer to route a predetermined percentage of traffic to two different color schemes of your application. Analyze the results to determine whether there is a statistically significant difference in sales.
B. Use an external HTTP(S) load balancer to route traffic to the original color scheme while the new deployment is created and tested. After testing is complete, reroute all traffic to the new color scheme. Analyze the results to determine whether there is a statistically significant difference in sales.
C. Use an external HTTP(S) load balancer to mirror traffic to the new version of your application. Analyze the results to determine whether there is a statistically significant difference in sales.
D. Enable a feature flag that displays the new color scheme to half of all users. Monitor sales to see whether they increase for this group of users.
Show Answer
Correct Answer: A
Explanation:
This scenario calls for controlled A/B testing on live production traffic to measure the impact of a visual change on sales. Routing a fixed percentage of real user traffic to each variant via an external HTTP(S) load balancer enables a fair comparison under identical conditions and supports statistical analysis. The other options either do not compare variants simultaneously on live traffic or are not tied to Cloud Run traffic management at the infrastructure level.

$19

Get all 357 questions with detailed answers and explanations

  • Instant download HTML + PDF delivered the moment payment clears.
  • Secure Stripe checkout we never see or store your card details.
  • 7-day refund if files are defective see our refund policy.