Professional Cloud Developer Free Sample Questions

20 free sample questions289 in the full practice test Other version: GCP-PCD(156)

Try simulator

PCD Sample Questions

  1. Question 1

    Advanced

    Designing highly scalable, available, and reliable cloud-native applications · Selecting the appropriate storage system based on the volume of data and performance requirements

    A financial services company is building a new real-time fraud detection system on Google Cloud. The system must process millions of transactions per second with extremely low latency. A key requirement is that the database must provide strongly consistent reads across multiple geographic regions (North America, Europe, and Asia) to prevent transnational fraud. The development team is evaluating database options. Which data storage solution is the most appropriate choice to meet these specific requirements?

    Answer and explanation

    Correct answer: B

    Cloud Spanner is the only horizontally scalable, strongly consistent, relational database service that is specifically designed for multi-regional deployments with strong consistency. This directly meets the core requirement for strongly consistent reads across geographic regions to prevent fraud. Cloud Bigtable offers eventual consistency for multi-cluster routing. AlloyDB and Cloud SQL are regional services and cannot provide strongly consistent reads across multiple regions.

  2. Question 2

    Intermediate

    Designing highly scalable, available, and reliable cloud-native applications · Securing application artifacts using Binary Authorization

    A development team is using Cloud Build for their CI/CD pipeline. To improve security, they need to ensure that only container images that have passed a specific 'QA-Approved' vulnerability scan level in Artifact Analysis are allowed to be deployed to their production GKE cluster. Any attempt to deploy an image that does not have this attestation should be blocked. What should the team implement to enforce this policy?

    Answer and explanation

    Correct answer: C

    Binary Authorization is the Google Cloud service designed for this exact purpose. It allows you to create policies that enforce deploy-time security controls, ensuring that only trusted container images are deployed on GKE. You would create an attestor (a trusted authority) and configure your Cloud Build pipeline to create an attestation for an image only after it passes the QA vulnerability scan. The Binary Authorization policy on the GKE cluster would then check for this specific attestation at deployment time.

  3. Question 3

    Intermediate

    Integrating applications with Google Cloud services · Instrumenting code to facilitate troubleshooting using metrics, logs, and traces in Google Cloud Observability.

    You are instrumenting a Node.js application deployed on Cloud Run to send custom metrics to Cloud Monitoring. After deploying your code, you notice that no data appears in Metrics Explorer for your custom metric. The application logs in Cloud Logging show no errors related to authentication or metric publishing. You have already verified that the Cloud Monitoring API is enabled for the project. Which of the following is the most likely cause of the issue?

    Answer and explanation

    Correct answer: B

    Before you can write time series data for a custom metric, you must first create a metric descriptor, which defines the metadata for the metric, including its type, kind, and labels. The Monitoring API will silently drop data points written for a metric that does not have a corresponding descriptor. Since there are no authentication errors, this is the most probable cause.

  4. Question 4

    Beginner

    Designing highly scalable, available, and reliable cloud-native applications · Integrating applications using asynchronous or event-driven approaches (e.g., Eventarc, Pub/Sub)

    A developer is building an event-driven processing pipeline. The architecture requires that when a file is uploaded to a Cloud Storage bucket, a message containing the file's metadata is sent to a Pub/Sub topic. This message should then trigger a Cloud Run service for processing. The developer wants to set this up using a direct, event-based mechanism without writing custom trigger code. Which Google Cloud service should be used to connect the Cloud Storage event to the Pub/Sub topic?

    Answer and explanation

    Correct answer: C

    Eventarc is designed to build event-driven architectures by creating triggers that route events from various Google Cloud sources (like Cloud Storage) to sinks (like Pub/Sub, Cloud Run, etc.). It provides a standardized way to manage the flow of events without needing to write custom code for the trigger mechanism itself.

  5. Question 5

    Intermediate

    Designing highly scalable, available, and reliable cloud-native applications · Securing service-to-service communications (e.g., Cloud Service Mesh, Kubernetes Network Policies)

    A developer needs to deploy a containerized application to a new GKE cluster. The application has a web frontend and a backend processing service that communicate with each other. For security, the developer must prevent all other pods in the cluster from communicating with the backend service, while still allowing the frontend pods to reach it. Which Kubernetes object should be created to enforce this traffic rule?

    Answer and explanation

    Correct answer: C

    A Kubernetes NetworkPolicy is the standard way to control traffic flow at the IP address or port level (OSI layer 3 or 4) between pods in a cluster. You can define an ingress rule for the backend pods that specifically allows traffic only from pods with the frontend's label, while denying all other in-cluster traffic by default.

  6. Question 6

    Intermediate

    Building and testing applications · Using Cloud Build and Artifact Registry to build and store containers from source code

    You are building a CI/CD pipeline using Cloud Build. The build process requires a specific version of a proprietary code analysis tool that is not available in the standard Cloud Build builder images. You want to make this tool available to your build steps while following security best practices and ensuring build reproducibility. What is the recommended approach?

    Answer and explanation

    Correct answer: C

    Creating a custom builder image is the recommended best practice. This approach encapsulates the dependency within a versioned Docker image, which can be stored securely in Artifact Registry. It ensures that builds are faster (no download/install step) and more reliable and reproducible, as they always use the exact same environment.

  7. Question 7

    BeginnerMultiple answers

    Building and testing applications · Writing unit tests with the help of Gemini Code Assist.

    A new developer on your team is using Gemini Code Assist in their IDE. They want to generate unit tests for a complex function they have written in Python. Which TWO of the following actions are best practices for effectively using Gemini Code Assist for this task? (Select TWO).

    Answer and explanation

    Correct answers: A, C

  8. Question 8

    Intermediate

    Deploying applications · Deploying applications from source code

    You are deploying a new version of a critical microservice to Cloud Run. To minimize the risk of a faulty deployment affecting all users, you want to first deploy the new version without sending it any production traffic. After verifying its health through internal tests, you then want to gradually shift 100% of the traffic to it. Which deployment command sequence should you use?

    Answer and explanation

    Correct answer: B

    This sequence correctly implements the desired strategy. The --no-traffic flag deploys the new revision but does not allocate any production traffic to it, allowing for safe, isolated testing. The second command, update-traffic, then safely migrates traffic to the new, verified revision. The --migrate-gradually flag can be used to perform a gradual rollout.

  9. Question 9

    Intermediate

    Designing highly scalable, available, and reliable cloud-native applications · Authenticating to Google Cloud services (e.g., Application Default Credentials, JSON Web Token [JWT], OAuth 2.0, Cloud SQL Auth Proxy, AlloyDB Auth Proxy)

    Your application, running on Compute Engine, needs to read sensitive configuration data stored in Secret Manager. To adhere to the principle of least privilege and avoid managing service account keys, what is the most secure method for the application to authenticate to the Secret Manager API?

    Answer and explanation

    Correct answer: B

    This is the most secure and recommended method. By attaching a service account to the VM instance, the application can use the Google Cloud client libraries, which automatically find and use the credentials provided by the instance's metadata server via Application Default Credentials (ADC). This completely avoids the need to handle, distribute, and rotate static key files.

  10. Question 10

    Intermediate

    Integrating applications with data and storage services · Managing connections to various Google Cloud datastores (e.g., Cloud SQL, Firestore, Cloud Storage)

    True or False: When using the Cloud SQL Auth Proxy to connect from a GKE pod to a Cloud SQL instance, you must configure a firewall rule to allow TCP traffic on port 3307 from the GKE nodes to the Cloud SQL instance's public IP address.

    Answer and explanation

    Correct answer: B

    False. The Cloud SQL Auth Proxy works by creating a secure tunnel using SSL/TLS over port 443 to communicate with the Cloud SQL APIs. It does not connect directly to the database port (e.g., 3306 for MySQL, 5432 for PostgreSQL). Therefore, you do not need to open the database port in any firewall rules; you only need outbound internet access on port 443.

Register free for 10 more questions

Or unlock all 289 PCD questions with explanations, timed mode and flashcards.