🔍

PCD — questions

Page 18 of 18 · 359 total questions.

Topic 1 · Question 342

You work for an ecommerce company. You are developing a new application with the following requirements: • The application must have access to the most up-to-date data at all times. • Due to company policy, data older than 30 days must be automatically deleted. You need to determine which service should host the database, and how to configure the data deletion. You want to use the most efficient solution. What should you do?

  • AConfigure Spanner to host the database. Use Data Catalog to delete data older than 30 days.
  • BConfigure Spanner to host the database. Create a time-to-live policy that deletes data older than 30 days. (correct answer)
  • CConfigure Bigtable to host the database. Create a time-to-live policy that deletes data older than 30 days.
  • DConfigure Bigtable to host the database. Create a garbage collection policy in Bigtable that deletes data older than 30 days.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Configure Spanner to host the database. Create a time-to-live policy that deletes data older than 30 days.

Explanation

Cloud Spanner is a horizontally scalable, strongly consistent relational database with global reach.

Topic 1 · Question 343

You are a developer at an ecommerce company. You are tasked with developing a globally consistent shopping cart for logged-in users across both mobile and desktop clients. You need to configure how the items that are added to users’ carts are stored. How should you configure this cart service?

  • AStore the carts in a separate Memorystore for Redis instance, and configure each user's IP address as the key.
  • BStore the carts in a separate Firestore document, and configure each user ID as the document's key. (correct answer)
  • CInsert the carts in a separate Spanner table, and configure each user's encrypted password as the primary key.
  • DCreate and store the carts in the shopping-cart HTTP cookie.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Store the carts in a separate Firestore document, and configure each user ID as the document's key.

Explanation

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

Topic 1 · Question 344

You are deploying a containerized application to GKE. You have set up a build pipeline by using Cloud Build that builds a Java application and pushes the application container image to Artifact Registry. Your build pipeline executes multiple sequential steps that reference Docker container images with the same layers. You notice that the Cloud Build pipeline runs are taking longer than expected to complete. How should you optimize the Docker image build process?

  • AAdd the --squash parameter to the Docker build steps to combine newly built layers into a single layer.
  • BConfigure Cloud Build to use a private pool in your VPC for pipeline executions.
  • CSpecify the cached image by adding the --cache-from argument in your build config file with the image as a cache source. (correct answer)
  • DStore container artifacts on Cloud Storage. Configure Cloud CDN on the Cloud Storage bucket to enable caching on edge locations.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Specify the cached image by adding the --cache-from argument in your build config file with the image as a cache source.

Topic 1 · Question 345

You are developing a dashboard that aggregates temperature readings from thousands of IoT devices monitoring a city's ambient temperature. You expect a large amount of viewing traffic resulting in a large amount of data egress once the dashboard is live. The dashboard temperature display data doesn't need to be real-time and can tolerate a few seconds of lag. You decide to deploy Memorystore for Redis as the storage backend. You want to ensure that the dashboard will be highly available. How should you configure the service in Memorystore for Redis?

  • AUpdate Memorystore for Redis to the latest version.
  • BConfigure Memorystore to use read replicas. (correct answer)
  • CUse Private Service Access to enable low-latency network throughput.
  • DSet up Serverless VPC Access to avoid receiving traffic over the internet.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Configure Memorystore to use read replicas.

Explanation

Memorystore provides managed in-memory Redis/Memcached caching to reduce latency and offload databases. By spanning multiple Availability Zones / adding redundancy, this option provides the high availability and resilience required.

Topic 1 · Question 346

You are responsible for developing a new ecommerce application that is running on Cloud Run. You need to connect your application to a Cloud SQL database that is in a separate project. This project is on an isolated network dedicated to multiple databases without a public IP. You need to connect your application to this database. What should you do?

  • ACreate a Private Service Connect endpoint on your network. Create a Serverless VPC Access connector on your project. Use Cloud SQL Language Connectors to create an internal connection.
  • BConfigure VPC Network Peering between both networks. In Cloud Run, create a Cloud SQL connection that uses the internal IP. Use Cloud SQL Language Connectors to interact with the database.
  • CConfigure private services access on your project. In Cloud Run, create a Cloud SQL connection. Use Cloud SQL Language Connectors to interact with the database.
  • DCreate a subnet on your VPC. Create a Serverless VPC Access connector on your project using the new subnet. In Cloud Run, create a Cloud SQL connection. Use Cloud SQL Language Connectors to interact with the database. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Create a subnet on your VPC. Create a Serverless VPC Access connector on your project using the new subnet. In Cloud Run, create a Cloud SQL connection. Use Cloud SQL Language Connectors to interact with the database.

Explanation

Cloud Run runs stateless containers serverlessly and scales to zero, minimizing operational overhead. Cloud SQL is a managed relational database (MySQL/PostgreSQL/SQL Server) that handles patching, backups, and failover. A VPC provides a global, software-defined private network for your Google Cloud resources.

Topic 1 · Question 347

You are deploying new workloads on a GKE Autopilot mode cluster. You need to ensure that the Pods are scheduled on nodes that use Arm architecture CPUs. The cluster currently has no Arm-based CPUs. You want to minimize cluster operations. How should you ensure that the workloads on the GKE cluster will use Arm-based CPU nodes?

  • AApply Pod tolerations to request GKE to avoid scheduling Pods on nodes that do not have Arm-based CPUs.
  • BApply node taints on node pools to tell GKE to only schedule your workloads on Arm-based CPU nodes.
  • CDeploy a new cluster in GKE Standard mode, and set up a node pool with Arm-based CPU nodes. Use nodeSelector in your manifest to ensure that Pods are scheduled in this node pool.
  • DRequest the Scale-out compute class and the arm64 architecture in your manifest. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Request the Scale-out compute class and the arm64 architecture in your manifest.

Topic 1 · Question 348

You are developing a new Python 3 API that needs to be deployed to Cloud Run. Your Cloud Run service sits behind an Apigee proxy. You need to ensure that the Cloud Run service is running with the already deployed Apigee proxy. You want to conduct this testing as quickly as possible. What should you do?

  • AStore the service code as a zip file in a Cloud Storage bucket. Deploy your application by using the gcloud run deploy --source command, and test the integration by pointing Apigee to Cloud Run.
  • BUse the Cloud Run emulator to test your application locally. Test the integration by pointing Apigee to your local Cloud Run emulator.
  • CBuild a container image locally, and push the image to Artifact Registry. Deploy the Image to Cloud Run, and test the integration by pointing Apigee to Cloud Run.
  • DDeploy your application directly from the current directory by using the gcloud run deploy --source command, and test the integration by pointing Apigee to Cloud Run. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Deploy your application directly from the current directory by using the gcloud run deploy --source command, and test the integration by pointing Apigee to Cloud Run.

Explanation

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

Topic 1 · Question 349

Your company is planning a global event. You need to configure an event registration portal for the event. You have decided to deploy the registration service by using Cloud Run. Your company’s marketing team does not want to advertise the Cloud Run service URL. They want the registration portal to be accessed by using a personalized hostname or path in your custom domain URL pattern, for example, .example.com. How should you configure access to the service while following Google-recommended practices?

  • AConfigure Cloud Armor to block traffic on the Cloud Run service URL and allow reroutes from only the custom domain URL pattern.
  • BSet up an HAProxy on Compute Engine, and add routing rules for a custom domain to the Cloud Run service URL.
  • CAdd a global external Application Load Balancer in front of the service, and configure a DNS record that points to the load balancer’s IP address. (correct answer)
  • DCreate a CNAME record that points to the Cloud Run service URL.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Add a global external Application Load Balancer in front of the service, and configure a DNS record that points to the load balancer’s IP address.

Explanation

A load balancer distributes traffic across healthy backends in multiple zones for availability and scale.

Topic 1 · Question 350

You are building a Workflow to process complex data analytics for your application. You plan to use the Workflow to execute a Cloud Run job while following Google-recommended practices. What should you do?

  • ACreate a Pub/Sub topic, and subscribe the Cloud Run job to the topic.
  • BConfigure an Eventarc trigger to invoke the Cloud Run job, and include the trigger in a step of the Workflow.
  • CUse the Cloud Run Admin API connector to execute the Cloud Run job within the Workflow. (correct answer)
  • DDetermine the entry point of the Cloud Run job, and send an HTTP request from the Workflow.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Use the Cloud Run Admin API connector to execute the Cloud Run job within the Workflow.

Explanation

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

Topic 1 · Question 351

You are developing an application that needs to connect to a Cloud SQL for PostgreSQL database by using the Cloud SQL Auth Proxy. The Cloud SQL Auth Proxy is hosted in a different Google Cloud VPC network. The Cloud SQL for PostgreSQL instance has public and private IP addresses. You are required to use the private IP for security reasons. When testing the connection to the Cloud SQL instance, you can connect by using the public IP address, but you are unable to connect by using the private IP address. How should you fix this issue?

  • ARun the Cloud SQL Auth Proxy as a background service.
  • BAdd the --private-ip option when starting the Cloud SQL Auth Proxy.
  • CSet up VPC Network Peering between your VPC and the VPC where the Cloud SQL instance is deployed. (correct answer)
  • DGrant yourself the IAM role that provides access to the Cloud SQL instance.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Set up VPC Network Peering between your VPC and the VPC where the Cloud SQL instance is deployed.

Explanation

Cloud SQL is a managed relational database (MySQL/PostgreSQL/SQL Server) that handles patching, backups, and failover. A VPC provides a global, software-defined private network for your Google Cloud resources.

Topic 1 · Question 352

You are developing a custom job scheduler that must have a persistent cache containing entries of all Compute Engine VMs that are in a running state (not deleted, stopped, or suspended). The job scheduler checks this cache and only sends jobs to the available Compute Engine VMs in the cache. You need to ensure that the available Compute Engine instance cache is not stale. What should you do?

  • ASet up an organization-level Cloud Storage log sink with a filter to capture the audit log events for Compute Engine. Configure an Eventarc trigger that executes when the Cloud Storage bucket is updated and sends these events to the application to update the cache.
  • BSet up a Cloud Asset Inventory real-time feed of insert and delete events with the asset types filter set to compute.googleapis.com/Instance. Configure an Eventarc trigger that sends these events to the application to update the cache.
  • CSet up an organization-level Pub/Sub log sink with a filter to capture the audit log events for Compute Engine. Configure an Eventarc trigger that sends these events to the application to update the cache. (correct answer)
  • DSet up an organization-level BigQuery log sink. Configure the application to query this BigQuery table every minute to retrieve the last minute’s events and update the cache.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Set up an organization-level Pub/Sub log sink with a filter to capture the audit log events for Compute Engine. Configure an Eventarc trigger that sends these events to the application to update the cache.

Explanation

Compute Engine provides configurable virtual machines when you need full control of the OS. Pub/Sub is a serverless, global messaging service that decouples services and ingests high-volume event streams.

Topic 1 · Question 353

You have a Cloud Run service that connects to a Cloud SQL Enterprise edition database instance using the default Cloud SQL connection. You need to enable more than 100 connections per Cloud Run instance. What should you do?

  • AIncrease the queries per minute quota limit of the Cloud SQL Admin API.
  • BIncrease the max_connection flag in Cloud SQL for PostgresSQL.
  • CUpgrade to Cloud SQL Enterprise Plus edition. (correct answer)
  • DUse Cloud SQL Auth Proxy in a sidecar.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Upgrade to Cloud SQL Enterprise Plus edition.

Explanation

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

Topic 1 · Question 354

You are developing a new mobile game that will be deployed on GKE and Cloud Run as a set of microservices. Currently, there are no projections for the game’s user volume. You need to store the following data types: • Data type 1: leaderboard data • Data type 2: player profiles, chats, and news feed • Data type 3: player clickstream data for BI You need to identify a data storage solution that is easy to use, cost-effective, scalable, and supports offline caching on the user’s device. Which data storage option should you choose for the different data types?

  • A• Data type 1: Memorystore• Data type 2: Firestore• Data type 3: BigQuery
  • B• Data type 1: Memorystore• Data type 2: Spanner• Data type 3: Bigtable
  • C• Data type 1: Firestore• Data type 2: Cloud SQL• Data type 3: BigQuery
  • D• Data type 1: Firestore• Data type 2: Firestore• Data type 3: BigQuery (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: • Data type 1: Firestore• Data type 2: Firestore• Data type 3: 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. This option delivers the requirement at the lowest cost.

Topic 1 · Question 355

Your team developed a web-based game that has many simultaneous players. Recently, users have started to complain that the leaderboard tallies the top scores too slowly. You investigated the issue and discovered that the application stack is currently using Cloud SQL for PostgreSQL. You want to improve the leaderboard performance as much as possible to provide a better user experience. What should you do?

  • ARe-implement the leaderboard data to be stored in Memorystore for Redis. (correct answer)
  • BOptimize the SQL queries to minimize slow-running queries.
  • CMigrate the database and store the data in AlloyDB.
  • DUpdate Cloud SQL for PostgreSQL to the latest version.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Re-implement the leaderboard data to be stored in Memorystore for Redis.

Explanation

Memorystore provides managed in-memory Redis/Memcached caching to reduce latency and offload databases.

Topic 1 · Question 356

You are a developer at a large corporation. You manage three GKE clusters. Your team’s developers need to switch from one cluster to another regularly on the same workstation. You want to configure individual access to these multiple clusters securely while following Google-recommended practices. What should you do?

  • AAsk the developers to use Cloud Shell and run the gcloud container clusters get-credentials command to switch to another cluster.
  • BAsk the developers to open three terminals on their workstation and use the kubectl config set command to configure access to each cluster.
  • CAsk the developers to install the gcloud CLI on their workstation and run the gcloud container clusters get-credentials command to switch to another cluster. (correct answer)
  • DIn a text file, define the clusters, users, and contexts. Email the file to the developers and ask them to use the kubectl config set command to add cluster, user, and context details to the file.
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 the gcloud container clusters get-credentials command to switch to another cluster.

Topic 1 · Question 357

You are tasked with using C++ to build and deploy a microservice for an application hosted on Google Cloud. The code needs to be containerized and use several custom software libraries that your team has built. You want to minimize maintenance of the application’s underlying infrastructure. How should you deploy the microservice?

  • AUse Cloud Run functions to deploy the microservice.
  • BUse Cloud Build to create the container, and deploy it on Cloud Run. (correct answer)
  • CUse Cloud Shell to containerize your microservice, and deploy it on GKE Standard.
  • DUse Cloud Shell to containerize your microservice, and deploy it on a Container-Optimized OS Compute Engine instance.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Use Cloud Build to create the container, and deploy it on Cloud Run.

Explanation

Cloud Run runs stateless containers serverlessly and scales to zero, minimizing operational overhead. Cloud Build runs managed CI pipelines to build, test, and package code.

Topic 1 · Question 358

You are a developer that works for a local concert venue. Customers use your company’s website to purchase tickets for events. You need to provide customers with immediate confirmation when a selected seat has been reserved. How should you design the ticket ordering process?

  • AUpload the seat reservation to a Cloud Storage bucket, which triggers an event to the backend service that processes the seat reservation.
  • BSubmit the seat reservation in an HTTP POST request to an Application Load Balancer. Configure the Application Load Balancer to distribute the request to the backend service that processes the seat reservation. (correct answer)
  • CAdd the seat reservation to a Cloud Tasks queue, which triggers Workflows to process the seat reservation.
  • DPublish the seat reservation to a Pub/Sub topic. Configure the backend service to subscribe to the topic to process the seat reservation.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Submit the seat reservation in an HTTP POST request to an Application Load Balancer. Configure the Application Load Balancer to distribute the request to the backend service that processes the seat reservation.

Explanation

A load balancer distributes traffic across healthy backends in multiple zones for availability and scale.

Topic 1 · Question 359

Your team is trying to reduce their cloud spend, and you want to evaluate your GKE Autopilot cluster costs. When reviewing the manifests, you see that resource requests are currently not specified. Your application is stateless and fault-tolerant, and there are no specific hardware or memory requirements on nodes. You want to modify the cluster to be scalable and cost-effective as quickly as possible while maintaining a cluster with sufficient computing resources. What should you do?

  • ARequest that your Pods run as Spot Pods, and use the cloud.google.com/gke-spot=true label in your YAML manifest. (correct answer)
  • BRequest the Balanced compute class in your YAML manifest.
  • CIn the YAML deployment configuration manifest, request and set the maximum CPU to 5 vCPU.
  • DSet up Cloud Trace and Cloud Monitoring, identify the maximum memory used in the past 30 days, and set the YAML manifest to request that amount of memory.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Request that your Pods run as Spot Pods, and use the cloud.google.com/gke-spot=true label in your YAML manifest.

Explanation

Google Kubernetes Engine runs managed Kubernetes for containerized, portable workloads. This option delivers the requirement at the lowest cost.

Topic 1 · Question 360

You are building an application that will store frequently accessed data in a Memorystore for Redis Cluster instance. You would like to make the application resilient to network issues. You need to ensure that the application handles client disconnections from a Redis instance gracefully to minimize disruption and ensure stability of the application. What should you do?

  • AImmediately terminate the application instance upon detecting a Redis disconnection to force a restart, and wait for clients to reconnect to the cache as soon as the application becomes available.
  • BConfigure the Redis client to reconnect after a fixed delay of 60 seconds.
  • CUse Memorystore’s automatic failover mechanisms to make the Redis cache available in a secondary zone.
  • DImplement exponential backoff with a jitter when reconnecting after a disconnection. Configure client-side caching to serve data during brief outages. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Implement exponential backoff with a jitter when reconnecting after a disconnection. Configure client-side caching to serve data during brief outages. By spanning multiple Availability Zones / adding redundancy, this option provides the high availability and resilience required.

Showing questions 341359 of 359 · Page 18 of 18