Google

Professional Cloud Developer Free Practice Questions — Page 2

Question 11

You are a developer at a large corporation. You manage three GKE clusters. Your team’s developers need to switch from one cluster to another regularly on the same workstation. You want to configure individual access to these multiple clusters securely while following Google-recommended practices. What should you do?

A. Ask the developers to use Cloud Shell and run the gcloud container clusters get-credentials command to switch to another cluster.
B. Ask the developers to open three terminals on their workstation and use the kubectl config set command to configure access to each cluster.
C. Ask the developers to install the gcloud CLI on their workstation and run the gcloud container clusters get-credentials command to switch to another cluster.
D. In a text file, define the clusters, users, and contexts. Email the file to the developers and ask them to use the kubectl config set command to add cluster, user, and context details to the file.
Show Answer
Correct Answer: C
Explanation:
The recommended practice is for developers to use the gcloud CLI on their own workstation and run `gcloud container clusters get-credentials` to retrieve cluster credentials and update their kubeconfig. This securely manages contexts and allows switching between multiple GKE clusters without manually distributing kubeconfig data. Cloud Shell is optional rather than required, manually editing kubeconfig is unnecessary, and emailing configuration files containing cluster/user information is not a recommended secure practice.

Question 12

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. Upload the seat reservation to a Cloud Storage bucket, which triggers an event to the backend service that processes the seat reservation.
B. Submit the seat reservation in an HTTP POST request to an Application Load Balancer. Configure the Application Load Balancer to distribute the request to the backend service that processes the seat reservation.
C. Add the seat reservation to a Cloud Tasks queue, which triggers Workflows to process the seat reservation.
D. Publish the seat reservation to a Pub/Sub topic. Configure the backend service to subscribe to the topic to process the seat reservation.
Show Answer
Correct Answer: B
Explanation:
Immediate confirmation requires a synchronous request/response path. Sending the seat reservation via an HTTP POST through an Application Load Balancer to the backend service allows the reservation to be processed immediately and the result returned to the customer. The other options (Cloud Storage events, Cloud Tasks/Workflows, and Pub/Sub) are asynchronous event-driven patterns and do not provide immediate reservation confirmation.

Question 13

You are building an application that will store frequently accessed data in a Memorystore for Redis Cluster instance. You would like to make the application resilient to network issues. You need to ensure that the application handles client disconnections from a Redis instance gracefully to minimize disruption and ensure stability of the application. What should you do?

A. Immediately terminate the application instance upon detecting a Redis disconnection to force a restart, and wait for clients to reconnect to the cache as soon as the application becomes available.
B. Configure the Redis client to reconnect after a fixed delay of 60 seconds.
C. Use Memorystore’s automatic failover mechanisms to make the Redis cache available in a secondary zone.
D. Implement exponential backoff with a jitter when reconnecting after a disconnection. Configure client-side caching to serve data during brief outages.
Show Answer
Correct Answer: D
Explanation:
Implementing exponential backoff with jitter is the recommended pattern for handling transient network failures because it avoids reconnection storms and reduces load during outages. Client-side caching can help serve cached data during brief disconnections, improving resilience. The other options are inferior: terminating the application is disruptive, a fixed 60-second retry is inflexible and can synchronize retries, and automatic failover improves availability but does not by itself address graceful client reconnection behavior.

Question 14

You have a Cloud Run service that connects to a Cloud SQL Enterprise edition database instance using the default Cloud SQL connection. You need to enable more than 100 connections per Cloud Run instance. What should you do?

A. Increase the queries per minute quota limit of the Cloud SQL Admin API.
B. Increase the max_connection flag in Cloud SQL for PostgresSQL.
C. Upgrade to Cloud SQL Enterprise Plus edition.
D. Use Cloud SQL Auth Proxy in a sidecar.
Show Answer
Correct Answer: C
Explanation:
The default Cloud SQL connector path used by Cloud Run has a connection limit per instance. To support more than 100 database connections per Cloud Run instance using the default Cloud SQL connection, you need Cloud SQL Enterprise Plus, which raises this limitation. Increasing the Cloud SQL Admin API quota is unrelated, increasing the PostgreSQL max_connections setting does not remove the connector limit, and using the Cloud SQL Auth Proxy sidecar does not increase the per-instance limit beyond the relevant connector constraints.

Question 15

You are deploying new workloads on a GKE Autopilot mode cluster. You need to ensure that the Pods are scheduled on nodes that use Arm architecture CPUs. The cluster currently has no Arm-based CPUs. You want to minimize cluster operations. How should you ensure that the workloads on the GKE cluster will use Arm-based CPU nodes?

A. Apply Pod tolerations to request GKE to avoid scheduling Pods on nodes that do not have Arm-based CPUs.
B. Apply node taints on node pools to tell GKE to only schedule your workloads on Arm-based CPU nodes.
C. Deploy a new cluster in GKE Standard mode, and set up a node pool with Arm-based CPU nodes. Use nodeSelector in your manifest to ensure that Pods are scheduled in this node pool.
D. Request the Scale-out compute class and the arm64 architecture in your manifest.
Show Answer
Correct Answer: D
Explanation:
In GKE Autopilot, you do not manage node pools, taints, or manually provision Arm nodes. Instead, you specify workload requirements in the Pod manifest. Requesting the arm64 architecture together with the appropriate ComputeClass (Scale-out compute class) allows Autopilot to provision Arm-based nodes automatically if none currently exist, minimizing cluster operations.

Question 16

You work for an ecommerce company. You are developing a new application with the following requirements: • The application must have access to the most up-to-date data at all times. • Due to company policy, data older than 30 days must be automatically deleted. You need to determine which service should host the database, and how to configure the data deletion. You want to use the most efficient solution. What should you do?

A. Configure Spanner to host the database. Use Data Catalog to delete data older than 30 days.
B. Configure Spanner to host the database. Create a time-to-live policy that deletes data older than 30 days.
C. Configure Bigtable to host the database. Create a time-to-live policy that deletes data older than 30 days.
D. Configure Bigtable to host the database. Create a garbage collection policy in Bigtable that deletes data older than 30 days.
Show Answer
Correct Answer: B
Explanation:
Cloud Spanner is the appropriate choice for an ecommerce application that requires strongly consistent, ACID-compliant access to the most up-to-date data. Cloud Spanner supports built-in row deletion through Time-to-Live (TTL) policies, allowing automatic deletion of data older than 30 days. Bigtable's garbage collection is designed for storage cleanup and does not provide the same transactional relational capabilities required for this scenario.

Question 17

You are developing a dashboard that aggregates temperature readings from thousands of IoT devices monitoring a city's ambient temperature. You expect a large amount of viewing traffic resulting in a large amount of data egress once the dashboard is live. The dashboard temperature display data doesn't need to be real-time and can tolerate a few seconds of lag. You decide to deploy Memorystore for Redis as the storage backend. You want to ensure that the dashboard will be highly available. How should you configure the service in Memorystore for Redis?

A. Update Memorystore for Redis to the latest version.
B. Configure Memorystore to use read replicas.
C. Use Private Service Access to enable low-latency network throughput.
D. Set up Serverless VPC Access to avoid receiving traffic over the internet.
Show Answer
Correct Answer: B
Explanation:
Read replicas allow a read-heavy workload to scale by serving read requests from replicas while improving availability. The dashboard tolerates slight replication lag, making read replicas an appropriate fit. The other options do not address scaling read traffic and high availability for this use case.

Question 18

You are deploying a containerized application to GKE. You have set up a build pipeline by using Cloud Build that builds a Java application and pushes the application container image to Artifact Registry. Your build pipeline executes multiple sequential steps that reference Docker container images with the same layers. You notice that the Cloud Build pipeline runs are taking longer than expected to complete. How should you optimize the Docker image build process?

A. Add the --squash parameter to the Docker build steps to combine newly built layers into a single layer.
B. Configure Cloud Build to use a private pool in your VPC for pipeline executions.
C. Specify the cached image by adding the --cache-from argument in your build config file with the image as a cache source.
D. Store container artifacts on Cloud Storage. Configure Cloud CDN on the Cloud Storage bucket to enable caching on edge locations.
Show Answer
Correct Answer: C
Explanation:
Cloud Build runs each build on a fresh worker, so the local Docker layer cache is not preserved between builds. Using the Docker build --cache-from option allows Docker to reuse layers from a previously built image stored in Artifact Registry, significantly reducing build time when many layers are unchanged. The other options do not address Docker layer cache reuse: --squash reduces image layers but not build caching, private pools primarily affect isolation/networking, and Cloud CDN with Cloud Storage is unrelated to container image build caching.

Question 19

You developed a Python script that retrieves information from files that are uploaded to Cloud Storage and writes the information to Bigtable. You have completed testing on your local environment and created the python-script service account with the Bigtable User IAM role. You want to deploy the code with the appropriate authentication while following Google-recommended practices. What should you do?

A. 1. Deploy your code to Cloud Functions. Create a Cloud Storage trigger. 2. Configure IAM binding for authentication.
B. 1. Deploy your code to Cloud Functions. Create a Cloud Storage trigger. 2. Create a service account key for authentication
C. 1. Deploy your image to Cloud Run. Create a trigger in Cloud Scheduler that triggers the service every minute. 2. Configure IAM binding for authentication.
D. 1. Deploy your image to Cloud Run. Create a trigger in Cloud Scheduler that triggers the service every minute. 2. Create a service account key for authentication.
Show Answer
Correct Answer: A
Explanation:
Use an event-driven Cloud Function triggered by Cloud Storage object uploads. Authenticate using the function's attached service account with the required Bigtable IAM role (IAM binding), which follows Google-recommended practice of avoiding long-lived service account keys. Cloud Scheduler is inappropriate because the workload is event-driven, and creating service account keys is discouraged.

Question 20

You are responsible for improving the security of your Cloud Run services to protect these services against supply chain threats. You need to ensure that there are adequate security controls such as SLSA Level 3 builds for container images and non-falsifiable provenance for container images by using Google Cloud tools. What should you do?

A. Ask developers to build container images locally and ensure strict version controls by using Container Registry.
B. Use Cloud Build to build container images. Configure a Binary Authorization policy on the Cloud Run job.
C. Use Cloud Deploy to generate authenticated and non-falsifiable build provenance for container images.
D. Use Cloud Build to build container images. Use Cloud Scheduler to automate delivery of your applications to a series of target environments in a defined sequence.
Show Answer
Correct Answer: B
Explanation:
Cloud Build provides out-of-the-box SLSA Level 3 builds for container images and generates authenticated, non-falsifiable build provenance. To protect Cloud Run deployments, enforce trust with Binary Authorization policies. Cloud Deploy is a deployment service and does not generate the build provenance itself. Sources: https://cloud.google.com/software-supply-chain-security/docs/overview https://cloud.google.com/security/solutions/software-supply-chain-security

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