Google

Professional Cloud Developer Free Practice Questions

This is the free Google Professional Cloud Developer practice question bank — 180 of 358 total questions, each with a full explanation, free to read with no signup required. Updated 2026-08-06.

Every answer is verified against official Google documentation — see our methodology.

Question 1

You are a developer at an ecommerce company. You are tasked with developing a globally consistent shopping cart for logged-in users across both mobile and desktop clients. You need to configure how the items that are added to users’ carts are stored. How should you configure this cart service?

A. Store the carts in a separate Memorystore for Redis instance, and configure each user's IP address as the key.
B. Store the carts in a separate Firestore document, and configure each user ID as the document's key.
C. Insert the carts in a separate Spanner table, and configure each user's encrypted password as the primary key.
D. Create and store the carts in the shopping-cart HTTP cookie.
Show Answer
Correct Answer: B
Explanation:
A globally consistent shopping cart for logged-in users should be keyed by a stable user identifier and stored in a durable, scalable database accessible from all clients. Firestore is well suited for user-specific documents with automatic scaling and multi-region options. Redis keyed by IP is ephemeral and IP addresses are not stable user identities. Using an encrypted password as a Spanner primary key is inappropriate and poor security practice. Storing the cart solely in an HTTP cookie is client-side, size-limited, and cannot reliably synchronize across devices.

Question 2

Your team is trying to reduce their cloud spend, and you want to evaluate your GKE Autopilot cluster costs. When reviewing the manifests, you see that resource requests are currently not specified. Your application is stateless and fault-tolerant, and there are no specific hardware or memory requirements on nodes. You want to modify the cluster to be scalable and cost-effective as quickly as possible while maintaining a cluster with sufficient computing resources. What should you do?

A. Request that your Pods run as Spot Pods, and use the cloud.google.com/gke-spot=true label in your YAML manifest.
B. Request the Balanced compute class in your YAML manifest.
C. In the YAML deployment configuration manifest, request and set the maximum CPU to 5 vCPU.
D. Set up Cloud Trace and Cloud Monitoring, identify the maximum memory used in the past 30 days, and set the YAML manifest to request that amount of memory.
Show Answer
Correct Answer: A
Explanation:
For a stateless, fault-tolerant workload with no special hardware requirements, using GKE Autopilot Spot Pods is the quickest way to reduce compute costs. Spot Pods run on spare capacity at a lower price and are appropriate for workloads that can tolerate interruption. The other options either do not primarily optimize cost or recommend resource settings without workload-based sizing.

Question 3

You are building a Workflow to process complex data analytics for your application. You plan to use the Workflow to execute a Cloud Run job while following Google-recommended practices. What should you do?

A. Create a Pub/Sub topic, and subscribe the Cloud Run job to the topic.
B. Configure an Eventarc trigger to invoke the Cloud Run job, and include the trigger in a step of the Workflow.
C. Use the Cloud Run Admin API connector to execute the Cloud Run job within the Workflow.
D. Determine the entry point of the Cloud Run job, and send an HTTP request from the Workflow.
Show Answer
Correct Answer: C
Explanation:
Google Cloud Workflows is designed to orchestrate Google Cloud services using built-in connectors where available. To execute a Cloud Run Job, the recommended approach is to use the Cloud Run Admin API connector from a workflow step. This provides authenticated, managed integration without requiring custom HTTP calls or event infrastructure. Pub/Sub and Eventarc are intended for event-driven patterns rather than directly orchestrating a job from a workflow, and invoking a job via its entry point is not how Cloud Run Jobs are executed.

Question 4

You are developing a new Python 3 API that needs to be deployed to Cloud Run. Your Cloud Run service sits behind an Apigee proxy. You need to ensure that the Cloud Run service is running with the already deployed Apigee proxy. You want to conduct this testing as quickly as possible. What should you do?

A. Store the service code as a zip file in a Cloud Storage bucket. Deploy your application by using the gcloud run deploy --source command, and test the integration by pointing Apigee to Cloud Run.
B. Use the Cloud Run emulator to test your application locally. Test the integration by pointing Apigee to your local Cloud Run emulator.
C. Build a container image locally, and push the image to Artifact Registry. Deploy the Image to Cloud Run, and test the integration by pointing Apigee to Cloud Run.
D. Deploy your application directly from the current directory by using the gcloud run deploy --source command, and test the integration by pointing Apigee to Cloud Run.
Show Answer
Correct Answer: D
Explanation:
Using `gcloud run deploy --source` from the current directory is the fastest workflow. Cloud Run automatically builds the container from source using Cloud Build, stores the image, deploys the service, and then you can point the existing Apigee proxy to the deployed Cloud Run service. The local emulator cannot be directly integrated with a deployed Apigee proxy, and manually building/pushing images or staging a zip in Cloud Storage adds unnecessary steps.

Question 5

You are developing a new mobile game that will be deployed on GKE and Cloud Run as a set of microservices. Currently, there are no projections for the game’s user volume. You need to store the following data types: • Data type 1: leaderboard data • Data type 2: player profiles, chats, and news feed • Data type 3: player clickstream data for BI You need to identify a data storage solution that is easy to use, cost-effective, scalable, and supports offline caching on the user’s device. Which data storage option should you choose for the different data types?

A. • Data type 1: Memorystore • Data type 2: Firestore • Data type 3: BigQuery
B. • Data type 1: Memorystore • Data type 2: Spanner • Data type 3: Bigtable
C. • Data type 1: Firestore • Data type 2: Cloud SQL • Data type 3: BigQuery
D. • Data type 1: Firestore • Data type 2: Firestore • Data type 3: BigQuery
Show Answer
Correct Answer: D
Explanation:
Firestore is a good fit for mobile game backend data with unknown scale because it is serverless, auto-scales, is easy to use, and supports offline persistence/caching in mobile SDKs. Leaderboard data can be stored in Firestore when simplicity and offline client support are requirements. Player profiles, chats, and news feeds are a classic Firestore use case. Clickstream analytics data is best stored in BigQuery for BI and analytics. Memorystore is an in-memory cache and does not provide offline client caching, while Cloud SQL and Spanner are less aligned with the stated requirements for mobile offline support and unknown scale.

Question 6

Your company is planning a global event. You need to configure an event registration portal for the event. You have decided to deploy the registration service by using Cloud Run. Your company’s marketing team does not want to advertise the Cloud Run service URL. They want the registration portal to be accessed by using a personalized hostname or path in your custom domain URL pattern, for example,

A. Configure Cloud Armor to block traffic on the Cloud Run service URL and allow reroutes from only the custom domain URL pattern.
B. Set up an HAProxy on Compute Engine, and add routing rules for a custom domain to the Cloud Run service URL.
C. Add a global external Application Load Balancer in front of the service, and configure a DNS record that points to the load balancer’s IP address.
D. Create a CNAME record that points to the Cloud Run service URL.
Show Answer
Correct Answer: C
Explanation:
A global external Application Load Balancer is the recommended way to expose Cloud Run under a custom domain with advanced routing (hostnames and paths), TLS termination, and a static IP. You then point your DNS record to the load balancer's IP address. A CNAME directly to the Cloud Run URL is not the recommended approach for custom routing patterns, Cloud Armor alone does not provide hostname/path remapping, and managing HAProxy on Compute Engine is unnecessary for this use case.

Question 7

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 want to minimize maintenance of the application’s underlying infrastructure. How should you deploy the microservice?

A. Use Cloud Run 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 GKE Standard.
D. Use Cloud Shell to containerize your microservice, and deploy it on a Container-Optimized OS Compute Engine instance.
Show Answer
Correct Answer: B
Explanation:
Cloud Run is a fully managed serverless platform for deploying containerized applications, including C++ services with custom libraries. Cloud Build can build the container image and integrate with Artifact Registry, after which deploying to Cloud Run minimizes infrastructure management. Cloud Run functions are intended for function workloads rather than arbitrary containerized microservices, while GKE Standard and Compute Engine require more infrastructure maintenance.

Question 8

Your team developed a web-based game that has many simultaneous players. Recently, users have started to complain that the leaderboard tallies the top scores too slowly. You investigated the issue and discovered that the application stack is currently using Cloud SQL for PostgreSQL. You want to improve the leaderboard performance as much as possible to provide a better user experience. What should you do?

A. Re-implement the leaderboard data to be stored in Memorystore for Redis.
B. Optimize the SQL queries to minimize slow-running queries.
C. Migrate the database and store the data in AlloyDB.
D. Update Cloud SQL for PostgreSQL to the latest version.
Show Answer
Correct Answer: A
Explanation:
A real-time leaderboard with many concurrent reads and writes benefits from an in-memory data store. Memorystore for Redis provides very low-latency operations and supports data structures such as sorted sets that are well suited for maintaining ranked leaderboards. Query optimization, upgrading PostgreSQL, or migrating to AlloyDB may improve database performance, but they are less effective than using Redis for this specific access pattern.

Question 9

You are developing a custom job scheduler that must have a persistent cache containing entries of all Compute Engine VMs that are in a running state (not deleted, stopped, or suspended). The job scheduler checks this cache and only sends jobs to the available Compute Engine VMs in the cache. You need to ensure that the available Compute Engine instance cache is not stale. What should you do?

A. Set up an organization-level Cloud Storage log sink with a filter to capture the audit log events for Compute Engine. Configure an Eventarc trigger that executes when the Cloud Storage bucket is updated and sends these events to the application to update the cache.
B. Set up a Cloud Asset Inventory real-time feed of insert and delete events with the asset types filter set to compute.googleapis.com/Instance. Configure an Eventarc trigger that sends these events to the application to update the cache.
C. Set up an organization-level Pub/Sub log sink with a filter to capture the audit log events for Compute Engine. Configure an Eventarc trigger that sends these events to the application to update the cache.
D. Set up an organization-level BigQuery log sink. Configure the application to query this BigQuery table every minute to retrieve the last minute’s events and update the cache.
Show Answer
Correct Answer: C
Explanation:
Use an event-driven pipeline based on Cloud Audit Logs exported to Pub/Sub. Compute Engine instance lifecycle and state-change audit events can be filtered and delivered with low latency, and Eventarc can trigger the cache update service so the scheduler's persistent cache stays current. Cloud Storage and BigQuery sinks add unnecessary latency, while a Cloud Asset Inventory feed of only insert/delete events would miss important running-state transitions such as stop, start, and suspend.

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.

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