Google

Professional Cloud Developer Free Practice Questions

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

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 cart for logged-in users should be keyed by a stable user identifier and stored in a managed, scalable datastore. Firestore provides global replication, strong consistency for document reads/writes, and easy access from multiple clients, making it well-suited for per-user cart state. Using the user ID as the document key ensures the same cart is shared across mobile and desktop. The other options are flawed: IP addresses are unstable, encrypted passwords should never be used as keys, and cookies are device-specific and size-limited.

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:
In GKE Autopilot, costs are driven by the resources allocated to Pods. For a stateless, fault-tolerant application with no special hardware requirements, the fastest and most impactful way to reduce costs while remaining scalable is to use Spot Pods. Spot Pods provide significantly lower pricing and are well suited for workloads that can tolerate interruptions. The cloud.google.com/gke-spot=true label enables this behavior without requiring detailed tuning of resource requests or node configuration.

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 best practices recommend using built-in Standard Connectors to interact with Google Cloud services. For executing a Cloud Run job, the Cloud Run Admin API connector allows the Workflow to start the job directly in a secure, managed, and idiomatic way. Alternatives like Pub/Sub, Eventarc, or raw HTTP add unnecessary indirection and are not the recommended approach for direct orchestration from Workflows.

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 way to get a Python API running on Cloud Run. Cloud Run automatically builds the container image and deploys it, avoiding manual container build and registry steps. Once deployed, Apigee can immediately be pointed to the Cloud Run service endpoint to test the integration with the already deployed proxy.

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 easy to use, serverless, cost‑effective at unknown scale, and crucially provides built‑in offline caching via mobile SDKs. This makes it suitable for both leaderboard data (Data type 1) and player profiles, chats, and news feeds (Data type 2). BigQuery is the correct choice for large‑scale clickstream analytics and BI (Data type 3). Memorystore does not support offline caching on user devices, and Spanner/Cloud SQL add unnecessary complexity and cost for this use case.

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:
To expose a Cloud Run service on a custom domain or path without advertising the Cloud Run URL, you place it behind a global external Application Load Balancer. The load balancer provides a stable IP address, supports custom hostnames and URL routing, and can forward traffic to Cloud Run via serverless NEGs. You then point your domain’s DNS record to the load balancer IP. Cloud Run itself cannot be directly mapped via CNAME, and Cloud Armor or HAProxy are unnecessary or incorrect for this requirement.

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:
The goal is to run a C++ microservice with custom libraries while minimizing infrastructure management. Cloud Run is a fully managed serverless container platform that abstracts away servers, scaling, and OS maintenance. Cloud Build is the standard GCP service to build container images from source, including C++ applications with custom dependencies. Other options either are incorrect (Cloud Run functions is not a product) or require significantly more infrastructure management (GKE Standard or Compute Engine).

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 simultaneous players requires extremely low-latency reads/writes and high update throughput. An in-memory data store like Memorystore for Redis is purpose-built for this access pattern and supports fast counters, sorted sets, and ranking operations. The other options may provide incremental improvements but cannot match the performance gains of moving hot leaderboard data to Redis.

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:
To keep the cache from becoming stale, the scheduler must react immediately to VM lifecycle and state changes (start, stop, suspend, delete). Compute Engine Admin Activity audit logs record these state transitions in real time. Creating an organization-level Pub/Sub log sink for these audit logs and connecting it to Eventarc provides a push-based, event-driven mechanism to update the cache as soon as VM availability changes. Cloud Asset Inventory real-time feeds only cover asset creation and deletion, not running state transitions, and storage or BigQuery–based approaches introduce unnecessary latency.

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: B
Explanation:
When a Cloud SQL instance has both public and private IPs, the Cloud SQL Auth Proxy defaults to using the public IP unless instructed otherwise. To force the proxy to connect over the private IP, you must start it with the --private-ip flag. VPC peering does not provide access to Cloud SQL private IPs, and IAM roles or running the proxy as a service do not affect IP selection.

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