Google

Professional Cloud Developer Free Practice Questions — Page 12

Question 111

You recently developed a web application to transfer log data to a Cloud Storage bucket daily. Authenticated users will regularly review logs from the prior two weeks for critical events. After that, logs will be reviewed once annually by an external auditor. Data must be stored for a period of no less than 7 years. You want to propose a storage solution that meets these requirements and minimizes costs. What should you do? (Choose two.)

A. Use the Bucket Lock feature to set the retention policy on the data.
B. Run a scheduled job to set the storage class to Coldline for objects older than 14 days.
C. Create a JSON Web Token (JWT) for users needing access to the Coldline storage buckets.
D. Create a lifecycle management policy to set the storage class to Coldline for objects older than 14 days.
E. Create a lifecycle management policy to set the storage class to Nearline for objects older than 14 days.
Show Answer
Correct Answer: A, D
Explanation:
The logs must be retained for at least 7 years, which is best enforced with a bucket retention policy protected by Bucket Lock so data cannot be deleted early (A). To minimize storage costs while keeping recent logs readily accessible and older logs infrequently accessed, use a lifecycle management policy to automatically transition objects older than 14 days to a lower-cost class such as Coldline (D).

Question 112

Your team is developing a Cloud Function triggered by Cloud Storage events. You want to accelerate testing and development of your Cloud Function while following Google-recommended best practices. What should you do?

A. Create a new Cloud Function that is triggered when Cloud Audit Logs detects the cloudfunctions.functions.sourceCodeSet operation in the original Cloud Function. Send mock requests to the new function to evaluate the functionality.
B. Make a copy of the Cloud Function, and rewrite the code to be HTTP-triggered. Edit and test the new version by triggering the HTTP endpoint. Send mock requests to the new function to evaluate the functionality.
C. Install the Functions Frameworks library, and configure the Cloud Function on localhost. Make a copy of the function, and make edits to the new version. Test the new version using curl.
D. Make a copy of the Cloud Function in the Google Cloud console. Use the Cloud console's in-line editor to make source code changes to the new function. Modify your web application to call the new function, and test the new version in production
Show Answer
Correct Answer: C
Explanation:
Google-recommended best practice for accelerating Cloud Functions development is to run and test functions locally using the Functions Framework. This allows rapid iteration without repeated deployments, supports event-driven functions (including Cloud Storage events), and enables sending mock requests (for example with curl) to validate behavior. The other options rely on additional deployed resources, production testing, or unnecessary architectural changes, which slow development and are not recommended.

Question 113

Your team is setting up a build pipeline for an application that will run in Google Kubernetes Engine (GKE). For security reasons, you only want images produced by the pipeline to be deployed to your GKE cluster. Which combination of Google Cloud services should you use?

A. Cloud Build, Cloud Storage, and Binary Authorization
B. Google Cloud Deploy, Cloud Storage, and Google Cloud Armor
C. Google Cloud Deploy, Artifact Registry, and Google Cloud Armor
D. Cloud Build, Artifact Registry, and Binary Authorization
Show Answer
Correct Answer: D
Explanation:
Cloud Build is used to build container images in a controlled CI pipeline, Artifact Registry securely stores those images, and Binary Authorization enforces that only images built and attested by the trusted pipeline can be deployed to GKE. This combination directly satisfies the requirement that only pipeline-produced images run in the cluster.

Question 114

You are supporting a business-critical application in production deployed on Cloud Run. The application is reporting HTTP 500 errors that are affecting the usability of the application. You want to be alerted when the number of errors exceeds 15% of the requests within a specific time window. What should you do?

A. Create a Cloud Function that consumes the Cloud Monitoring API. Use Cloud Scheduler to trigger the Cloud Function daily and alert you if the number of errors is above the defined threshold.
B. Navigate to the Cloud Run page in the Google Cloud console, and select the service from the services list. Use the Metrics tab to visualize the number of errors for that revision, and refresh the page daily.
C. Create an alerting policy in Cloud Monitoring that alerts you if the number of errors is above the defined threshold.
D. Create a Cloud Function that consumes the Cloud Monitoring API. Use Cloud Composer to trigger the Cloud Function daily and alert you if the number of errors is above the defined threshold.
Show Answer
Correct Answer: C
Explanation:
The requirement is automated, near real-time alerting when HTTP 500 errors exceed 15% of requests over a time window for a Cloud Run service. Cloud Monitoring natively supports request/error metrics for Cloud Run and allows alerting policies with ratio-based conditions and time windows. Creating an alerting policy is the simplest, most reliable, and recommended solution. The other options add unnecessary custom code, scheduling, or manual monitoring and do not provide proper real-time alerting suitable for a business-critical production application.

Question 115

You need to build a public API that authenticates, enforces quotas, and reports metrics for API callers. Which tool should you use to complete this architecture?

A. App Engine
B. Cloud Endpoints
C. Identity-Aware Proxy
D. GKE Ingress for HTTP(S) Load Balancing
Show Answer
Correct Answer: B
Explanation:
The requirements are authentication, quota enforcement, and API metrics for a public API. Cloud Endpoints is specifically designed to provide these API management features, including auth, rate limiting/quotas, monitoring, and logging. App Engine is an application runtime, Identity-Aware Proxy is for securing internal apps rather than managing public APIs, and GKE Ingress only handles load balancing, not API management.

Question 116

You noticed that your application was forcefully shut down during a Deployment update in Google Kubernetes Engine. Your application didn’t close the database connection before it was terminated. You want to update your application to make sure that it completes a graceful shutdown. What should you do?

A. Update your code to process a received SIGTERM signal to gracefully disconnect from the database.
B. Configure a PodDisruptionBudget to prevent the Pod from being forcefully shut down.
C. Increase the terminationGracePeriodSeconds for your application.
D. Configure a PreStop hook to shut down your application.
Show Answer
Correct Answer: A
Explanation:
During a Deployment update, Kubernetes sends a SIGTERM signal to containers and waits for the grace period before forcefully killing them. To ensure a graceful shutdown (such as closing database connections), the application itself must handle SIGTERM and perform cleanup logic. PodDisruptionBudgets only limit voluntary disruptions, terminationGracePeriodSeconds only provides more time but does not add shutdown logic, and a PreStop hook is secondary to proper signal handling in the application.

Question 117

You are a lead developer working on a new retail system that runs on Cloud Run and Firestore in Datastore mode. A web UI requirement is for the system to display a list of available products when users access the system and for the user to be able to browse through all products. You have implemented this requirement in the minimum viable product (MVP) phase by returning a list of all available products stored in Firestore. A few months after go-live, you notice that Cloud Run instances are terminated with HTTP 500: Container instances are exceeding memory limits errors during busy times. This error coincides with spikes in the number of Datastore entity reads. You need to prevent Cloud Run from crashing and decrease the number of Datastore entity reads. You want to use a solution that optimizes system performance. What should you do?

A. Modify the query that returns the product list using integer offsets.
B. Modify the query that returns the product list using limits.
C. Modify the Cloud Run configuration to increase the memory limits.
D. Modify the query that returns the product list using cursors.
Show Answer
Correct Answer: D
Explanation:
The crashes and read spikes are caused by loading and returning all product entities at once, which consumes large amounts of memory and generates excessive Datastore reads. Increasing memory only masks the issue. Offsets are inefficient because Datastore still reads skipped entities, and limits alone do not support efficient pagination. Using cursors enables efficient pagination by resuming queries from the last position without rereading prior entities, significantly reducing memory usage and Datastore reads while improving overall performance.

Question 118

You need to deploy an internet-facing microservices application to Google Kubernetes Engine (GKE). You want to validate new features using the A/B testing method. You have the following requirements for deploying new container image releases: • There is no downtime when new container images are deployed. • New production releases are tested and verified using a subset of production users. What should you do?

A. 1. Configure your CI/CD pipeline to update the Deployment manifest file by replacing the container version with the latest version. 2. Recreate the Pods in your cluster by applying the Deployment manifest file. 3. Validate the application's performance by comparing its functionality with the previous release version, and roll back if an issue arises.
B. 1. Create a second namespace on GKE for the new release version. 2. Create a Deployment configuration for the second namespace with the desired number of Pods. 3. Deploy new container versions in the second namespace. 4. Update the Ingress configuration to route traffic to the namespace with the new container versions.
C. 1. Install the Anthos Service Mesh on your GKE cluster. 2. Create two Deployments on the GKE cluster, and label them with different version names. 3. Implement an Istio routing rule to send a small percentage of traffic to the Deployment that references the new version of the application.
D. 1. Implement a rolling update pattern by replacing the Pods gradually with the new release version. 2. Validate the application's performance for the new subset of users during the rollout, and roll back if an issue arises.
Show Answer
Correct Answer: C
Explanation:
The requirements explicitly call for A/B testing with a subset of production users and no downtime. This is best achieved with a canary-style deployment where traffic is split between versions. Installing Anthos Service Mesh (Istio) and using routing rules to send a percentage of traffic to a new Deployment enables controlled traffic splitting without downtime. Option B is blue/green but does not natively support fine-grained traffic percentage routing via Ingress alone, and rolling updates in D do not provide true A/B testing.

Question 119

Your team manages a large Google Kubernetes Engine (GKE) cluster. Several application teams currently use the same namespace to develop microservices for the cluster. Your organization plans to onboard additional teams to create microservices. You need to configure multiple environments while ensuring the security and optimal performance of each team’s work. You want to minimize cost and follow Google-recommended best practices. What should you do?

A. Create new role-based access controls (RBAC) for each team in the existing cluster, and define resource quotas.
B. Create a new namespace for each environment in the existing cluster, and define resource quotas.
C. Create a new GKE cluster for each team.
D. Create a new namespace for each team in the existing cluster, and define resource quotas.
Show Answer
Correct Answer: D
Explanation:
Google-recommended best practice for multi-team GKE usage is to use namespaces for isolation. Creating a new namespace per team provides logical isolation for resources, enables independent resource quotas and RBAC, improves security and performance isolation, and avoids the high cost and operational overhead of multiple clusters. Option B focuses on environments rather than teams, and A lacks isolation. C is unnecessarily expensive.

Question 120

You have deployed a Java application to Cloud Run. Your application requires access to a database hosted on Cloud SQL. Due to regulatory requirements, your connection to the Cloud SQL instance must use its internal IP address. How should you configure the connectivity while following Google-recommended best practices?

A. Configure your Cloud Run service with a Cloud SQL connection.
B. Configure your Cloud Run service to use a Serverless VPC Access connector.
C. Configure your application to use the Cloud SQL Java connector.
D. Configure your application to connect to an instance of the Cloud SQL Auth proxy.
Show Answer
Correct Answer: B
Explanation:
Cloud Run must reach a Cloud SQL instance over its internal (private) IP via a VPC network. The Google‑recommended approach is to attach a Serverless VPC Access connector to the Cloud Run service, which provides a network path into the VPC so the service can connect to the Cloud SQL instance’s private IP. Cloud SQL connectors/Auth Proxy handle authentication but do not create network connectivity; a VPC connector is still required for private IP access.

$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.