Back to Google Professional Cloud Developer questions

Scenario-based practice

Refer to the Exhibit Practice Questions

Practise Google Professional Cloud Developer practice questions — original exam-style scenarios covering every exam domain, with detailed explanations, wrong-answer analysis, and common exam traps.

15
scenario questions
PCD
exam code
Google Cloud
vendor

Scenario guide

How to approach refer to the exhibit practice questions

Practise exhibit-style questions that ask you to read a topology, table, command output or diagram before choosing the best answer.

Quick answer

Exhibit-style questions test whether you can read a topology, command output, diagram or table before choosing the best answer.

How to extract the relevant detail from an exhibit.

How topology, command output or routing information affects the answer.

How to avoid answering from memory before reading the evidence.

How to map the exhibit back to the exam objective.

Related practice questions

Related PCD topic practice pages

Scenario questions usually connect to one or more exam topics. Use these links to review the underlying concepts behind the scenario.

Practice set

Practice scenarios

Question 1mediummultiple choice
Full question →

A developer runs the command shown in the exhibit. They need to ensure that the application running on instance-3 can be restored quickly if it fails. What should they do?

Exhibit

Refer to the exhibit.

gcloud compute instances list --format='table(name, zone, status, machineType, scheduling.preemptible)'

NAME        ZONE        STATUS    MACHINE_TYPE      PREEMPTIBLE
instance-1  us-central1-a RUNNING  n1-standard-1     false
instance-2  us-central1-b RUNNING  n1-standard-2     false
instance-3  us-central1-a TERMINATED n1-standard-1  false
instance-4  us-central1-c RUNNING  n1-standard-1     true
Question 2hardmultiple choice
Full question →

A developer finds the JSON key shown in the exhibit in a Cloud Storage bucket that is publicly accessible. Which security best practice was violated?

Network Topology
"private_key": "BEGIN PRIVATE KEYEND PRIVATE KEYRefer to the exhibit."type": "service_account","project_id": "my-project","private_key_id": "abc123",...","client_email": "sa@my-project.iam.gserviceaccount.com","client_id": "123456789","auth_uri": "https://accounts.google.com/o/oauth2/auth","token_uri": "https://oauth2.googleapis.com/token","auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/sa@my-project.iam.gserviceaccount.com"
Question 3hardmultiple choice
Full question →

You are troubleshooting a web application deployed on Compute Engine instances behind a target pool. Users report intermittent timeouts when accessing the application via the forwarding rule's IP address. Based on the exhibit, what is the most likely cause of the issue?

Network Topology
gcloud compute forwarding-rules listformat jsonRefer to the exhibit."name": "web-frontend","region": "us-central1","IPAddress": "34.123.45.67","IPProtocol": "TCP","portRange": "80-80","target": "https://www.googleapis.com/compute/v1/projects/my-project/regions/us-central1/targetPools/web-pool"
Question 4hardmultiple choice
Full question →

Refer to the exhibit. A developer deployed a Cloud Run service as shown. Authenticated requests from another service in the same project using a service account receive 403 Forbidden. What is the most likely cause?

Network Topology
gcloud builds submittag gcr.io/my-project/my-image .gcloud run deploy my-serviceimage gcr.io/my-project/my-imageregion us-central1no-allow-unauthenticatedRefer to the exhibit.Then:
Question 5easymultiple choice
Full question →

Refer to the exhibit. A developer is configuring Cloud Build to build a Docker image from a Cloud Source Repository. The build fails with a permission error. What is the most likely reason?

Exhibit

Refer to the exhibit.

{
  "bindings": [
    {
      "role": "roles/cloudbuild.builds.builder",
      "members": [
        "serviceAccount:build-sa@my-project.iam.gserviceaccount.com"
      ]
    }
  ]
}
Question 6mediummultiple choice
Full question →

Refer to the exhibit. A Cloud Build config deploys a new image to GKE. After the build succeeds, the pods restart with the new image but the application configuration is unchanged. What is the most likely cause?

Network Topology
filename=deployment.yaml'- 'image=gcr.io/$PROJECT_ID/my-app:$SHORT_SHA'location=us-central1'cluster=my-cluster'Refer to the exhibit.```# Cloud Build configsteps:- name: 'gcr.io/cloud-builders/docker'args: ['build', '-t', 'gcr.io/$PROJECT_ID/my-app:$SHORT_SHA', '.']args: ['push', 'gcr.io/$PROJECT_ID/my-app:$SHORT_SHA']- name: 'gcr.io/cloud-builders/gke-deploy'args:- 'run'
Question 7easymultiple choice
Full question →

Refer to the exhibit. A developer is deploying a container to Cloud Run and receives the error shown. What is the most likely cause?

Exhibit

Refer to the exhibit.
```
ERROR: (gcloud.beta.run.deploy) The user-provided container failed to start and listen on the port defined by the PORT environment variable (8080). Logs for this revision might contain more information.

Logs:
2024-03-15 10:23:45.123456  Container called exit(1).
2024-03-15 10:23:45.123789  Fatal error: Unable to bind to port 8080: Permission denied
```
Question 8hardmultiple choice
Full question →

Based on the Cloud Trace exhibit, which service is the primary contributor to the overall request latency?

Exhibit

Refer to the exhibit.

Cloud Trace details for a single request:
```
Span ID: 0000000000000001
Service: frontend
Duration: 1200ms
   Child Spans:
     - Span ID: 0000000000000002, Service: auth, Duration: 800ms
     - Span ID: 0000000000000003, Service: productcatalog, Duration: 300ms
     - Span ID: 0000000000000004, Service: recommendations, Duration: 50ms
```
Question 9hardmultiple choice
Full question →

Refer to the exhibit. A developer creates this cloudbuild.yaml for a Cloud Build pipeline. When they run the build, they get an error that the image push failed. What is the most likely cause?

Network Topology
args: ['run'image'region'steps:- name: 'gcr.io/cloud-builders/docker'args: ['build', '-t', 'us-central1-docker.pkg.dev/my-project/my-repo/my-image:latest', '.']args: ['push', 'us-central1-docker.pkg.dev/my-project/my-repo/my-image:latest']- name: 'gcr.io/cloud-builders/gcloud'
Question 10hardmultiple choice
Full question →

Refer to the exhibit. You are analyzing application logs and notice that some logs contain a 'trace' field. What does this field enable?

Exhibit

{
  "insertId": "1a2b3c",
  "jsonPayload": {
    "message": "Request completed",
    "latency_ms": 150,
    "status": 200,
    "trace": "projects/my-project/traces/abc123"
  },
  "resource": {
    "type": "gce_instance",
    "labels": {
      "instance_id": "12345",
      "zone": "us-central1-a"
    }
  },
  "severity": "INFO",
  "timestamp": "2024-01-01T12:00:00Z"
}
Question 11mediummultiple choice
Full question →

Refer to the exhibit. The alert fires when what happens?

Exhibit

combiner: OR
conditions:
- conditionThreshold:
    filter: resource.type = "gae_app" AND metric.type = "appengine.googleapis.com/http/server/response_count"
    aggregations:
    - alignmentPeriod: 60s
      perSeriesAligner: ALIGN_RATE
    conditionValue:
      value: 10
    duration: 300s
    trigger:
      count: 1
Question 12hardmultiple choice
Full question →

Refer to the exhibit. A developer deployed a Cloud Run service with the above command. They notice that the service's latency is higher than expected under load. The service performs CPU-intensive tasks. What is the most likely reason for the high latency?

Exhibit

gcloud run deploy my-service \
  --image gcr.io/my-project/my-image:latest \
  --platform managed \
  --region us-central1 \
  --concurrency 80 \
  --cpu 2 \
  --memory 4Gi \
  --execution-environment gen2
Question 13easymultiple choice
Full question →

Refer to the exhibit. The Cloud Build fails with an error that the image name is invalid. What is the most likely cause?

Exhibit

steps:
- name: 'gcr.io/cloud-builders/docker'
  args: ['build', '-t', 'gcr.io/$MY_PROJECT/my-image', '.']
- name: 'gcr.io/cloud-builders/docker'
  args: ['push', 'gcr.io/$MY_PROJECT/my-image']
Question 14easymultiple choice
Full question →

Refer to the exhibit. A developer writes the above Dockerfile for a Cloud Run service. The service fails to start. The logs indicate that the container exited immediately. What is the most likely cause?

Network Topology
RUN npm installonly=production# Dockerfile for Cloud RunFROM node:18-alpineWORKDIR /usr/src/appCOPY package*.json ./COPY . .EXPOSE 8080CMD ["node", "server.js"]
Question 15hardmultiple choice
Full question →

Refer to the exhibit. The function returns 'Error' even though the document exists. What is the most likely reason?

Exhibit

Cloud Function code (index.js):
const {Firestore} = require('@google-cloud/firestore');
const firestore = new Firestore();
exports.updateDocument = async (req, res) => {
  const docId = req.query.id;
  if (!docId) {
    res.status(400).send('Missing id');
    return;
  }
  const docRef = firestore.doc(`collection/${docId}`);
  try {
    await docRef.update({ timestamp: new Date().toISOString() });
    res.status(200).send('Updated');
  } catch (error) {
    console.error(error);
    res.status(500).send('Error');
  }
};

These PCD practice questions are part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style PCD questions with detailed explanations, topic-based practice, mock exams, readiness tracking, and study analytics.