πŸ”

PCD β€” questions

Page 15 of 18 Β· 359 total questions.

Topic 1 Β· Question 282

You are developing an application that uses microservices architecture that includes Cloud Run, Bigtable, and Pub/Sub. You want to conduct the testing and debugging process as quickly as possible to create a minimally viable product with minimal cost. What should you do?

  • AUse Cloud Shell Editor and Cloud Shell to deploy the application, and test the functionality by using the Google Cloud console in the project.
  • BUse emulators to test the functionality of cloud resources locally, and deploy the code to your Google Cloud project. (correct answer)
  • CUse Cloud Build to create a pipeline, and add the unit testing stage and the manual approval stage. Deploy the code to your Google Cloud project.
  • DUse Cloud Code to develop, deploy, and test microservices resources. Use Cloud Logging to review the resource logs.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Use emulators to test the functionality of cloud resources locally, and deploy the code to your Google Cloud project.

Topic 1 Β· Question 283

You are a lead developer at an organization that recently integrated several Google Cloud services. These services are located within Virtual Private Cloud (VPC) environments that are secured with VPC Service Controls and Private Service Connect endpoints. Developers across your organization use different operating systems, development frameworks, and integrated development environments (IDEs). You need to recommend a developer environment that will ensure consistency in the developer process and improve the overall developer experience. You want this solution to: β€’ Enforce consistent security controls. β€’ Have access to Google Cloud resources and applications within the VPC. β€’ Allow the installation of custom tools and utilities on the development environments. What solution should you recommend?

  • AUse Cloud Workstations, and allow developers to create their own custom images.
  • BUse Cloud Workstations with preconfigured base images. For custom tools and utilities, use custom images that are rebuilt weekly. (correct answer)
  • CUse the Cloud Code extension with the IDEs that are used across the organization. Configure Cloud VPN to enable VPC access.
  • DUse the Cloud Code extension with the IDEs that are used across the organization. Use Identity-Aware Proxy to enable access to the services in the VPC.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Use Cloud Workstations with preconfigured base images. For custom tools and utilities, use custom images that are rebuilt weekly.

Explanation

Cloud Workstations provide managed, secure, fully configured development environments.

Topic 1 Β· Question 284

You are preparing to conduct a load test on your Cloud Run service by using JMeter. You need to orchestrate the steps and services to use for an effective load test and analysis. You want to follow Google-recommended practices. What should you do?

  • AInstall JMeter on your local machine, create a log sink to BigQuery, and use Looker to analyze the results.
  • BSet up a Compute Engine instance, install JMeter on the instance, create a log sink to a Cloud Storage bucket, and use Looker Studio to analyze the results.
  • CSet up a Compute Engine instance, install JMeter on the instance, create a log sink to a Cloud Storage bucket, and use Looker to analyze the results.
  • DSet up a Compute Engine instance, install JMeter on the instance, create a log sink to BigQuery, and use Looker Studio to analyze the results. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Set up a Compute Engine instance, install JMeter on the instance, create a log sink to BigQuery, and use Looker Studio to analyze the results.

Explanation

Compute Engine provides configurable virtual machines when you need full control of the OS. BigQuery is a serverless, petabyte-scale data warehouse for fast SQL analytics with no infrastructure to manage. Looker provides governed business intelligence, dashboards, and data modeling.

Topic 1 Β· Question 285

You are designing a Node.js-based mobile news feed application that stores data on Google Cloud. You need to select the application's database. You want the database to have zonal resiliency out of the box, low latency responses, ACID compliance, an optional middle tier, semi-structured data storage, and network-partition-tolerant and offline-mode client libraries. What should you do?

  • AConfigure Firestore and use the Firestore client library in the app. (correct answer)
  • BConfigure Bigtable and use the Bigtable client in the app.
  • CConfigure Cloud SQL and use the Google Client Library for Cloud SQL in the app.
  • DConfigure BigQuery and use the BigQuery REST API in the app.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Configure Firestore and use the Firestore client library in the app.

Explanation

Firestore is a serverless, autoscaling NoSQL document database ideal for app and user data. By spanning multiple Availability Zones / adding redundancy, this option provides the high availability and resilience required.

Topic 1 Β· Question 286

You are developing an application component to capture user behavior data and stream the data to BigQuery. You plan to use the BigQuery Storage Write API. You need to ensure that the data that arrives in BigQuery does not have any duplicates. You want to use the simplest operational method to achieve this. What should you do?

  • ACreate a write stream in the default type.
  • BCreate a write stream in the committed type. (correct answer)
  • CConfigure a Kafka cluster. Use a primary universally unique identifier (UUID) for duplicate messages.
  • DConfigure a Pub/Sub topic. Use Cloud Functions to subscribe to the topic and remove any duplicates.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Create a write stream in the committed type.

Topic 1 Β· Question 287

You maintain a popular mobile game deployed on Google Cloud services that include Firebase, Firestore, and Cloud Functions. Recently, the game experienced a surge in usage, and the application encountered HTTP 429 RESOURCE_EXHAUSTED errors when accessing the Firestore API. The application has now stabilized. You want to quickly fix this issue because your company has a marketing campaign next week and you expect another surge in usage. What should you do?

  • ARequest a quota increase, and modify the application code to retry the Firestore API call with fixed backoff.
  • BRequest a quota increase, and modify the application code to retry the Firestore API call with exponential backoff. (correct answer)
  • COptimize database queries to reduce read/write operations, and modify the application code to retry the Firestore API call with fixed backoff.
  • DOptimize database queries to reduce read/write operations, and modify the application code to retry the Firestore API call with exponential backoff.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Request a quota increase, and modify the application code to retry the Firestore API call with exponential backoff.

Explanation

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

Topic 1 Β· Question 288

You are developing a mobile application that allows users to create and manage to-do lists. Your application has the following requirements: β€’ Store and synchronize data between different mobile devices. β€’ Support offline access. β€’ Provide real-time updates on each user's device. You need to implement a database solution while minimizing operational effort. Which approach should you use?

  • ACreate a Cloud SQL for MySQL instance. Implement a data model to store to-do list information. Create indexes for the most heavily and frequently used queries.
  • BCreate a Bigtable instance. Design a database schema to avoid hotspots when writing data. Use a Bigtable change stream to capture data changes.
  • CUse Firestore as the database. Configure Firestore offline persistence to cache a copy of the Firestore data. Listen to document changes to update applications whenever there are document changes. (correct answer)
  • DImplement a SQLite database on each user's device. Use a scheduled job to synchronize each device database with a copy stored in Cloud Storage.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Use Firestore as the database. Configure Firestore offline persistence to cache a copy of the Firestore data. Listen to document changes to update applications whenever there are document changes.

Explanation

Firestore is a serverless, autoscaling NoSQL document database ideal for app and user data. This option meets the real-time / low-latency performance requirement.

Topic 1 Β· Question 289

You manage an application deployed on GKE clusters across multiple environments. You are using Cloud Build to run user acceptance testing (UAT) tests. You have integrated Cloud Build with Artifact Analysis, and enabled the Binary Authorization API in all Google Cloud projects hosting your environments. You want only container images that have passed certain automated UAT tests to be deployed to the production environment. You have already created an attestor. What should you do next?

  • AAfter the UAT phase, sign the attestation with a key stored as a Kubernetes secret. Add a GKE cluster-specific rule in Binary Authorization for the UAT Google Cloud project.
  • BAfter the UAT phase, sign the attestation with a key stored as a Kubernetes secret. Add a GKE cluster-specific rule in Binary Authorization for the production Google Cloud project policy.
  • CAfter the UAT phase, sign the attestation with a key stored in Cloud Key Management Service (KMS). Add a default rule in Binary Authorization for the UAT Google Cloud project.
  • DAfter the UAT phase, sign the attestation with a key stored in Cloud Key Management Service (KMS). Add a GKE cluster-specific rule in Binary Authorization for the production Google Cloud project policy. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: After the UAT phase, sign the attestation with a key stored in Cloud Key Management Service (KMS). Add a GKE cluster-specific rule in Binary Authorization for the production Google Cloud project policy.

Explanation

Google Kubernetes Engine runs managed Kubernetes for containerized, portable workloads.

Topic 1 Β· Question 290

You work for a company that operates an ecommerce website. You are developing a new integration that will manage all order fulfillment steps after orders are placed. You have created multiple Cloud Functions to process each order. You need to orchestrate the execution of the functions, using the output of each function to determine the flow. You want to minimize the latency of this process. What should you do?

  • AUse Workflows to call the functions, and use callbacks to handle the execution logic.
  • BUse Workflows to call the functions, and use conditional jumps to handle the execution logic. (correct answer)
  • CUse Cloud Composer to call the functions, and use an Apache Airflow HTTP operator to handle the execution logic.
  • DUse Cloud Composer to call the functions, and use an Apache Airflow operator to handle the execution logic.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Use Workflows to call the functions, and use conditional jumps to handle the execution logic.

Topic 1 Β· Question 291

You are currently pushing container images to Artifact Registry and deploying a containerized microservices application to GKE. After deploying the application, you notice that the services do not behave as expected. You use the kubectl get pods command to inspect the state of the application Pods, and discover that one of the Pods has a state of CrashLoopBackoff. How should you troubleshoot the Pod?

  • AConnect to the problematic Pod by running the kubectl exec -it POD_NAME - /bin/bash command where the POD_NAME parameter is the name of the problematic Pod. Inspect the logs in the /var/log/messages folder to determine the root cause.
  • BExecute the gcloud projects get-iam-policy PROJECT_ID command where the PROJECT_ID parameter is the name of the project where your Artifact Registry resides. Inspect the IAM bindings of the node pool s service account. Validate if the service account has the roles/artifactregistry.reader role.
  • CRun the kubectl logs POD_NAME command where the POD_NAME parameter is the name of the problematic Pod. Analyze the logs of the Pod from previous runs to determine the root cause of failed start attempts of the Pod. (correct answer)
  • DIn the Google Cloud console, navigate to Cloud Logging in the project of the cluster’s VPC. Enter a filter to show denied egress traffic to the Private Google Access CIDR range. Validate if egress traffic is denied from your GKE cluster to the Private Google Access CIDR range.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Run the kubectl logs POD_NAME command where the POD_NAME parameter is the name of the problematic Pod. Analyze the logs of the Pod from previous runs to determine the root cause of failed start attempts of the Pod.

Topic 1 Β· Question 292

You use Cloud Build to build and test container images prior to deploying them to Cloud Run. Your images are stored in Artifact Registry. You need to ensure that only container images that have passed testing are deployed. You want to minimize operational overhead. What should you do?

  • ADeploy a new revision to a Cloud Run service. Assign a tag that allows access to the revision at a specific URL without serving traffic. Test that revision again. Migrate the traffic to the Cloud Run service after you confirm that the new revision is performing as expected.
  • BEnable Binary Authorization on your Cloud Run service. Create an attestation if the container image has passed all tests. Configure Binary Authorization to allow only images with appropriate attestation to be deployed to the Cloud Run service. (correct answer)
  • CCreate a GKE cluster. Verify that all tests have passed, and then deploy the image to the GKE cluster.
  • DConfigure build provenance on your Cloud Build pipeline. Verify that all the tests have passed, and then deploy the image to a Cloud Run service.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Enable Binary Authorization on your Cloud Run service. Create an attestation if the container image has passed all tests. Configure Binary Authorization to allow only images with appropriate attestation to be deployed...

Explanation

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

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

You are developing a scalable web application for internal users. Your organization uses Google Workspace. You need to set up authentication to the application for the users, and then deploy the application on Google Cloud. You plan to use cloud-native features, and you want to minimize infrastructure management effort. What should you do? (Choose two.)

  • ACreate a Compute Engine VM, configure a web server, and deploy the application in a VPC.
  • BContainerize the application, and deploy it as a Cloud Run service. (correct answer)
  • CConfigure Cloud SQL database with a table containing the users and password hashes. Add an authentication screen to ensure that only internal users can access the application.
  • DConfigure Identity Aware Proxy, and grant the roles/iap.httpsResourceAccessor IAM role to the users that need to access the application. (correct answer)
  • EConfigure Identity Aware Proxy, and grant the roles/iap.tunnelResourceAccessor IAM role to the users that need to access the application.
Reveal answer & explanation
Correct answer: B, D

The correct answer is B, D. Option B: Containerize the application, and deploy it as a Cloud Run service. Option D: Configure Identity Aware Proxy, and grant the roles/iap.httpsResourceAccessor IAM role to the users that need to access the application.

Explanation

Cloud Run runs stateless containers serverlessly and scales to zero, minimizing operational overhead. Cloud IAM grants fine-grained, least-privilege access to Google Cloud resources. Identity-Aware Proxy enforces per-request access control to apps without a VPN.

Topic 1 Β· Question 294

You work for an ecommerce company, and you are responsible for deploying and managing multiple APIs. The operations team wants to review the traffic patterns in the orders-prod and users-prod environments. These are the only environments in the store-prod environment group. You want to follow Google-recommended practices. What should you do?

  • AAssign the Apigee Analytics Viewer IAM role to the operations team for both environments. Use Cloud Monitoring to review traffic patterns.
  • BAssign the Apigee Analytics Viewer IAM role to the operations team for both environments. Use Apigee API Analytics to review traffic patterns. (correct answer)
  • CAssign the Apigee API Reader IAM role to each user of the operations team for both environments. Use Cloud Monitoring to review traffic patterns.
  • DAssign the Apigee API Reader IAM role to each user of the operations team for both environments. Use Apigee API Analytics to review traffic patterns.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Assign the Apigee Analytics Viewer IAM role to the operations team for both environments. Use Apigee API Analytics to review traffic patterns.

Explanation

Cloud IAM grants fine-grained, least-privilege access to Google Cloud resources.

Topic 1 Β· Question 295

You are migrating a containerized application to Cloud Run. You plan to use Cloud Build to build your container image and push it to Artifact Registry, and you plan to use Cloud Deploy to deploy the image to production. You need to ensure that only secure images are deployed to production. What should you do?

  • AUse Cloud Armor in front of Cloud Run to protect the container image from threats.
  • BUse Artifact Analysis to scan the image for vulnerabilities. Use Cloud Key Management Service to encrypt the image to be deployed to production.
  • CUse Secret Manager to store the encrypted image. Deploy this image to production.
  • DUse Binary Authorization to enforce a policy that only allows images that have been signed with a trusted key to be deployed to production. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Use Binary Authorization to enforce a policy that only allows images that have been signed with a trusted key to be deployed to production.

Topic 1 Β· Question 296

Your team uses Cloud Storage for a video and image application that was recently migrated to Google Cloud. Following a viral surge, users are reporting application instability, coinciding with a 10x increase in HTTP 429 error codes from Cloud Storage APIs. You need to resolve the errors and establish a long-term solution. You want to ensure that the application remains stable if the load increases again in the future. What should you do?

  • AOptimize the application code to reduce unnecessary calls to Cloud Storage APIs to prevent HTTP 429 errors.
  • BCompress the video and images files to reduce their size, and minimize storage costs and bandwidth usage. Implement a custom throttling mechanism in the application that limits the number of concurrent API calls.
  • CMigrate all image and video data to Firestore. Replace the Cloud Storage APIs in the application code with the new Firestore database.
  • DImplement a retry strategy with exponential backoff for requests that encounter HTTP 429 errors. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Implement a retry strategy with exponential backoff for requests that encounter HTTP 429 errors.

Topic 1 Β· Question 297

You are developing a container build pipeline for an application hosted on GKE. You have the following requirements: β€’ Only images that are created using your build pipeline should be deployed on your GKE cluster. β€’ All code and build artifacts should remain within your environment and protected from data exfiltration. How should you build the pipeline?

  • A1. Create a build pipeline by using Cloud Build with the default worker pool.2. Deploy container images to a private container registry in your VPC.3. Create a VPC firewall policy in your project that denies all egress and ingress traffic to public networks.
  • B1. Create a build pipeline by using Cloud Build with a private worker pool.2. Use VPC Service Controls to place all components and services in your CI/CD pipeline inside a security perimeter.3. Configure your GKE cluster to only allow container images signed by Binary Authorization. (correct answer)
  • C1. Create a build pipeline by using Cloud Build with a private worker pool.2. Configure the CI/CD pipeline to build container images and store them in Artifact Registry.3. Configure Artifact Registry to encrypt container images by using customer-managed encryption keys (CMEK).
  • D1. Create a build pipeline by using Cloud Build with the default worker pool.2. Configure the CI/CD pipeline to build container images and store them in Artifact Registry.3. Configure your GKE cluster to only allow container images signed by Binary Authorization.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: 1. Create a build pipeline by using Cloud Build with a private worker pool.2. Use VPC Service Controls to place all components and services in your CI/CD pipeline inside a security perimeter.3. Configure your GKE clus...

Explanation

Google Kubernetes Engine runs managed Kubernetes for containerized, portable workloads. VPC Service Controls create a security perimeter around managed services to prevent data exfiltration. A VPC provides a global, software-defined private network for your Google Cloud resources.

Topic 1 Β· Question 298

You are a developer at a company that operates an ecommerce website. The website stores the customer order data in a Cloud SQL for PostgreSQL database. Data scientists on the marketing team access this data to run their reports. Every time they run these reports, the website's performance is negatively affected. You want to provide access to up-to-date customer order datasets without affecting your website. What should you do?

  • AConfigure Cloud Scheduler to run an hourly Cloud Function that exports the data from the Cloud SQL database into CSV format and sends the data to a Cloud Storage bucket.
  • BSet up a Bigtable table for the data science team. Configure the application to perform dual writes to both Cloud SQL and Bigtable simultaneously.
  • CSet up a BigQuery dataset for the data science team. Configure Datastream to replicate the relevant Cloud SQL tables in BigQuery. (correct answer)
  • DCreate a clone of the PostgreSQL database instance for the data science team. Schedule a job to create a new clone every 15 minutes.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Set up a BigQuery dataset for the data science team. Configure Datastream to replicate the relevant Cloud SQL tables in BigQuery.

Explanation

Cloud SQL is a managed relational database (MySQL/PostgreSQL/SQL Server) that handles patching, backups, and failover. BigQuery is a serverless, petabyte-scale data warehouse for fast SQL analytics with no infrastructure to manage. Datastream provides serverless change-data-capture and replication into Google Cloud.

Topic 1 Β· Question 299

You are developing a web application by using Cloud Run and Cloud Storage. You are notified of a production issue that you need to troubleshoot immediately. You need to implement a workaround that requires you to execute a script on a Git repository. Your corporate laptop is unavailable but you have your personal computer. You can use your corporate credentials to access the required Git repository and Google Cloud resources. You want to fix the issue as quickly and efficiently as possible while minimizing additional cost. What should you do?

  • ACreate and launch a workstation with Cloud Workstations on your personal computer. Authenticate and set up API access in the workstation. Clone the Git repository and execute the workaround script. Ensure that the issue has been fixed.
  • BInstall VS Code and the extension Cloud Code for VS Code on your personal computer. Check the Cloud Run logs in Cloud Code to confirm the error. Execute the workaround script. Ensure that the issue has been fixed.
  • CConnect to the Google Cloud console and open Cloud Shell on your personal computer. Clone the Git repository and execute the workaround script. Ensure that the issue has been fixed. (correct answer)
  • DDownload and install the gcloud CLI on your personal computer. Authenticate and set up API access. Clone the Git repository and execute the workaround script. Ensure that the issue has been fixed.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Connect to the Google Cloud console and open Cloud Shell on your personal computer. Clone the Git repository and execute the workaround script. Ensure that the issue has been fixed.

Topic 1 Β· Question 300

You are using App Engine and Cloud SQL for PostgreSQL to develop an application. You want to test your application code locally before deploying new application versions to the development environment that is shared with other developers. You need to set up your App Engine local development environment to test your application while keeping all traffic to Cloud SQL instances encrypted and authenticated to Cloud IAM and PostgreSQL. What should you do before starting the local development server?

  • AInstall PostgreSQL on your local workstation. Run a local PostgreSQL database on your workstation. Configure the application to connect to a PostgreSQL instance on localhost.
  • BDownload and install the Cloud SQL Auth Proxy to your local development environment. Configure the Cloud SQL Auth Proxy to connect to the Cloud SQL instance and run the proxy. Configure the application to connect to a PostgreSQL instance on localhost. (correct answer)
  • CDeploy a Compute Engine instance, and install HAProxy on the instance. Configure Cloud SQL Auth Proxy on the instance, and use the instance’s service account to authenticate to Cloud SQL. Configure the application to connect to the Compute Engine instance's IP address.
  • DConfigure your local development server to connect to the private IP address of the Cloud SQL instance. Encrypt database entries with a cryptographic library before submitting them to the database. Store the decryption key as an environment variable in App Engine.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Download and install the Cloud SQL Auth Proxy to your local development environment. Configure the Cloud SQL Auth Proxy to connect to the Cloud SQL instance and run the proxy. Configure the application to connect to a...

Explanation

Cloud SQL is a managed relational database (MySQL/PostgreSQL/SQL Server) that handles patching, backups, and failover.

Topic 1 Β· Question 301

You are developing a public web application on Cloud Run. You expose the Cloud Run service directly with its public IP address. You are now running a load test to ensure that your application is resilient against high traffic loads. You notice that your application performs as expected when you initiate light traffic. However, when you generate high loads, your web server runs slowly and returns error messages. How should you troubleshoot this issue?

  • ACheck the network traffic to Cloud Run in Cloud Monitoring to validate whether a traffic spike occurred. If necessary, enable traffic splitting on the Cloud Run instance to route some of the traffic to a previous instance revision.
  • BCheck the min-instances value for your Cloud Run service. If necessary, increase the min-instances value to match the maximum number of virtual users in your load test.
  • CCheck whether Cloud Armor is detecting distributed denial of service (DDoS) attacks and is blocking traffic before the traffic is routed to your Cloud Run service. If necessary, disable any Cloud Armor policies in your project.
  • DCheck whether the Cloud Run service has scaled to a number of instances that equals the max-instances value. If necessary, increase the max-instances value. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Check whether the Cloud Run service has scaled to a number of instances that equals the max-instances value. If necessary, increase the max-instances value.

Explanation

Cloud Run runs stateless containers serverlessly and scales to zero, minimizing operational overhead. By spanning multiple Availability Zones / adding redundancy, this option provides the high availability and resilience required.

Showing questions 281–300 of 359 Β· Page 15 of 18