Professional Cloud Developer Free Practice Questions — Page 5
Question 41
You have an application running in production on Cloud Run. Your team needs to change one of the application’s services to return a new field. You want to test the new revision on 10% of your clients using the least amount of effort. You also need to keep your service backward compatible.
What should you do?
A. Replace the current service with the new revision. Deploy the new revision with no traffic allocated. After the deployment, split the traffic between the previous service and the new revision.
B. Update the current service with the new changes. Deploy the new revision. After the deployment, split the traffic between the current service and the new revision.
C. Update the current service with the new changes. Deploy the new revision with no traffic allocated. Split the traffic between the current service and the new revision.
D. Replace the current service with the new revision. Deploy the new revision. Create a load balancer to split the traffic between the previous service and the new revision.
Show Answer
Correct Answer: B
Explanation: Cloud Run automatically creates a new revision when you deploy changes to an existing service. To test the change with 10% of users, you simply deploy the new revision and then use Cloud Run’s built-in traffic splitting to route 10% of traffic to it. There is no need to first deploy with zero traffic, as traffic allocation can be adjusted immediately after deployment. This approach is the least effort and keeps backward compatibility by allowing most users to continue using the previous revision.
Question 42
You work for a financial services company that has a container-first approach. Your team develops microservices applications. You have a Cloud Build pipeline that creates a container image, runs regression tests, and publishes the image to Artifact Registry. You need to ensure that only containers that have passed the regression tests are deployed to GKE clusters. You have already enabled Binary Authorization on the GKE clusters. What should you do next?
A. Deploy Voucher Server and Voucher Client components. After a container image has passed the regression tests, run Voucher Client as a step in the Cloud Build pipeline.
B. Create an attestor and a policy. Run a vulnerability scan to create an attestation for the container image as a step in the Cloud Build pipeline.
C. Create an attestor and a policy. Create an attestation for the container images that have passed the regression tests as a step in the Cloud Build pipeline.
D. Set the Pod Security Standard level to Restricted for the relevant namespaces. Digitally sign the container images that have passed the regression tests as a step in the Cloud Build pipeline.
Show Answer
Correct Answer: C
Explanation: Binary Authorization enforces deployment decisions based on attestations. To ensure only images that passed regression tests are deployed, you must create a Binary Authorization attestor and policy, then generate an attestation after the regression tests succeed in the Cloud Build pipeline. GKE will then allow deployment only for images with the required attestation.
Question 43
You are a developer that works for a local concert venue. Customers use your company’s website to purchase tickets for events. You need to provide customers with immediate confirmation when a selected seat has been reserved. How should you design the ticket ordering process?
A. Add the seat reservation to a Cloud Tasks queue, which triggers Workflows to process the seat reservation.
B. Publish the seat reservation to a Pub/Sub topic. Configure the backend service to use Eventarc to process the seat reservation on GKE.
C. Upload the seat reservation to a Cloud Storage bucket, which triggers an event to a Cloud Run service that processes the orders.
D. Submit the seat reservation in an HTTP POST request to an Application Load Balancer. Configure the Application Load Balancer to distribute the request to a Compute Engine managed instance group that processes the reservation.
Show Answer
Correct Answer: D
Explanation: The requirement is immediate seat reservation confirmation, which calls for synchronous request/response processing. Option D uses an HTTP POST through an Application Load Balancer to backend Compute Engine instances, allowing the reservation to be processed in real time and a confirmation returned directly to the customer. Options A, B, and C are event-driven or asynchronous patterns that introduce latency and do not guarantee immediate confirmation.
Question 44
You recently deployed an Apigee API proxy to your organization across two regions. Both regions are configured with a separate backend that is hosting the API. You need to configure Apigee to route traffic to the appropriate local region backend. What should you do?
A. Create a TargetEndpoint with a weighted load balancing algorithm. Configure the API proxy to use the same weights for each region's backend.
B. Configure a regional internal Application Load Balancer in each region, and use health checks to verify that each backend is active. Create a DNS A record that contains the IP addresses of both regions' load balancers. Configure a Targetserver for each region that uses this DNS name.
C. Configure a global external Application Load Balancer and configure each region’s backend with a different regional backend service. Each region communicates to this single global external Application Load Balancer as its TargetServer.
D. Configure a TargetServer for each region's backend host names. Configure the API proxy to choose the TargetServer based on the system.region.name flow variable.
Show Answer
Correct Answer: D
Explanation: Apigee exposes the system.region.name flow variable, which identifies the region handling the request. By configuring a TargetServer for each region’s backend and routing based on this variable, traffic is deterministically sent to the local regional backend, minimizing latency and avoiding unnecessary cross-region hops. The other options either introduce unnecessary global load balancing layers or do not ensure region-local routing.
Question 45
You work for an ecommerce company. Your company is migrating multiple applications to Google Cloud, and you are assisting with the migration of one of the applications. The application is currently deployed on a VM without any OS dependencies. You have created a Dockerfile and used it to upload a new image to Artifact Registry. You want to minimize the infrastructure and operational complexity. What should you do?
A. Deploy the image to Cloud Run.
B. Deploy the image to a GKE Autopilot cluster.
C. Deploy the image to a GKE Standard cluster.
D. Deploy the image to a Compute Engine instance.
Show Answer
Correct Answer: A
Explanation: Cloud Run is a fully managed, serverless platform for running containerized applications. Since the app is already containerized, has no OS dependencies, and the goal is to minimize infrastructure and operational complexity, Cloud Run eliminates the need to manage servers or Kubernetes clusters while providing automatic scaling and simple deployment.
Question 46
Your team currently uses Bigtable as their database backend. In your application's app profile, you notice that the connection to the Bigtable cluster is specified as single-cluster routing, and the cluster’s connection logic is configured to conduct manual failover when the cluster is unavailable. You want to optimize the application code to have more efficient and highly available Bigtable connectivity. What should you do?
A. Set up Memcached so that queries hit the cache layer first and automatically get data from Bigtable in the event of a cache miss.
B. Increase the Bigtable client’s connection pool size.
C. Configure a Dataflow template, and use a Beam connector to stream data changes.
D. Configure the app profile to use multi-cluster routing.
Show Answer
Correct Answer: D
Explanation: Bigtable high availability and efficient failover are achieved by using multi-cluster routing in the app profile. This allows the client library to automatically route requests to a healthy cluster without manual failover logic, improving availability and simplifying application code. The other options do not address Bigtable connectivity or failover behavior.
Question 47
You are developing a discussion portal that is built on Cloud Run. Incoming external requests are routed through a set of microservices before a response is sent. Some of these microservices connect to databases. You need to run a load test to identify any bottlenecks in the application when it is under load. You want to follow Google-recommended practices. What should you do?
A. Modify the response to include a time series that shows elapsed time per service. Use Log Analytics in Cloud Logging to create a heatmap that exposes any service that could be a bottleneck.
B. Configure Cloud Trace to capture the requests from the load testing clients. Review the timings in Cloud Trace.
C. Expose the latency metrics per service for each request. Configure Google Cloud Managed Service for Prometheus, and use it to scrape and analyze the metrics.
D. Add log statements that capture elapsed time. Analyze the logs and metrics by using BigQuery.
Show Answer
Correct Answer: B
Explanation: Cloud Trace provides distributed tracing that captures end-to-end request latency across Cloud Run microservices. During load testing, it allows you to see per-service and per-hop timing to identify bottlenecks, which is the Google-recommended approach for analyzing latency in microservice architectures. The other options rely on custom logging or metrics and are less effective for request-level bottleneck analysis.
Question 48
Your infrastructure team is responsible for creating and managing Compute Engine VMs. Your team uses the Google Cloud console and gcloud CLI to provision resources for the development environment. You need to ensure that all Compute Engine VMs are labeled correctly for compliance reasons. In case of missing labels, you need to implement corrective actions so the labels are configured accordingly without changing the current deployment process. You want to use the most scalable approach. What should you do?
A. Use a Cloud Audit Logs trigger to invoke a Cloud Function when a Compute Engine VM is created. Check for missing labels and assign them if necessary.
B. Deploy resources with Terraform. Use the gcloud terraform vet command with a policy to ensure that every Compute Engine VM that is provisioned by Terraform has labels set.
C. Write a script to check all Compute Engine VMs for missing labels regularly by using Cloud Scheduler. Use the script to assign the labels.
D. Check all Compute Engine VMs for missing labels regularly. Use the console to assign the labels.
Show Answer
Correct Answer: A
Explanation: Using Cloud Audit Logs as a trigger to invoke a Cloud Function enables automatic, real-time enforcement of labels whenever a Compute Engine VM is created. This approach scales well, works regardless of whether resources are provisioned via the console or gcloud CLI, and does not require changing the existing deployment process. The function can detect missing labels and apply corrective actions immediately, ensuring continuous compliance.
Question 49
You work for an environmental agency in a large city. You are developing a new monitoring platform that will capture air quality readings from thousands of locations in the city. You want the air quality reading devices to send and receive their data payload to the newly created RESTful backend systems every minute by using a curl command. The backend systems are running in a single cloud region and are using Premium Tier networking. You need to connect the devices to the backend while minimizing the daily average latency, measured by using Time to First Byte (TTFB). How should you build this service?
A. 1. Run the air quality devices’ backends on Compute Engine VMs. 2. Create a weighted round robin routing policy on Cloud DNS. 3. Configure the air quality devices to connect by using this DNS.
B. 1. Run the air quality devices’ backends on Compute Engine VMs. 2. Create a round robin routing policy on Cloud DNS for these Compute Engine VMs. 3. Configure the air quality devices to connect by using this DNS.
C. 1. Run the air quality devices' backends in a managed instance group. 2. Create an external passthrough Network Load Balancer to connect to the managed instance group. 3. Configure a connection between the air quality devices and the Network Load Balancer.
D. 1 Run the air quality devices' backends in a managed instance group. 2. Create an external Application Load Balancer, and connect it to the managed instance group. 3. Configure a connection between the air quality devices and the Application Load Balancer.
Show Answer
Correct Answer: D
Explanation: To minimize average TTFB for RESTful HTTP traffic from thousands of devices, you should use Google’s global, Premium Tier HTTP(S) infrastructure. An external Application Load Balancer provides global anycast IPs, intelligent routing, and HTTP optimizations that reduce latency compared to DNS-based routing or regional network load balancers. Running the backends in a managed instance group enables scaling and health checking, while the Application Load Balancer is specifically optimized for HTTP/HTTPS REST APIs and delivers the lowest latency over Premium Tier networking.
Question 50
You are developing a secure document sharing platform. The platform allows users to share documents with other users who may be external to their organization. Access to these documents should be revoked after a configurable time period. The documents are stored in Cloud Storage. How should you configure Cloud Storage to support this functionality?
A. Create signed policy documents on the Cloud Storage bucket.
B. Apply access control list (ACL) permissions to the Cloud Storage bucket.
C. Generate a signed URL for each document the user wants to share.
D. Grant the Storage Object Viewer IAM role to all authenticated users.
Show Answer
Correct Answer: C
Explanation: Signed URLs provide time-limited, revocable access to specific Cloud Storage objects without requiring the recipient to have a Google account or IAM permissions. This directly supports secure sharing with external users and automatic access expiration. ACLs and IAM are not time-bound per object, and signed policy documents are for uploads, not controlled downloads.
$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.