πŸ”

PCD β€” questions

Page 7 of 18 Β· 359 total questions.

Topic 1 Β· Question 121

You have been tasked with planning the migration of your company's application from on-premises to Google Cloud. Your company's monolithic application is an ecommerce website. The application will be migrated to microservices deployed on Google Cloud in stages. The majority of your company's revenue is generated through online sales, so it is important to minimize risk during the migration. You need to prioritize features and select the first functionality to migrate. What should you do?

  • AMigrate the Product catalog, which has integrations to the frontend and product database. (correct answer)
  • BMigrate Payment processing, which has integrations to the frontend, order database, and third-party payment vendor.
  • CMigrate Order fulfillment, which has integrations to the order database, inventory system, and third-party shipping vendor.
  • DMigrate the Shopping cart, which has integrations to the frontend, cart database, inventory system, and payment processing system.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Migrate the Product catalog, which has integrations to the frontend and product database.

Topic 1 Β· Question 122

Your team develops services that run on Google Kubernetes Engine. Your team's code is stored in Cloud Source Repositories. You need to quickly identify bugs in the code before it is deployed to production. You want to invest in automation to improve developer feedback and make the process as efficient as possible. What should you do?

  • AUse Spinnaker to automate building container images from code based on Git tags.
  • BUse Cloud Build to automate building container images from code based on Git tags. (correct answer)
  • CUse Spinnaker to automate deploying container images to the production environment.
  • DUse Cloud Build to automate building container images from code based on forked versions.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Use Cloud Build to automate building container images from code based on Git tags.

Explanation

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

Topic 1 Β· Question 123

Your team is developing an application in Google Cloud that executes with user identities maintained by Cloud Identity. Each of your application's users will have an associated Pub/Sub topic to which messages are published, and a Pub/Sub subscription where the same user will retrieve published messages. You need to ensure that only authorized users can publish and subscribe to their own specific Pub/Sub topic and subscription. What should you do?

  • ABind the user identity to the pubsub.publisher and pubsub.subscriber roles at the resource level. (correct answer)
  • BGrant the user identity the pubsub.publisher and pubsub.subscriber roles at the project level.
  • CGrant the user identity a custom role that contains the pubsub.topics.create and pubsub.subscriptions.create permissions.
  • DConfigure the application to run as a service account that has the pubsub.publisher and pubsub.subscriber roles.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Bind the user identity to the pubsub.publisher and pubsub.subscriber roles at the resource level.

Topic 1 Β· Question 124

You are evaluating developer tools to help drive Google Kubernetes Engine adoption and integration with your development environment, which includes VS Code and IntelliJ. What should you do?

  • AUse Cloud Code to develop applications. (correct answer)
  • BUse the Cloud Shell integrated Code Editor to edit code and configuration files.
  • CUse a Cloud Notebook instance to ingest and process data and deploy models.
  • DUse Cloud Shell to manage your infrastructure and applications from the command line.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Use Cloud Code to develop applications.

Topic 1 Β· Question 125

You are developing an ecommerce web application that uses App Engine standard environment and Memorystore for Redis. When a user logs into the app, the application caches the user's information (e.g., session, name, address, preferences), which is stored for quick retrieval during checkout. While testing your application in a browser, you get a 502 Bad Gateway error. You have determined that the application is not connecting to Memorystore. What is the reason for this error?

  • AYour Memorystore for Redis instance was deployed without a public IP address.
  • BYou configured your Serverless VPC Access connector in a different region than your App Engine instance. (correct answer)
  • CThe firewall rule allowing a connection between App Engine and Memorystore was removed during an infrastructure update by the DevOps team.
  • DYou configured your application to use a Serverless VPC Access connector on a different subnet in a different availability zone than your App Engine instance.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: You configured your Serverless VPC Access connector in a different region than your App Engine instance.

Explanation

App Engine is a fully managed platform that runs and autoscales web apps with little operational effort. A VPC provides a global, software-defined private network for your Google Cloud resources.

Topic 1 Β· Question 126

Your team develops services that run on Google Cloud. You need to build a data processing service and will use Cloud Functions. The data to be processed by the function is sensitive. You need to ensure that invocations can only happen from authorized services and follow Google-recommended best practices for securing functions. What should you do?

  • AEnable Identity-Aware Proxy in your project. Secure function access using its permissions.
  • BCreate a service account with the Cloud Functions Viewer role. Use that service account to invoke the function.
  • CCreate a service account with the Cloud Functions Invoker role. Use that service account to invoke the function. (correct answer)
  • DCreate an OAuth 2.0 client ID for your calling service in the same project as the function you want to secure. Use those credentials to invoke the function.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Create a service account with the Cloud Functions Invoker role. Use that service account to invoke the function.

Explanation

Cloud Functions runs event-driven code without managing servers and scales automatically. A service account provides an identity for workloads to access Google Cloud APIs securely.

Topic 1 Β· Question 127 Β· Select all that apply

You are deploying your applications on Compute Engine. One of your Compute Engine instances failed to launch. What should you do? (Choose two.)

  • ADetermine whether your file system is corrupted. (correct answer)
  • BAccess Compute Engine as a different SSH user.
  • CTroubleshoot firewall rules or routes on an instance.
  • DCheck whether your instance boot disk is completely full. (correct answer)
  • ECheck whether network traffic to or from your instance is being dropped.
Reveal answer & explanation
Correct answer: A, D

The correct answer is A, D. Option A: Determine whether your file system is corrupted. Option D: Check whether your instance boot disk is completely full.

Topic 1 Β· Question 128

Your web application is deployed to the corporate intranet. You need to migrate the web application to Google Cloud. The web application must be available only to company employees and accessible to employees as they travel. You need to ensure the security and accessibility of the web application while minimizing application changes. What should you do?

  • AConfigure the application to check authentication credentials for each HTTP(S) request to the application.
  • BConfigure Identity-Aware Proxy to allow employees to access the application through its public IP address. (correct answer)
  • CConfigure a Compute Engine instance that requests users to log in to their corporate account. Change the web application DNS to point to the proxy Compute Engine instance. After authenticating, the Compute Engine instance forwards requests to and from the web application.
  • DConfigure a Compute Engine instance that requests users to log in to their corporate account. Change the web application DNS to point to the proxy Compute Engine instance. After authenticating, the Compute Engine issues an HTTP redirect to a public IP address hosting the web application.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Configure Identity-Aware Proxy to allow employees to access the application through its public IP address.

Explanation

Identity-Aware Proxy enforces per-request access control to apps without a VPN.

Topic 1 Β· Question 129

You have an application that uses an HTTP Cloud Function to process user activity from both desktop browser and mobile application clients. This function will serve as the endpoint for all metric submissions using HTTP POST. Due to legacy restrictions, the function must be mapped to a domain that is separate from the domain requested by users on web or mobile sessions. The domain for the Cloud Function is https://fn.example.com. Desktop and mobile clients use the domain https://www.example.com. You need to add a header to the function's HTTP response so that only those browser and mobile sessions can submit metrics to the Cloud Function. Which response header should you add?

  • AAccess-Control-Allow-Origin: *
  • BAccess-Control-Allow-Origin: https://*.example.com
  • CAccess-Control-Allow-Origin: https://fn.example.com
  • DAccess-Control-Allow-origin: https://www.example.com (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Access-Control-Allow-origin: https://www.example.com.

Topic 1 Β· Question 130

You have an HTTP Cloud Function that is called via POST. Each submission's request body has a flat, unnested JSON structure containing numeric and text data. After the Cloud Function completes, the collected data should be immediately available for ongoing and complex analytics by many users in parallel. How should you persist the submissions?

  • ADirectly persist each POST request's JSON data into Datastore.
  • BTransform the POST request's JSON data, and stream it into BigQuery. (correct answer)
  • CTransform the POST request's JSON data, and store it in a regional Cloud SQL cluster.
  • DPersist each POST request's JSON data as an individual file within Cloud Storage, with the file name containing the request identifier.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Transform the POST request's JSON data, and stream it into BigQuery.

Explanation

BigQuery is a serverless, petabyte-scale data warehouse for fast SQL analytics with no infrastructure to manage.

Topic 1 Β· Question 131

Your security team is auditing all deployed applications running in Google Kubernetes Engine. After completing the audit, your team discovers that some of the applications send traffic within the cluster in clear text. You need to ensure that all application traffic is encrypted as quickly as possible while minimizing changes to your applications and maintaining support from Google. What should you do?

  • AUse Network Policies to block traffic between applications.
  • BInstall Istio, enable proxy injection on your application namespace, and then enable mTLS. (correct answer)
  • CDefine Trusted Network ranges within the application, and configure the applications to allow traffic only from those networks.
  • DUse an automated process to request SSL Certificates for your applications from Let's Encrypt and add them to your applications.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Install Istio, enable proxy injection on your application namespace, and then enable mTLS.

Topic 1 Β· Question 132

You migrated some of your applications to Google Cloud. You are using a legacy monitoring platform deployed on-premises for both on-premises and cloud- deployed applications. You discover that your notification system is responding slowly to time-critical problems in the cloud applications. What should you do?

  • AReplace your monitoring platform with Cloud Monitoring.
  • BInstall the Cloud Monitoring agent on your Compute Engine instances.
  • CMigrate some traffic back to your old platform. Perform A/B testing on the two platforms concurrently.
  • DUse Cloud Logging and Cloud Monitoring to capture logs, monitor, and send alerts. Send them to your existing platform. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Use Cloud Logging and Cloud Monitoring to capture logs, monitor, and send alerts. Send them to your existing platform.

Explanation

Cloud Monitoring collects metrics, dashboards, and alerts to observe system health. Cloud Logging centralizes, stores, and analyzes logs across services.

Topic 1 Β· Question 133

You recently deployed your application in Google Kubernetes Engine, and now need to release a new version of your application. You need the ability to instantly roll back to the previous version in case there are issues with the new version. Which deployment model should you use?

  • APerform a rolling deployment, and test your new application after the deployment is complete.
  • BPerform A/B testing, and test your application periodically after the new tests are implemented.
  • CPerform a blue/green deployment, and test your new application after the deployment is. complete. (correct answer)
  • DPerform a canary deployment, and test your new application periodically after the new version is deployed.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Perform a blue/green deployment, and test your new application after the deployment is. complete.

Topic 1 Β· Question 134

You developed a JavaScript web application that needs to access Google Drive's API and obtain permission from users to store files in their Google Drives. You need to select an authorization approach for your application. What should you do?

  • ACreate an API key.
  • BCreate a SAML token.
  • CCreate a service account.
  • DCreate an OAuth Client ID. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Create an OAuth Client ID.

Topic 1 Β· Question 135

You manage an ecommerce application that processes purchases from customers who can subsequently cancel or change those purchases. You discover that order volumes are highly variable and the backend order-processing system can only process one request at a time. You want to ensure seamless performance for customers regardless of usage volume. It is crucial that customers' order update requests are performed in the sequence in which they were generated. What should you do?

  • ASend the purchase and change requests over WebSockets to the backend.
  • BSend the purchase and change requests as REST requests to the backend.
  • CUse a Pub/Sub subscriber in pull mode and use a data store to manage ordering. (correct answer)
  • DUse a Pub/Sub subscriber in push mode and use a data store to manage ordering.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Use a Pub/Sub subscriber in pull mode and use a data store to manage ordering.

Explanation

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

Topic 1 Β· Question 136

Your company needs a database solution that stores customer purchase history and meets the following requirements: β€’ Customers can query their purchase immediately after submission. β€’ Purchases can be sorted on a variety of fields. β€’ Distinct record formats can be stored at the same time. Which storage option satisfies these requirements?

  • AFirestore in Native mode (correct answer)
  • BCloud Storage using an object read
  • CCloud SQL using a SQL SELECT statement
  • DFirestore in Datastore mode using a global query
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Firestore in Native mode

Explanation

Firestore is a serverless, autoscaling NoSQL document database ideal for app and user data.

Topic 1 Β· Question 137

You recently developed a new service on Cloud Run. The new service authenticates using a custom service and then writes transactional information to a Cloud Spanner database. You need to verify that your application can support up to 5,000 read and 1,000 write transactions per second while identifying any bottlenecks that occur. Your test infrastructure must be able to autoscale. What should you do?

  • ABuild a test harness to generate requests and deploy it to Cloud Run. Analyze the VPC Flow Logs using Cloud Logging.
  • BCreate a Google Kubernetes Engine cluster running the Locust or JMeter images to dynamically generate load tests. Analyze the results using Cloud Trace. (correct answer)
  • CCreate a Cloud Task to generate a test load. Use Cloud Scheduler to run 60,000 Cloud Task transactions per minute for 10 minutes. Analyze the results using Cloud Monitoring.
  • DCreate a Compute Engine instance that uses a LAMP stack image from the Marketplace, and use Apache Bench to generate load tests against the service. Analyze the results using Cloud Trace.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Create a Google Kubernetes Engine cluster running the Locust or JMeter images to dynamically generate load tests. Analyze the results using Cloud Trace.

Explanation

Google Kubernetes Engine runs managed Kubernetes for containerized workloads. Cloud Trace analyzes request latency across distributed services.

Topic 1 Β· Question 138

You are using Cloud Build for your CI/CD pipeline to complete several tasks, including copying certain files to Compute Engine virtual machines. Your pipeline requires a flat file that is generated in one builder in the pipeline to be accessible by subsequent builders in the same pipeline. How should you store the file so that all the builders in the pipeline can access it?

  • AStore and retrieve the file contents using Compute Engine instance metadata.
  • BOutput the file contents to a file in /workspace. Read from the same /workspace file in the subsequent build step. (correct answer)
  • CUse gsutil to output the file contents to a Cloud Storage object. Read from the same object in the subsequent build step.
  • DAdd a build argument that runs an HTTP POST via curl to a separate web server to persist the value in one builder. Use an HTTP GET via curl from the subsequent build step to read the value.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Output the file contents to a file in /workspace. Read from the same /workspace file in the subsequent build step.

Topic 1 Β· Question 139

Your company’s development teams want to use various open source operating systems in their Docker builds. When images are created in published containers in your company’s environment, you need to scan them for Common Vulnerabilities and Exposures (CVEs). The scanning process must not impact software development agility. You want to use managed services where possible. What should you do?

  • AEnable the Vulnerability scanning setting in the Container Registry. (correct answer)
  • BCreate a Cloud Function that is triggered on a code check-in and scan the code for CVEs.
  • CDisallow the use of non-commercially supported base images in your development environment.
  • DUse Cloud Monitoring to review the output of Cloud Build to determine whether a vulnerable version has been used.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Enable the Vulnerability scanning setting in the Container Registry.

Topic 1 Β· Question 140 Β· Select all that apply

You are configuring a continuous integration pipeline using Cloud Build to automate the deployment of new container images to Google Kubernetes Engine (GKE). The pipeline builds the application from its source code, runs unit and integration tests in separate steps, and pushes the container to Container Registry. The application runs on a Python web server. The Dockerfile is as follows: FROM python:3.7-alpine - COPY . /app - WORKDIR /app - RUN pip install -r requirements.txt CMD [ "gunicorn", "-w 4", "main:app" ] You notice that Cloud Build runs are taking longer than expected to complete. You want to decrease the build time. What should you do? (Choose two.)

  • ASelect a virtual machine (VM) size with higher CPU for Cloud Build runs. (correct answer)
  • BDeploy a Container Registry on a Compute Engine VM in a VPC, and use it to store the final images.
  • CCache the Docker image for subsequent builds using the -- cache-from argument in your build config file. (correct answer)
  • DChange the base image in the Dockerfile to ubuntu:latest, and install Python 3.7 using a package manager utility.
  • EStore application source code on Cloud Storage, and configure the pipeline to use gsutil to download the source code.
Reveal answer & explanation
Correct answer: A, C

The correct answer is A, C. Option A: Select a virtual machine (VM) size with higher CPU for Cloud Build runs. Option C: Cache the Docker image for subsequent builds using the -- cache-from argument in your build config file.

Explanation

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

Showing questions 121–140 of 359 Β· Page 7 of 18