🔍

PCD — questions

Page 13 of 18 · 359 total questions.

Topic 1 · Question 241

You have deployed a Java application to Cloud Run. Your application requires access to a database hosted on Cloud SQL. Due to regulatory requirements, your connection to the Cloud SQL instance must use its internal IP address. How should you configure the connectivity while following Google-recommended best practices?

  • AConfigure your Cloud Run service with a Cloud SQL connection.
  • BConfigure your Cloud Run service to use a Serverless VPC Access connector. (correct answer)
  • CConfigure your application to use the Cloud SQL Java connector.
  • DConfigure your application to connect to an instance of the Cloud SQL Auth proxy.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Configure your Cloud Run service to use a Serverless VPC Access connector.

Explanation

Cloud Run runs stateless containers serverlessly and scales to zero, minimizing operational overhead. A VPC provides a global, software-defined private network for your Google Cloud resources.

Topic 1 · Question 242

Your application stores customers’ content in a Cloud Storage bucket, with each object being encrypted with the customer's encryption key. The key for each object in Cloud Storage is entered into your application by the customer. You discover that your application is receiving an HTTP 4xx error when reading the object from Cloud Storage. What is a possible cause of this error?

  • AYou attempted the read operation on the object with the customer's base64-encoded key.
  • BYou attempted the read operation without the base64-encoded SHA256 hash of the encryption key. (correct answer)
  • CYou entered the same encryption algorithm specified by the customer when attempting the read operation.
  • DYou attempted the read operation on the object with the base64-encoded SHA256 hash of the customer's key.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: You attempted the read operation without the base64-encoded SHA256 hash of the encryption key.

Topic 1 · Question 243

You have two Google Cloud projects, named Project A and Project B. You need to create a Cloud Function in Project A that saves the output in a Cloud Storage bucket in Project B. You want to follow the principle of least privilege. What should you do?

  • A1. Create a Google service account in Project B.2. Deploy the Cloud Function with the service account in Project A.3. Assign this service account the roles/storage.objectCreator role on the storage bucket residing in Project B.
  • B1. Create a Google service account in Project A2. Deploy the Cloud Function with the service account in Project A.3. Assign this service account the roles/storage.objectCreator role on the storage bucket residing in Project B. (correct answer)
  • C1. Determine the default App Engine service account ([email protected]) in Project A.2. Deploy the Cloud Function with the default App Engine service account in Project A.3. Assign the default App Engine service account the roles/storage.objectCreator role on the storage bucket residing in Project B.
  • D1. Determine the default App Engine service account ([email protected]) in Project B.2. Deploy the Cloud Function with the default App Engine service account in Project A.3. Assign the default App Engine service account the roles/storage.objectCreator role on the storage bucket residing in Project B.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: 1. Create a Google service account in Project A2. Deploy the Cloud Function with the service account in Project A.3. Assign this service account the roles/storage.objectCreator role on the storage bucket residing in P...

Explanation

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

Topic 1 · Question 244

A governmental regulation was recently passed that affects your application. For compliance purposes, you are now required to send a duplicate of specific application logs from your application’s project to a project that is restricted to the security team. What should you do?

  • ACreate user-defined log buckets in the security team’s project. Configure a Cloud Logging sink to route your application’s logs to log buckets in the security team’s project. (correct answer)
  • BCreate a job that copies the logs from the _Required log bucket into the security team’s log bucket in their project.
  • CModify the _Default log bucket sink rules to reroute the logs into the security team’s log bucket.
  • DCreate a job that copies the System Event logs from the _Required log bucket into the security team’s log bucket in their project.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Create user-defined log buckets in the security team’s project. Configure a Cloud Logging sink to route your application’s logs to log buckets in the security team’s project.

Explanation

Cloud Logging centralizes, stores, and analyzes logs across services.

Topic 1 · Question 245

You plan to deploy a new Go application to Cloud Run. The source code is stored in Cloud Source Repositories. You need to configure a fully managed, automated, continuous deployment pipeline that runs when a source code commit is made. You want to use the simplest deployment solution. What should you do?

  • AConfigure a cron job on your workstations to periodically run gcloud run deploy --source in the working directory.
  • BConfigure a Jenkins trigger to run the container build and deploy process for each source code commit to Cloud Source Repositories.
  • CConfigure continuous deployment of new revisions from a source repository for Cloud Run using buildpacks.
  • DUse Cloud Build with a trigger configured to run the container build and deploy process for each source code commit to Cloud Source Repositories. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Use Cloud Build with a trigger configured to run the container build and deploy process for each source code commit to Cloud Source Repositories.

Explanation

Cloud Build runs managed CI pipelines to build, test, and package code.

Topic 1 · Question 246 · Select all that apply

Your team has created an application that is hosted on a Google Kubernetes Engine (GKE) cluster. You need to connect the application to a legacy REST service that is deployed in two GKE clusters in two different regions. You want to connect your application to the target service in a way that is resilient. You also want to be able to run health checks on the legacy service on a separate port. How should you set up the connection? (Choose two.)

  • AUse Traffic Director with a sidecar proxy to connect the application to the service. (correct answer)
  • BUse a proxyless Traffic Director configuration to connect the application to the service.
  • CConfigure the legacy service's firewall to allow health checks originating from the proxy. (correct answer)
  • DConfigure the legacy service's firewall to allow health checks originating from the application.
  • EConfigure the legacy service's firewall to allow health checks originating from the Traffic Director control plane.
Reveal answer & explanation
Correct answer: A, C

The correct answer is A, C. Option A: Use Traffic Director with a sidecar proxy to connect the application to the service. Option C: Configure the legacy service's firewall to allow health checks originating from the proxy. By spanning multiple Availability Zones / adding redundancy, this option provides the high availability and resilience required.

Topic 1 · Question 247

You have an application running in a production Google Kubernetes Engine (GKE) cluster. You use Cloud Deploy to automatically deploy your application to your production GKE cluster. As part of your development process, you are planning to make frequent changes to the application’s source code and need to select the tools to test the changes before pushing them to your remote source code repository. Your toolset must meet the following requirements: • Test frequent local changes automatically. • Local deployment emulates production deployment. Which tools should you use to test building and running a container on your laptop using minimal resources?

  • ADocker Compose and dockerd
  • BTerraform and kubeadm
  • CMinikube and Skaffold (correct answer)
  • Dkaniko and Tekton
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Minikube and Skaffold.

Topic 1 · Question 248

You are deploying a Python application to Cloud Run using Cloud Source Repositories and Cloud Build. The Cloud Build pipeline is shown below: You want to optimize deployment times and avoid unnecessary steps. What should you do?

Exhibit 1 for question 248
  • ARemove the step that pushes the container to Artifact Registry.
  • BDeploy a new Docker registry in a VPC, and use Cloud Build worker pools inside the VPC to run the build pipeline.
  • CStore image artifacts in a Cloud Storage bucket in the same region as the Cloud Run instance.
  • DAdd the --cache-from argument to the Docker build step in your build config file. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Add the --cache-from argument to the Docker build step in your build config file.

Topic 1 · Question 249

You are developing an event-driven application. You have created a topic to receive messages sent to Pub/Sub. You want those messages to be processed in real time. You need the application to be independent from any other system and only incur costs when new messages arrive. How should you configure the architecture?

  • ADeploy the application on Compute Engine. Use a Pub/Sub push subscription to process new messages in the topic.
  • BDeploy your code on Cloud Functions. Use a Pub/Sub trigger to invoke the Cloud Function. Use the Pub/Sub API to create a pull subscription to the Pub/Sub topic and read messages from it.
  • CDeploy the application on Google Kubernetes Engine. Use the Pub/Sub API to create a pull subscription to the Pub/Sub topic and read messages from it.
  • DDeploy your code on Cloud Functions. Use a Pub/Sub trigger to handle new messages in the topic. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Deploy your code on Cloud Functions. Use a Pub/Sub trigger to handle new messages in the topic.

Explanation

Cloud Functions runs event-driven code without managing servers and scales automatically. Pub/Sub is a serverless, global messaging service that decouples services and ingests high-volume event streams. This option meets the real-time / low-latency performance requirement.

Topic 1 · Question 250

You have an application running on Google Kubernetes Engine (GKE). The application is currently using a logging library and is outputting to standard output. You need to export the logs to Cloud Logging, and you need the logs to include metadata about each request. You want to use the simplest method to accomplish this. What should you do?

  • AChange your application’s logging library to the Cloud Logging library, and configure your application to export logs to Cloud Logging.
  • BUpdate your application to output logs in JSON format, and add the necessary metadata to the JSON. (correct answer)
  • CUpdate your application to output logs in CSV format, and add the necessary metadata to the CSV.
  • DInstall the Fluent Bit agent on each of your GKE nodes, and have the agent export all logs from /var/log.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Update your application to output logs in JSON format, and add the necessary metadata to the JSON.

Topic 1 · Question 251

You are working on a new application that is deployed on Cloud Run and uses Cloud Functions. Each time new features are added, new Cloud Functions and Cloud Run services are deployed. You use ENV variables to keep track of the services and enable interservice communication, but the maintenance of the ENV variables has become difficult. You want to implement dynamic discovery in a scalable way. What should you do?

  • AConfigure your microservices to use the Cloud Run Admin and Cloud Functions APIs to query for deployed Cloud Run services and Cloud Functions in the Google Cloud project.
  • BCreate a Service Directory namespace. Use API calls to register the services during deployment, and query during runtime. (correct answer)
  • CRename the Cloud Functions and Cloud Run services endpoint is using a well-documented naming convention.
  • DDeploy Hashicorp Consul on a single Compute Engine instance. Register the services with Consul during deployment, and query during runtime.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Create a Service Directory namespace. Use API calls to register the services during deployment, and query during runtime.

Topic 1 · Question 252

You work for a financial services company that has a container-first approach. Your team develops microservices applications. A Cloud Build pipeline creates the container image, runs regression tests, and publishes the image to Artifact Registry. You need to ensure that only containers that have passed the regression tests are deployed to Google Kubernetes Engine (GKE) clusters. You have already enabled Binary Authorization on the GKE clusters. What should you do next?

  • ACreate an attestor and a policy. After a container image has successfully passed the regression tests, use Cloud Build to run Kritis Signer to create an attestation for the container image. (correct answer)
  • BDeploy Voucher Server and Voucher Client components. After a container image has successfully passed the regression tests, run Voucher Client as a step in the Cloud Build pipeline.
  • CSet the Pod Security Standard level to Restricted for the relevant namespaces. Use Cloud Build to digitally sign the container images that have passed the regression tests.
  • DCreate an attestor and a policy. Create an attestation for the container images that have passed the regression tests as a step in the Cloud Build pipeline.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Create an attestor and a policy. After a container image has successfully passed the regression tests, use Cloud Build to run Kritis Signer to create an attestation for the container image.

Explanation

Cloud Build runs managed CI pipelines to build, test, and package code.

Topic 1 · Question 253

You are reviewing and updating your Cloud Build steps to adhere to best practices. Currently, your build steps include: 1. Pull the source code from a source repository. 2. Build a container image 3. Upload the built image to Artifact Registry. You need to add a step to perform a vulnerability scan of the built container image, and you want the results of the scan to be available to your deployment pipeline running in Google Cloud. You want to minimize changes that could disrupt other teams’ processes. What should you do?

  • AEnable Binary Authorization, and configure it to attest that no vulnerabilities exist in a container image.
  • BUpload the built container images to your Docker Hub instance, and scan them for vulnerabilities.
  • CEnable the Container Scanning API in Artifact Registry, and scan the built container images for vulnerabilities. (correct answer)
  • DAdd Artifact Registry to your Aqua Security instance, and scan the built container images for vulnerabilities.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Enable the Container Scanning API in Artifact Registry, and scan the built container images for vulnerabilities.

Explanation

Artifact Registry stores and manages container images and language packages.

Topic 1 · Question 254

You are developing an online gaming platform as a microservices application on Google Kubernetes Engine (GKE). Users on social media are complaining about long loading times for certain URL requests to the application. You need to investigate performance bottlenecks in the application and identify which HTTP requests have a significantly high latency span in user requests. What should you do?

  • AConfigure GKE workload metrics using kubectl. Select all Pods to send their metrics to Cloud Monitoring. Create a custom dashboard of application metrics in Cloud Monitoring to determine performance bottlenecks of your GKE cluster.
  • BUpdate your microservices to log HTTP request methods and URL paths to STDOUT. Use the logs router to send container logs to Cloud Logging. Create filters in Cloud Logging to evaluate the latency of user requests across different methods and URL paths.
  • CInstrument your microservices by installing the OpenTelemetry tracing package. Update your application code to send traces to Trace for inspection and analysis. Create an analysis report on Trace to analyze user requests. (correct answer)
  • DInstall tcpdump on your GKE nodes. Run tcpdump to capture network traffic over an extended period of time to collect data. Analyze the data files using Wireshark to determine the cause of high latency.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Instrument your microservices by installing the OpenTelemetry tracing package. Update your application code to send traces to Trace for inspection and analysis. Create an analysis report on Trace to analyze user reque...

Topic 1 · Question 255

You need to load-test a set of REST API endpoints that are deployed to Cloud Run. The API responds to HTTP POST requests. Your load tests must meet the following requirements: • Load is initiated from multiple parallel threads. • User traffic to the API originates from multiple source IP addresses. • Load can be scaled up using additional test instances. You want to follow Google-recommended best practices. How should you configure the load testing?

  • ACreate an image that has cURL installed, and configure cURL to run a test plan. Deploy the image in a managed instance group, and run one instance of the image for each VM.
  • BCreate an image that has cURL installed, and configure cURL to run a test plan. Deploy the image in an unmanaged instance group, and run one instance of the image for each VM.
  • CDeploy a distributed load testing framework on a private Google Kubernetes Engine cluster. Deploy additional Pods as needed to initiate more traffic and support the number of concurrent users. (correct answer)
  • DDownload the container image of a distributed load testing framework on Cloud Shell. Sequentially start several instances of the container on Cloud Shell to increase the load on the API.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Deploy a distributed load testing framework on a private Google Kubernetes Engine cluster. Deploy additional Pods as needed to initiate more traffic and support the number of concurrent users.

Explanation

Google Kubernetes Engine runs managed Kubernetes for containerized workloads.

Topic 1 · Question 256

Your team is creating a serverless web application on Cloud Run. The application needs to access images stored in a private Cloud Storage bucket. You want to give the application Identity and Access Management (IAM) permission to access the images in the bucket, while also securing the services using Google-recommended best practices. What should you do?

  • AEnforce signed URLs for the desired bucket. Grant the Storage Object Viewer IAM role on the bucket to the Compute Engine default service account.
  • BEnforce public access prevention for the desired bucket. Grant the Storage Object Viewer IAM role on the bucket to the Compute Engine default service account.
  • CEnforce signed URLs for the desired bucket. Create and update the Cloud Run service to use a user-managed service account. Grant the Storage Object Viewer IAM role on the bucket to the service account.
  • DEnforce public access prevention for the desired bucket. Create and update the Cloud Run service to use a user-managed service account. Grant the Storage Object Viewer IAM role on the bucket to the service account. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Enforce public access prevention for the desired bucket. Create and update the Cloud Run service to use a user-managed service account. Grant the Storage Object Viewer IAM role on the bucket to the service account.

Explanation

Cloud Run runs stateless containers serverlessly and scales to zero, minimizing operational overhead. 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 257

You are using Cloud Run to host a global ecommerce web application. Your company’s design team is creating a new color scheme for the web app. You have been tasked with determining whether the new color scheme will increase sales. You want to conduct testing on live production traffic. How should you design the study?

  • AUse an external HTTP(S) load balancer to route a predetermined percentage of traffic to two different color schemes of your application. Analyze the results to determine whether there is a statistically significant difference in sales. (correct answer)
  • BUse an external HTTP(S) load balancer to route traffic to the original color scheme while the new deployment is created and tested. After testing is complete, reroute all traffic to the new color scheme. Analyze the results to determine whether there is a statistically significant difference in sales.
  • CUse an external HTTP(S) load balancer to mirror traffic to the new version of your application. Analyze the results to determine whether there is a statistically significant difference in sales.
  • DEnable a feature flag that displays the new color scheme to half of all users. Monitor sales to see whether they increase for this group of users.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Use an external HTTP(S) load balancer to route a predetermined percentage of traffic to two different color schemes of your application. Analyze the results to determine whether there is a statistically significant di...

Explanation

The external HTTP(S) Load Balancer distributes global web traffic with a single anycast IP. A load balancer distributes traffic across healthy backends in multiple zones for availability and scale.

Topic 1 · Question 258

You are a developer at a large corporation. You manage three Google Kubernetes Engine clusters on Google Cloud. Your team’s developers need to switch from one cluster to another regularly without losing access to their preferred development tools. You want to configure access to these multiple clusters while following Google-recommended best practices. What should you do?

  • AAsk the developers to use Cloud Shell and run gcloud container clusters get-credential to switch to another cluster.
  • BIn a configuration file, define the clusters, users, and contexts. Share the file with the developers and ask them to use kubect1 contig to add cluster, user, and context details.
  • CAsk the developers to install the gcloud CLI on their workstation and run gcloud container clusters get-credentials to switch to another cluster. (correct answer)
  • DAsk the developers to open three terminals on their workstation and use kubect1 config to configure access to each cluster.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Ask the developers to install the gcloud CLI on their workstation and run gcloud container clusters get-credentials to switch to another cluster.

Topic 1 · Question 259

You are a lead developer working on a new retail system that runs on Cloud Run and Firestore. A web UI requirement is for the user to be able to browse through all products. A few months after go-live, you notice that Cloud Run instances are terminated with HTTP 500: Container instances are exceeding memory limits errors during busy times. This error coincides with spikes in the number of Firestore queries. You need to prevent Cloud Run from crashing and decrease the number of Firestore queries. You want to use a solution that optimizes system performance. What should you do?

  • AModify the query that returns the product list using cursors with limits. (correct answer)
  • BCreate a custom index over the products.
  • CModify the query that returns the product list using integer offsets.
  • DModify the Cloud Run configuration to increase the memory limits.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Modify the query that returns the product list using cursors with limits. This option decouples the components so they scale independently and absorb load spikes.

Topic 1 · Question 260

You are a developer at a large organization. Your team uses Git for source code management (SCM). You want to ensure that your team follows Google-recommended best practices to manage code to drive higher rates of software delivery. Which SCM process should your team use?

  • AEach developer commits their code to the main branch before each product release, conducts testing, and rolls back if integration issues are detected.
  • BEach group of developers copies the repository, commits their changes to their repository, and merges their code into the main repository before each product release.
  • CEach developer creates a branch for their own work, commits their changes to their branch, and merges their code into the main branch daily.
  • DEach group of developers creates a feature branch from the main branch for their work, commits their changes to their branch, and merges their code into the main branch after the change advisory board approves it. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Each group of developers creates a feature branch from the main branch for their work, commits their changes to their branch, and merges their code into the main branch after the change advisory board approves it.

Showing questions 241260 of 359 · Page 13 of 18