🔍

PCD — questions

Page 8 of 18 · 359 total questions.

Topic 1 · Question 141

You are building a CI/CD pipeline that consists of a version control system, Cloud Build, and Container Registry. Each time a new tag is pushed to the repository, a Cloud Build job is triggered, which runs unit tests on the new code builds a new Docker container image, and pushes it into Container Registry. The last step of your pipeline should deploy the new container to your production Google Kubernetes Engine (GKE) cluster. You need to select a tool and deployment strategy that meets the following requirements: • Zero downtime is incurred • Testing is fully automated • Allows for testing before being rolled out to users • Can quickly rollback if needed What should you do?

  • ATrigger a Spinnaker pipeline configured as an A/B test of your new code and, if it is successful, deploy the container to production.
  • BTrigger a Spinnaker pipeline configured as a canary test of your new code and, if it is successful, deploy the container to production.
  • CTrigger another Cloud Build job that uses the Kubernetes CLI tools to deploy your new container to your GKE cluster, where you can perform a canary test.
  • DTrigger another Cloud Build job that uses the Kubernetes CLI tools to deploy your new container to your GKE cluster, where you can perform a shadow test. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Trigger another Cloud Build job that uses the Kubernetes CLI tools to deploy your new container to your GKE cluster, where you can perform a shadow test.

Explanation

Google Kubernetes Engine runs managed Kubernetes for containerized, portable workloads. Cloud Build runs managed CI pipelines to build, test, and package code.

Topic 1 · Question 142

Your operations team has asked you to create a script that lists the Cloud Bigtable, Memorystore, and Cloud SQL databases running within a project. The script should allow users to submit a filter expression to limit the results presented. How should you retrieve the data?

  • AUse the HBase API, Redis API, and MySQL connection to retrieve database lists. Combine the results, and then apply the filter to display the results
  • BUse the HBase API, Redis API, and MySQL connection to retrieve database lists. Filter the results individually, and then combine them to display the results
  • CRun gcloud bigtable instances list, gcloud redis instances list, and gcloud sql databases list. Use a filter within the application, and then display the results
  • DRun gcloud bigtable instances list, gcloud redis instances list, and gcloud sql databases list. Use --filter flag with each command, and then display the results (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Run gcloud bigtable instances list, gcloud redis instances list, and gcloud sql databases list. Use --filter flag with each command, and then display the results

Explanation

Cloud SQL is a managed relational database (MySQL/PostgreSQL/SQL Server) that handles patching, backups, and failover. Cloud Bigtable is a managed, low-latency NoSQL wide-column store for very high-throughput workloads.

Topic 1 · Question 143

You need to deploy a new European version of a website hosted on Google Kubernetes Engine. The current and new websites must be accessed via the same HTTP(S) load balancer's external IP address, but have different domain names. What should you do?

  • ADefine a new Ingress resource with a host rule matching the new domain
  • BModify the existing Ingress resource with a host rule matching the new domain (correct answer)
  • CCreate a new Service of type LoadBalancer specifying the existing IP address as the loadBalancerIP
  • DGenerate a new Ingress resource and specify the existing IP address as the kubernetes.io/ingress.global-static-ip-name annotation value
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Modify the existing Ingress resource with a host rule matching the new domain.

Topic 1 · Question 144

You are developing a single-player mobile game backend that has unpredictable traffic patterns as users interact with the game throughout the day and night. You want to optimize costs by ensuring that you have enough resources to handle requests, but minimize over-provisioning. You also want the system to handle traffic spikes efficiently. Which compute platform should you use?

  • ACloud Run (correct answer)
  • BCompute Engine with managed instance groups
  • CCompute Engine with unmanaged instance groups
  • DGoogle Kubernetes Engine using cluster autoscaling
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Cloud Run

Explanation

Cloud Run runs stateless containers serverlessly and scales to zero, minimizing operational overhead. This option decouples the components so they scale independently and absorb load spikes.

Topic 1 · Question 145

The development teams in your company want to manage resources from their local environments. You have been asked to enable developer access to each team’s Google Cloud projects. You want to maximize efficiency while following Google-recommended best practices. What should you do?

  • AAdd the users to their projects, assign the relevant roles to the users, and then provide the users with each relevant Project ID.
  • BAdd the users to their projects, assign the relevant roles to the users, and then provide the users with each relevant Project Number.
  • CCreate groups, add the users to their groups, assign the relevant roles to the groups, and then provide the users with each relevant Project ID. (correct answer)
  • DCreate groups, add the users to their groups, assign the relevant roles to the groups, and then provide the users with each relevant Project Number.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Create groups, add the users to their groups, assign the relevant roles to the groups, and then provide the users with each relevant Project ID.

Topic 1 · Question 146

Your company’s product team has a new requirement based on customer demand to autoscale your stateless and distributed service running in a Google Kubernetes Engine (GKE) duster. You want to find a solution that minimizes changes because this feature will go live in two weeks. What should you do?

  • ADeploy a Vertical Pod Autoscaler, and scale based on the CPU load.
  • BDeploy a Vertical Pod Autoscaler, and scale based on a custom metric.
  • CDeploy a Horizontal Pod Autoscaler, and scale based on the CPU toad. (correct answer)
  • DDeploy a Horizontal Pod Autoscaler, and scale based on a custom metric.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Deploy a Horizontal Pod Autoscaler, and scale based on the CPU toad.

Topic 1 · Question 147

Your application is composed of a set of loosely coupled services orchestrated by code executed on Compute Engine. You want your application to easily bring up new Compute Engine instances that find and use a specific version of a service. How should this be configured?

  • ADefine your service endpoint information as metadata that is retrieved at runtime and used to connect to the desired service. (correct answer)
  • BDefine your service endpoint information as label data that is retrieved at runtime and used to connect to the desired service.
  • CDefine your service endpoint information to be retrieved from an environment variable at runtime and used to connect to the desired service.
  • DDefine your service to use a fixed hostname and port to connect to the desired service. Replace the service at the endpoint with your new version.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Define your service endpoint information as metadata that is retrieved at runtime and used to connect to the desired service. This option decouples the components so they scale independently and absorb load spikes.

Topic 1 · Question 148 · Select all that apply

You are developing a microservice-based application that will run on Google Kubernetes Engine (GKE). Some of the services need to access different Google Cloud APIs. How should you set up authentication of these services in the cluster following Google-recommended best practices? (Choose two.)

  • AUse the service account attached to the GKE node.
  • BEnable Workload Identity in the cluster via the gcloud command-line tool. (correct answer)
  • CAccess the Google service account keys from a secret management service.
  • DStore the Google service account keys in a central secret management service.
  • EUse gcloud to bind the Kubernetes service account and the Google service account using roles/iam.workloadIdentity. (correct answer)
Reveal answer & explanation
Correct answer: B, E

The correct answer is B, E. Option B: Enable Workload Identity in the cluster via the gcloud command-line tool. Option E: Use gcloud to bind the Kubernetes service account and the Google service account using roles/iam.workloadIdentity.

Explanation

Workload Identity Federation lets workloads access Google Cloud without long-lived service account keys. A service account provides an identity for workloads to access Google Cloud APIs securely. Cloud IAM grants fine-grained, least-privilege access to Google Cloud resources.

Topic 1 · Question 149

Your development team has been tasked with maintaining a .NET legacy application. The application incurs occasional changes and was recently updated. Your goal is to ensure that the application provides consistent results while moving through the CI/CD pipeline from environment to environment. You want to minimize the cost of deployment while making sure that external factors and dependencies between hosting environments are not problematic. Containers are not yet approved in your organization. What should you do?

  • ARewrite the application using .NET Core, and deploy to Cloud Run. Use revisions to separate the environments.
  • BUse Cloud Build to deploy the application as a new Compute Engine image for each build. Use this image in each environment. (correct answer)
  • CDeploy the application using MS Web Deploy, and make sure to always use the latest, patched MS Windows Server base image in Compute Engine.
  • DUse Cloud Build to package the application, and deploy to a Google Kubernetes Engine cluster. Use namespaces to separate the environments.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Use Cloud Build to deploy the application as a new Compute Engine image for each build. Use this image in each environment.

Explanation

Compute Engine provides configurable virtual machines when you need full control of the OS. Cloud Build runs managed CI pipelines to build, test, and package code.

Topic 1 · Question 150

The new version of your containerized application has been tested and is ready to deploy to production on Google Kubernetes Engine. You were not able to fully load-test the new version in pre-production environments, and you need to make sure that it does not have performance problems once deployed. Your deployment must be automated. What should you do?

  • AUse Cloud Load Balancing to slowly ramp up traffic between versions. Use Cloud Monitoring to look for performance issues.
  • BDeploy the application via a continuous delivery pipeline using canary deployments. Use Cloud Monitoring to look for performance issues. and ramp up traffic as the metrics support it. (correct answer)
  • CDeploy the application via a continuous delivery pipeline using blue/green deployments. Use Cloud Monitoring to look for performance issues, and launch fully when the metrics support it.
  • DDeploy the application using kubectl and set the spec.updateStrategv.type to RollingUpdate. Use Cloud Monitoring to look for performance issues, and run the kubectl rollback command if there are any issues.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Deploy the application via a continuous delivery pipeline using canary deployments. Use Cloud Monitoring to look for performance issues. and ramp up traffic as the metrics support it.

Explanation

Cloud Monitoring collects metrics, dashboards, and alerts to observe system health.

Topic 1 · Question 151

Users are complaining that your Cloud Run-hosted website responds too slowly during traffic spikes. You want to provide a better user experience during traffic peaks. What should you do?

  • ARead application configuration and static data from the database on application startup.
  • BPackage application configuration and static data into the application image during build time. (correct answer)
  • CPerform as much work as possible in the background after the response has been returned to the user.
  • DEnsure that timeout exceptions and errors cause the Cloud Run instance to exit quickly so a replacement instance can be started.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Package application configuration and static data into the application image during build time. This option decouples the components so they scale independently and absorb load spikes.

Topic 1 · Question 152

You are a developer working on an internal application for payroll processing. You are building a component of the application that allows an employee to submit a timesheet, which then initiates several steps: • An email is sent to the employee and manager, notifying them that the timesheet was submitted. • A timesheet is sent to payroll processing for the vendor's API. • A timesheet is sent to the data warehouse for headcount planning. These steps are not dependent on each other and can be completed in any order. New steps are being considered and will be implemented by different development teams. Each development team will implement the error handling specific to their step. What should you do?

  • ADeploy a Cloud Function for each step that calls the corresponding downstream system to complete the required action.
  • BCreate a Pub/Sub topic for each step. Create a subscription for each downstream development team to subscribe to their step's topic.
  • CCreate a Pub/Sub topic for timesheet submissions. Create a subscription for each downstream development team to subscribe to the topic. (correct answer)
  • DCreate a timesheet microservice deployed to Google Kubernetes Engine. The microservice calls each downstream step and waits for a successful response before calling the next step.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Create a Pub/Sub topic for timesheet submissions. Create a subscription for each downstream development team to subscribe to the topic.

Explanation

Pub/Sub is a serverless, global messaging service that decouples services and ingests high-volume event streams.

Topic 1 · Question 153

You are designing an application that uses a microservices architecture. You are planning to deploy the application in the cloud and on-premises. You want to make sure the application can scale up on demand and also use managed services as much as possible. What should you do?

  • ADeploy open source Istio in a multi-cluster deployment on multiple Google Kubernetes Engine (GKE) clusters managed by Anthos.
  • BCreate a GKE cluster in each environment with Anthos, and use Cloud Run for Anthos to deploy your application to each cluster. (correct answer)
  • CInstall a GKE cluster in each environment with Anthos, and use Cloud Build to create a Deployment for your application in each cluster.
  • DCreate a GKE cluster in the cloud and install open-source Kubernetes on-premises. Use an external load balancer service to distribute traffic across the two environments.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Create a GKE cluster in each environment with Anthos, and use Cloud Run for Anthos to deploy your application to each cluster.

Explanation

Cloud Run runs stateless containers serverlessly and scales to zero, minimizing operational overhead. Google Kubernetes Engine runs managed Kubernetes for containerized, portable workloads. Anthos runs and manages Kubernetes workloads consistently across on-premises and clouds.

Topic 1 · Question 154

You want to migrate an on-premises container running in Knative to Google Cloud. You need to make sure that the migration doesn't affect your application's deployment strategy, and you want to use a fully managed service. Which Google Cloud service should you use to deploy your container?

  • ACloud Run (correct answer)
  • BCompute Engine
  • CGoogle Kubernetes Engine
  • DApp Engine flexible environment
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Cloud Run

Explanation

Cloud Run runs stateless containers serverlessly and scales to zero, minimizing operational overhead.

Topic 1 · Question 155

This architectural diagram depicts a system that streams data from thousands of devices. You want to ingest data into a pipeline, store the data, and analyze the data using SQL statements. Which Google Cloud services should you use for steps 1, 2, 3, and 4?

Exhibit 1 for question 155
  • A1. App Engine2. Pub/Sub3. BigQuery4. Firestore
  • B1. Dataflow2. Pub/Sub3. Firestore4. BigQuery
  • C1. Pub/Sub2. Dataflow3. BigQuery4. Firestore
  • D1. Pub/Sub2. Dataflow3. Firestore4. BigQuery (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: 1. Pub/Sub2. Dataflow3. Firestore4. BigQuery

Explanation

Firestore is a serverless, autoscaling NoSQL document database ideal for app and user data. BigQuery is a serverless, petabyte-scale data warehouse for fast SQL analytics with no infrastructure to manage. Dataflow runs serverless Apache Beam pipelines for stream and batch data processing with autoscaling.

Topic 1 · Question 156

Your company just experienced a Google Kubernetes Engine (GKE) API outage due to a zone failure. You want to deploy a highly available GKE architecture that minimizes service interruption to users in the event of a future zone failure. What should you do?

  • ADeploy Zonal clusters
  • BDeploy Regional clusters (correct answer)
  • CDeploy Multi-Zone clusters
  • DDeploy GKE on-premises clusters
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Deploy Regional clusters By spanning multiple Availability Zones / adding redundancy, this option provides the high availability and resilience required.

Topic 1 · Question 157

Your team develops services that run on Google Cloud. You want to process messages sent to a Pub/Sub topic, and then store them. Each message must be processed exactly once to avoid duplication of data and any data conflicts. You need to use the cheapest and most simple solution. What should you do?

  • AProcess the messages with a Dataproc job, and write the output to storage.
  • BProcess the messages with a Dataflow streaming pipeline using Apache Beam's PubSubIO package, and write the output to storage. (correct answer)
  • CProcess the messages with a Cloud Function, and write the results to a BigQuery location where you can run a job to deduplicate the data.
  • DRetrieve the messages with a Dataflow streaming pipeline, store them in Cloud Bigtable, and use another Dataflow streaming pipeline to deduplicate messages.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Process the messages with a Dataflow streaming pipeline using Apache Beam's PubSubIO package, and write the output to storage.

Explanation

Dataflow runs serverless Apache Beam pipelines for stream and batch data processing with autoscaling.

Topic 1 · Question 158

You are running a containerized application on Google Kubernetes Engine. Your container images are stored in Container Registry. Your team uses CI/CD practices. You need to prevent the deployment of containers with known critical vulnerabilities. What should you do?

  • A• Use Web Security Scanner to automatically crawl your application• Review your application logs for scan results, and provide an attestation that the container is free of known critical vulnerabilities• Use Binary Authorization to implement a policy that forces the attestation to be provided before the container is deployed
  • B• Use Web Security Scanner to automatically crawl your application• Review the scan results in the scan details page in the Cloud Console, and provide an attestation that the container is free of known critical vulnerabilities• Use Binary Authorization to implement a policy that forces the attestation to be provided before the container is deployed
  • C• Enable the Container Scanning API to perform vulnerability scanning• Review vulnerability reporting in Container Registry in the Cloud Console, and provide an attestation that the container is free of known critical vulnerabilities• Use Binary Authorization to implement a policy that forces the attestation to be provided before the container is deployed
  • D• Enable the Container Scanning API to perform vulnerability scanning• Programmatically review vulnerability reporting through the Container Scanning API, and provide an attestation that the container is free of known critical vulnerabilities• Use Binary Authorization to implement a policy that forces the attestation to be provided before the container is deployed (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: • Enable the Container Scanning API to perform vulnerability scanning• Programmatically review vulnerability reporting through the Container Scanning API, and provide an attestation that the container is free of known...

Topic 1 · Question 159

You have an on-premises application that authenticates to the Cloud Storage API using a user-managed service account with a user-managed key. The application connects to Cloud Storage using Private Google Access over a Dedicated Interconnect link. You discover that requests from the application to access objects in the Cloud Storage bucket are failing with a 403 Permission Denied error code. What is the likely cause of this issue?

  • AThe folder structure inside the bucket and object paths have changed.
  • BThe permissions of the service account’s predefined role have changed.
  • CThe service account key has been rotated but not updated on the application server. (correct answer)
  • DThe Interconnect link from the on-premises data center to Google Cloud is experiencing a temporary outage.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: The service account key has been rotated but not updated on the application server.

Explanation

A service account provides an identity for workloads to access Google Cloud APIs securely.

Topic 1 · Question 160

You are using the Cloud Client Library to upload an image in your application to Cloud Storage. Users of the application report that occasionally the upload does not complete and the client library reports an HTTP 504 Gateway Timeout error. You want to make the application more resilient to errors. What changes to the application should you make?

  • AWrite an exponential backoff process around the client library call. (correct answer)
  • BWrite a one-second wait time backoff process around the client library call.
  • CDesign a retry button in the application and ask users to click if the error occurs.
  • DCreate a queue for the object and inform the users that the application will try again in 10 minutes.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Write an exponential backoff process around the client library call. By spanning multiple Availability Zones / adding redundancy, this option provides the high availability and resilience required.

Showing questions 141160 of 359 · Page 8 of 18