[GCP] Google Cloud Certified - Professional Cloud Developer

Google Cloud Certified – Professional Cloud Developer – Practice Exam (Question 7)


Question 1

Your application is deployed in a Google Kubernetes Engine (GKE) cluster.
When a new version of your application is released, your CI/CD tool updates the spec.template.spec.containers[0].image value to reference the Docker image of your new application version. When the Deployment object applies the change, you want to deploy at least 1 replica of the new version and maintain the previous replicas until the new replica is healthy.
Which change should you make to the GKE Deployment object shown below?

apiVersion: apps/v1
kind: Deploment
metadata:
  name: ecommerce-frontend-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: ecommerce-frontend
    spec:
      containers:
        - name: ecommerce-frontend-webapp
          image:ecommerce-frontend-webapp:1.7.9
          ports:
          - containerPort: 80
  • A. Set the Deployment strategy to Recreate with maxSurge set to 0, maxUnavailable set to 1.
  • B. Set the Deployment strategy to Recreate with maxSurge set to 1, maxUnavailable set to 0.
  • C. Set the Deployment strategy to RollingUpdate with maxSurge set to 1, maxUnavailable set to 0.
  • D. Set the Deployment strategy to RollingUpdate with maxSurge set to 0, maxUnavailable set to 1.

Correct Answer: B


Question 2

You need to migrate an internal file upload API with an enforced 500-MB file size limit to Google App Engine.
What should you do?

  • A. Use signed URLs to upload files.
  • B. Change the API to be a multipart file upload API.
  • C. Use FTP to upload files.
  • D. Use CPanel to upload files.

Correct Answer: A

Reference contents:
Google Cloud Platform – Christoph’s Personal Wiki


Question 3

Your application is built as a custom machine image.
You have multiple unique deployments of the machine image. Each deployment is a separate managed instance group with its own template. Each deployment requires a unique set of configuration values. You want to provide these unique values to each deployment but use the same custom machine image in all deployments. You want to use out-of-the-box features of Google Compute Engine.
What should you do?

  • A. Place the unique configuration values in the instance template startup script.
  • B. Place the unique configuration values in the persistent disk.
  • C. Place the unique configuration values in a Google Cloud Bigtable table.
  • D. Place the unique configuration values in the instance template instance metadata.

Correct Answer: B

Reference contents:
Instance groups | Compute Engine Documentation | Google Cloud


Question 4

You are creating a Google Kubernetes Engine (GKE) cluster and run this command:

gcloud container clusters create large-cluster--num-bides 200

The command fails with the error:

insufficient regional quota to satisfy request: resource "CPUS": request requires '200.0' and is short '176..0'. project has quota of '24.0' with '24.0' available.

You want to resolve the issue.
What should you do?

  • A. Request additional GKE quota is the Google Cloud Console.
  • B. Request additional Compute Engine quota in the Google Cloud Console.
  • C. Decouple services in the cluster, and rewrite new clusters to function with fewer cores.
  • D. Open a support case to request additional GKE quotA.

Correct Answer: A


Question 5

You want to view the memory usage of your application deployed on Google Compute Engine.
What should you do?

  • A. Use the Google Cloud Platform Console.
  • B. Install the Stackdriver Monitoring Agent.
  • C. Use the Stackdriver Metrics Explorer.
  • D. Install the Stackdriver Client Library.

Correct Answer: C

Reference contents:
Google Cloud Platform: how to monitor memory usage of VM instances – Stack Overflow


Question 6

You configured your Google Compute Engine instance group to scale automatically according to overall CPU usage.
However, your application’s response latency increases sharply before the cluster has finished adding up instances. You want to provide a more consistent latency experience for your end users by changing the configuration ot the instance group autoscaler.
Which two configuration changes should you make? (Choose two.)

  • A. Add the label “AUTOSCALE” to the instance group template.
  • B. Remove the health-check for individual VMs in the instance group.
  • C. Decrease the target CPU usage for the instance group autoscaler.
  • D. Decrease the cool-down period for instances added to the group.
  • E. Increase the target CPU usage for the instance group autoscaler.

Correct Answer: A, E


Question 7

Your application requires service accounts to be authenticated to GCP products via credentials stored on its host Google Compute Engine virtual machine instances.
You want to distribute these credentials to the host instances as securely as possible.
What should you do?

  • A. Use HTTP signed URLs to securely provide access to the required resources.
  • B. Commit the credential JSON file into your application’s source repository, and have your CI/CD process package it with the software that is deployed to the instance.
  • C. Generate a P12 file from the Google Cloud Console after the instance is deployed, and copy the credentials to the host instance before starting the application.
  • D. Use the instance’s service account Application Default Credentials to authenticate to the required resources.

Correct Answer: D

Reference contents:
Authorizing requests to Compute Engine | Compute Engine Documentation

Comments are closed