Courseiva
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 →

Refer to the exhibit. A company configured an HPA for their deployment. They notice that the HPA is not scaling based on the 'packets-per-second' metric. What is the most likely reason?

Exhibit

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: myapp-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: myapp-deployment
  minReplicas: 1
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 50
  - type: Pods
    pods:
      metric:
        name: packets-per-second
      target:
        type: AverageValue
        averageValue: 1k
Question 2easymultiple 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 3hardmultiple choice
Full question →

Refer to the exhibit. A developer runs the above command to deploy a Cloud Function triggered by Pub/Sub. The function fails to execute when a message is published. The logs show: "Function execution took 60001 ms, finished with status: 'timeout'". What should the developer do?

Network Topology
gcloud functions deploy my-functionruntime nodejs18trigger-topic my-topicentry-point myFunctionsource .
Question 4mediummultiple 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 5easymultiple choice
Full question →

Refer to the exhibit. A developer notices that instance-3 is in TERMINATED state. What is the most likely reason?

Exhibit

Refer to the exhibit.

```
gcloud compute instances list
NAME       ZONE        MACHINE_TYPE  PREEMPTIBLE  INTERNAL_IP  STATUS
instance-1 us-central1 n1-standard-1             10.128.0.2   RUNNING
instance-2 us-central1 n1-standard-1             10.128.0.3   RUNNING
instance-3 us-central1 n1-standard-1             10.128.0.4   TERMINATED
```
Question 6mediummultiple choice
Full question →

Refer to the exhibit. A Cloud Run service is unable to connect to a Cloud SQL instance. The log entry shows the following. What is the most likely cause?

Exhibit

{
  "resource.type": "cloud_run_revision",
  "severity": "ERROR",
  "textPayload": "Error: [project:us-central1:myinstance] cannot connect: connection refused"
}
Question 7easymultiple 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 8mediummultiple choice
Full question →

Refer to the exhibit. A developer uses the above cloudbuild.yaml for a Cloud Run service. The trigger is set to run on pushes to the main branch. After a push, the build succeeds but the deployment fails with a permission error. What is the most likely issue?

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:${SHORT_SHA}', '.']args: ['push', 'us-central1-docker.pkg.dev/my-project/my-repo/my-image:${SHORT_SHA}']- name: 'gcr.io/cloud-builders/gcloud'
Question 9hardmultiple choice
Full question →

Refer to the exhibit. A developer configured a Pub/Sub push subscription to a Cloud Run service. Messages are not being delivered to the Cloud Run service. The developer verified that the service is running and the IAM permissions are correct. What is the most likely issue?

Exhibit

{
  "name": "projects/my-project/subscriptions/my-sub",
  "topic": "projects/my-project/topics/my-topic",
  "pushConfig": {
    "pushEndpoint": "https://my-service.run.app/",
    "oidcToken": {
      "serviceAccountEmail": "my-sa@my-project.iam.gserviceaccount.com",
      "audience": "https://my-service.run.app/"
    }
  },
  "ackDeadlineSeconds": 10
}
Question 10mediummultiple choice
Full question →

Refer to the exhibit. A Cloud Build pipeline that deploys a Cloud Run service fails with the above error. The Cloud Build service account has the roles/run.admin role at the project level. What is the most likely cause?

Exhibit

ERROR: (gcloud.run.deploy) PERMISSION_DENIED: Permission 'run.services.create' denied on resource 'projects/my-project/locations/us-central1/services/my-service' (or the resource may not exist).
Question 11easymultiple 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 12mediummultiple 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 13hardmultiple 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');
  }
};

Your company runs a production App Engine standard environment service (module 'frontend', version 'v2') that handles e-commerce checkout requests. You have set up an alerting policy on a custom metric 'request_latency' that fires when latency exceeds 500ms for 1 minute. Recently, customers have complained about slow checkout times, but no alert has fired. You examine the exhibit: the log entry shows a latency of 0.452s (452ms) for a request to '/api/checkout'. The custom metric is defined from OpenTelemetry instrumentation. What is the most likely reason the alert did not fire?

Exhibit

Refer to the exhibit.

Cloud Monitoring Metrics Scope:
- Project: prod-project
- Metrics: 
  - latency | resource.type="gae_app" | resource.labels.module_id="frontend" | metric: custom.googleapis.com/opentelemetry/request_latency
- Alert Policy ID: 123456789
- Condition: metric.threshold > 500 ms for 1m
- Notification Channels: email (dev-team@example.com), PagerDuty

Cloud Logging Log Entry (from frontend service):
{
  "textPayload": "Request processed",
  "severity": "INFO",
  "httpRequest": {
    "requestUrl": "https://frontend.example.com/api/checkout",
    "status": 200,
    "responseSize": "2048",
    "latency": "0.452s"
  },
  "resource": {
    "type": "gae_app",
    "labels": {
      "module_id": "frontend",
      "version_id": "v2"
    }
  }
}
Question 15easymultiple choice
Full question →

Refer to the exhibit. You are reviewing a Cloud Monitoring MQL query. What is the purpose of this query?

Exhibit

fetch gce_instance
| metric 'compute.googleapis.com/instance/cpu/utilization'
| filter metric.utilization > 0.9
| align mean(5m)
| every 5m

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.