Professional Cloud Developer Free Practice Questions — Page 3
Question 10
You are developing an application that needs to connect to a Cloud SQL for PostgreSQL database by using the Cloud SQL Auth Proxy. The Cloud SQL Auth Proxy is hosted in a different Google Cloud VPC network. The Cloud SQL for PostgreSQL instance has public and private IP addresses. You are required to use the private IP for security reasons. When testing the connection to the Cloud SQL instance, you can connect by using the public IP address, but you are unable to connect by using the private IP address. How should you fix this issue?
A. Run the Cloud SQL Auth Proxy as a background service.
B. Add the --private-ip option when starting the Cloud SQL Auth Proxy.
C. Set up VPC Network Peering between your VPC and the VPC where the Cloud SQL instance is deployed.
D. Grant yourself the IAM role that provides access to the Cloud SQL instance.
Show Answer
Correct Answer: C
Explanation: A Cloud SQL instance's private IP is only reachable over private network connectivity. Since the Cloud SQL Auth Proxy is running in a different VPC, you must establish network connectivity between the VPCs (such as VPC Network Peering or another supported private connectivity option) before the proxy can reach the instance's private IP. Running the proxy as a service or changing IAM permissions does not solve the network path issue, and the --private-ip flag only tells the proxy to prefer the private IP; it does not create connectivity.
Question 11
You have deployed an HTTP(s) Load Balancer with the gcloud commands shown below.
Health checks to port 80 on the Compute Engine virtual machine instance are failing and no traffic is sent to your instances. You want to resolve the problem.
Which commands should you run?
A. gcloud compute instances add-access-config ${NAME}-backend-instance-1
B. gcloud compute instances add-tags ${NAME}-backend-instance-1 --tags http-server
Explanation: Create an ingress firewall rule allowing TCP traffic from Google Cloud’s load-balancer health-check ranges (130.211.0.0/22 and 35.191.0.0/16). This allows the health checks to reach the VM on port 80. A and B do not configure the required firewall access, and D allows egress rather than the required ingress traffic.
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
Your teammate has asked you to review the code below. Its purpose is to efficiently add a large number of small rows to a BigQuery table.
Which improvement should you suggest your teammate make?
A. Include multiple rows with each request.
B. Perform the inserts in parallel by creating multiple threads.
C. Write each row to a Cloud Storage object, then load into BigQuery.
D. Write each row to a Cloud Storage object in parallel, then load into BigQuery.
Show Answer
Correct Answer: A
Explanation: The code sends a separate BigQuery insert request for every row. Batch multiple rows into each request to reduce network and API-call overhead and improve efficiency.
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 designing a schema for a table that will be moved from MySQL to Cloud Bigtable. The MySQL table is as follows:
How should you design a row key for Cloud Bigtable for this table?
A. Set Account_id as a key.
B. Set Account_id_Event_timestamp as a key.
C. Set Event_timestamp_Account_id as a key.
D. Set Event_timestamp as a key.
Show Answer
Correct Answer: B
Explanation: Use Account_id followed by Event_timestamp. This preserves the table’s composite key and keeps each account’s events together for efficient account-specific reads. Putting the timestamp first can concentrate sequential writes and cause hotspots.
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 are creating a Google Kubernetes Engine (GKE) cluster and run this command:
The command fails with the error:
You want to resolve the issue. What should you do?
A. Request additional GKE quota in the GCP Console.
B. Request additional Compute Engine quota in the GCP Console.
C. Open a support case to request additional GKE quota.
D. Decouple services in the cluster, and rewrite new clusters to function with fewer cores.
Show Answer
Correct Answer: B
Explanation: The error says the project lacks regional CPU quota. GKE worker nodes are Compute Engine VMs, so request additional Compute Engine CPU quota in the relevant region through the GCP Console.
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.
$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.