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: Performance testing must run against the real Cloud Spanner service because the emulator does not represent production performance characteristics. Since builds may run concurrently, each test needs an isolated environment. Creating a dedicated Cloud Spanner instance per build, loading the test data, and deleting the instance afterward provides isolation and avoids interference between concurrent runs. Reusing a single instance risks contention, and creating an entire new project is unnecessary overhead compared to provisioning an instance.
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 Scheduler's direct HTTP invocation is blocked by a Cloud Run service configured with Internal ingress, resulting in 403 despite the invoker role. Using Cloud Scheduler to publish to Pub/Sub, with a push subscription (or Eventarc integration as appropriate) to Cloud Run, avoids direct external HTTP access while preserving internal-only ingress. Additional Cloud Run developer permissions are not required, changing ingress weakens the intended restriction, and relying on VM cron jobs is not the managed solution.
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 run a containerized application, use managed services, avoid implementing authentication in the application, and offload SSL termination and certificate management. Google Kubernetes Engine provides the container platform, Cloud Load Balancing provides global load balancing and SSL termination, Google-managed certificates handle certificate lifecycle, and Identity-Aware Proxy (IAP) provides authentication and authorization without application-level auth. The other options each address only part of the requirements (NGINX Ingress for routing, cert-manager for certificates, or Cloud Endpoints on Compute Engine) and do not provide the complete managed authentication and SSL solution.
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: Publishing email requests to Pub/Sub decouples the request path from email delivery, providing durable message buffering, automatic scaling, and retry behavior. A Cloud Function triggered by Pub/Sub processes messages asynchronously, reducing the chance of email loss during traffic spikes or transient failures. Increasing timeouts does not address reliability, Memorystore is not a durable queue, and client-side retries every second can amplify failures and still lose requests.
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: Cloud Monitoring natively collects GKE container metrics and supports alerting policies with threshold conditions. You can configure alerts for average memory utilization falling below 20% or exceeding 80% without building custom Cloud Functions or scripts, making it the recommended and operationally efficient approach.
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 designed for deploying stateless containerized services without managing the underlying infrastructure. A C++ microservice with custom libraries can be packaged into a container, Cloud Build can build the container image, and Cloud Run runs it serverlessly. Cloud Functions is not the best fit for a custom C++ containerized microservice, while Compute Engine and standard GKE require infrastructure management.
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: The requirement is an isolated testing environment with fully automated creation and minimal ongoing effort. Creating a separate Google Cloud project provides strong isolation from production. Using Terraform as infrastructure as code is the recommended approach for fully automating and reproducibly provisioning both the project and the Cloud Run service. Traffic splitting within the same project does not provide the requested isolation, and while gcloud commands can automate deployment, Terraform is better suited for repeatable environment provisioning.
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: Eventarc is designed to decouple event routing from application logic and supports flexible event filtering and multiple trigger types. It can filter Cloud Storage events (including object updates and attribute filters such as bucket and object name/path patterns) and route them to Cloud Run. This best matches the requirements that the trigger may change over time and that trigger configuration should remain simple for multiple team members to manage.
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: Instrumenting the application with OpenTelemetry provides distributed tracing (and optionally metrics/logs), allowing you to identify where latency occurs across calls to third-party services. This is the most effective way to diagnose unpredictable performance. Installing the Ops Agent or enabling Managed Service for Prometheus focuses on infrastructure or metrics collection but does not provide end-to-end request tracing by itself. Forwarding the X-Cloud-Trace-Context header alone propagates trace context but does not create the instrumentation needed to generate spans and analyze latency.
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: The goal is to perform an A/B test on live production traffic by exposing a controlled percentage of users to the existing and new color schemes simultaneously, then comparing conversion/sales with statistical analysis. Weighted traffic splitting accomplishes this. Option B is a sequential rollout, not an A/B test. Option C mirrors requests but does not expose users to the new UI or generate real user behavior. Option D describes feature-flag-based experimentation, which is a valid product technique in general, but given the Cloud Run traffic-management context of the question, the expected Google Cloud solution is weighted traffic splitting via the external HTTP(S) load balancer.
$19
Get all 358 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.