πŸ”

PCD β€” questions

Page 2 of 18 Β· 359 total questions.

Topic 1 Β· Question 21

You plan to make a simple HTML application available on the internet. This site keeps information about FAQs for your application. The application is static and contains images, HTML, CSS, and Javascript. You want to make this application available on the internet with as few steps as possible. What should you do?

  • AUpload your application to Cloud Storage. (correct answer)
  • BUpload your application to an App Engine environment.
  • CCreate a Compute Engine instance with Apache web server installed. Configure Apache web server to host the application.
  • DContainerize your application first. Deploy this container to Google Kubernetes Engine (GKE) and assign an external IP address to the GKE pod hosting the application.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Upload your application to Cloud Storage.

Explanation

Cloud Storage provides durable, scalable object storage that is fully managed.

Topic 1 Β· Question 22

Your company has deployed a new API to App Engine Standard environment. During testing, the API is not behaving as expected. You want to monitor the application over time to diagnose the problem within the application code without redeploying the application. Which tool should you use?

  • AStackdriver Trace
  • BStackdriver Monitoring
  • CStackdriver Debug Snapshots
  • DStackdriver Debug Logpoints (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Stackdriver Debug Logpoints

Explanation

Cloud Operations (formerly Stackdriver) provides monitoring, logging, and tracing for reliability.

Topic 1 Β· Question 23

You want to use the Stackdriver Logging Agent to send an application's log file to Stackdriver from a Compute Engine virtual machine instance. After installing the Stackdriver Logging Agent, what should you do first?

  • AEnable the Error Reporting API on the project.
  • BGrant the instance full access to all Cloud APIs.
  • CConfigure the application log file as a custom source. (correct answer)
  • DCreate a Stackdriver Logs Export Sink with a filter that matches the application's log entries.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Configure the application log file as a custom source.

Topic 1 Β· Question 24

Your company has a BigQuery data mart that provides analytics information to hundreds of employees. One user of wants to run jobs without interrupting important workloads. This user isn't concerned about the time it takes to run these jobs. You want to fulfill this request while minimizing cost to the company and the effort required on your part. What should you do?

  • AAsk the user to run the jobs as batch jobs. (correct answer)
  • BCreate a separate project for the user to run jobs.
  • CAdd the user as a job.user role in the existing project.
  • DAllow the user to run jobs when important workloads are not running.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Ask the user to run the jobs as batch jobs.

Explanation

Google Cloud Batch schedules and runs batch jobs at scale without managing infrastructure.

Topic 1 Β· Question 25

You want to notify on-call engineers about a service degradation in production while minimizing development time. What should you do?

  • AUse Cloud Function to monitor resources and raise alerts.
  • BUse Cloud Pub/Sub to monitor resources and raise alerts.
  • CUse Stackdriver Error Reporting to capture errors and raise alerts.
  • DUse Stackdriver Monitoring to monitor resources and raise alerts. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Use Stackdriver Monitoring to monitor resources and raise alerts.

Explanation

Cloud Operations (formerly Stackdriver) provides monitoring, logging, and tracing for reliability.

Topic 1 Β· Question 26

You are writing a single-page web application with a user-interface that communicates with a third-party API for content using XMLHttpRequest. The data displayed on the UI by the API results is less critical than other data displayed on the same web page, so it is acceptable for some requests to not have the API data displayed in the UI. However, calls made to the API should not delay rendering of other parts of the user interface. You want your application to perform well when the API response is an error or a timeout. What should you do?

  • ASet the asynchronous option for your requests to the API to false and omit the widget displaying the API results when a timeout or error is encountered.
  • BSet the asynchronous option for your request to the API to true and omit the widget displaying the API results when a timeout or error is encountered. (correct answer)
  • CCatch timeout or error exceptions from the API call and keep trying with exponential backoff until the API response is successful.
  • DCatch timeout or error exceptions from the API call and display the error response in the UI widget.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Set the asynchronous option for your request to the API to true and omit the widget displaying the API results when a timeout or error is encountered.

Topic 1 Β· Question 27

You are creating a web application that runs in a Compute Engine instance and writes a file to any user's Google Drive. You need to configure the application to authenticate to the Google Drive API. What should you do?

  • AUse an OAuth Client ID that uses the https://www.googleapis.com/auth/drive.file scope to obtain an access token for each user. (correct answer)
  • BUse an OAuth Client ID with delegated domain-wide authority.
  • CUse the App Engine service account and https://www.googleapis.com/auth/drive.file scope to generate a signed JSON Web Token (JWT).
  • DUse the App Engine service account with delegated domain-wide authority.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Use an OAuth Client ID that uses the https://www.googleapis.com/auth/drive.file scope to obtain an access token for each user.

Topic 1 Β· Question 28

You are creating a Google Kubernetes Engine (GKE) cluster and run this command: The command fails with the error: You want to resolve the issue. What should you do?

  • ARequest additional GKE quota in the GCP Console.
  • BRequest additional Compute Engine quota in the GCP Console. (correct answer)
  • COpen a support case to request additional GKE quota.
  • DDecouple services in the cluster, and rewrite new clusters to function with fewer cores.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Request additional Compute Engine quota in the GCP Console.

Explanation

Compute Engine provides configurable virtual machines when you need full control of the OS.

Topic 1 Β· Question 29

You are parsing a log file that contains three columns: a timestamp, an account number (a string), and a transaction amount (a number). You want to calculate the sum of all transaction amounts for each unique account number efficiently. Which data structure should you use?

  • AA linked list
  • BA hash table (correct answer)
  • CA two-dimensional array
  • DA comma-delimited string
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: A hash table.

Topic 1 Β· Question 30

Your company has a BigQuery dataset named "Master" that keeps information about employee travel and expenses. This information is organized by employee department. That means employees should only be able to view information for their department. You want to apply a security framework to enforce this requirement with the minimum number of steps. What should you do?

  • ACreate a separate dataset for each department. Create a view with an appropriate WHERE clause to select records from a particular dataset for the specific department. Authorize this view to access records from your Master dataset. Give employees the permission to this department-specific dataset.
  • BCreate a separate dataset for each department. Create a data pipeline for each department to copy appropriate information from the Master dataset to the specific dataset for the department. Give employees the permission to this department-specific dataset.
  • CCreate a dataset named Master dataset. Create a separate view for each department in the Master dataset. Give employees access to the specific view for their department. (correct answer)
  • DCreate a dataset named Master dataset. Create a separate table for each department in the Master dataset. Give employees access to the specific table for their department.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Create a dataset named Master dataset. Create a separate view for each department in the Master dataset. Give employees access to the specific view for their department.

Topic 1 Β· Question 31

You have an application in production. It is deployed on Compute Engine virtual machine instances controlled by a managed instance group. Traffic is routed to the instances via a HTTP(s) load balancer. Your users are unable to access your application. You want to implement a monitoring technique to alert you when the application is unavailable. Which technique should you choose?

  • ASmoke tests
  • BStackdriver uptime checks (correct answer)
  • CCloud Load Balancing - heath checks
  • DManaged instance group - heath checks
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Stackdriver uptime checks

Explanation

Cloud Operations (formerly Stackdriver) provides monitoring, logging, and tracing for reliability.

Topic 1 Β· Question 32

You are load testing your server application. During the first 30 seconds, you observe that a previously inactive Cloud Storage bucket is now servicing 2000 write requests per second and 7500 read requests per second. Your application is now receiving intermittent 5xx and 429 HTTP responses from the Cloud Storage JSON API as the demand escalates. You want to decrease the failed responses from the Cloud Storage API. What should you do?

  • ADistribute the uploads across a large number of individual storage buckets.
  • BUse the XML API instead of the JSON API for interfacing with Cloud Storage.
  • CPass the HTTP response codes back to clients that are invoking the uploads from your application.
  • DLimit the upload rate from your application clients so that the dormant bucket's peak request rate is reached more gradually. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Limit the upload rate from your application clients so that the dormant bucket's peak request rate is reached more gradually.

Topic 1 Β· Question 33

Your application is controlled by a managed instance group. You want to share a large read-only data set between all the instances in the managed instance group. You want to ensure that each instance can start quickly and can access the data set via its filesystem with very low latency. You also want to minimize the total cost of the solution. What should you do?

  • AMove the data to a Cloud Storage bucket, and mount the bucket on the filesystem using Cloud Storage FUSE.
  • BMove the data to a Cloud Storage bucket, and copy the data to the boot disk of the instance via a startup script.
  • CMove the data to a Compute Engine persistent disk, and attach the disk in read-only mode to multiple Compute Engine virtual machine instances. (correct answer)
  • DMove the data to a Compute Engine persistent disk, take a snapshot, create multiple disks from the snapshot, and attach each disk to its own instance.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Move the data to a Compute Engine persistent disk, and attach the disk in read-only mode to multiple Compute Engine virtual machine instances.

Explanation

Compute Engine provides configurable virtual machines when you need full control of the OS. Persistent Disk provides durable block storage attached to Compute Engine VMs. This option meets the real-time / low-latency performance requirement.

Topic 1 Β· Question 34

You are developing an HTTP API hosted on a Compute Engine virtual machine instance that needs to be invoked by multiple clients within the same Virtual Private Cloud (VPC). You want clients to be able to get the IP address of the service. What should you do?

  • AReserve a static external IP address and assign it to an HTTP(S) load balancing service's forwarding rule. Clients should use this IP address to connect to the service.
  • BReserve a static external IP address and assign it to an HTTP(S) load balancing service's forwarding rule. Then, define an A record in Cloud DNS. Clients should use the name of the A record to connect to the service.
  • CEnsure that clients use Compute Engine internal DNS by connecting to the instance name with the url https://[INSTANCE_NAME].[ZONE].c. [PROJECT_ID].internal/. (correct answer)
  • DEnsure that clients use Compute Engine internal DNS by connecting to the instance name with the url https://[API_NAME]/[API_VERSION]/.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Ensure that clients use Compute Engine internal DNS by connecting to the instance name with the url https://[INSTANCE_NAME].[ZONE].c. [PROJECT_ID].internal/.

Explanation

Compute Engine provides configurable virtual machines when you need full control of the OS.

Topic 1 Β· Question 35

Your application is logging to Stackdriver. You want to get the count of all requests on all /api/alpha/* endpoints. What should you do?

  • AAdd a Stackdriver counter metric for path:/api/alpha/. (correct answer)
  • BAdd a Stackdriver counter metric for endpoint:/api/alpha/*.
  • CExport the logs to Cloud Storage and count lines matching /api/alpha.
  • DExport the logs to Cloud Pub/Sub and count lines matching /api/alpha.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Add a Stackdriver counter metric for path:/api/alpha/.

Explanation

Cloud Operations (formerly Stackdriver) provides monitoring, logging, and tracing for reliability.

Topic 1 Β· Question 36

You want to re-architect a monolithic application so that it follows a microservices model. You want to accomplish this efficiently while minimizing the impact of this change to the business. Which approach should you take?

  • ADeploy the application to Compute Engine and turn on autoscaling.
  • BReplace the application's features with appropriate microservices in phases. (correct answer)
  • CRefactor the monolithic application with appropriate microservices in a single effort and deploy it.
  • DBuild a new application with the appropriate microservices separate from the monolith and replace it when it is complete.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Replace the application's features with appropriate microservices in phases.

Topic 1 Β· Question 37

Your existing application keeps user state information in a single MySQL database. This state information is very user-specific and depends heavily on how long a user has been using an application. The MySQL database is causing challenges to maintain and enhance the schema for various users. Which storage option should you choose?

  • ACloud SQL
  • BCloud Storage
  • CCloud Spanner
  • DCloud Datastore/Firestore (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Cloud Datastore/Firestore

Explanation

Firestore is a serverless, autoscaling NoSQL document database ideal for app and user data. Datastore (Firestore in Datastore mode) is a serverless NoSQL database for user profiles and app state.

Topic 1 Β· Question 38

You are building a new API. You want to minimize the cost of storing and reduce the latency of serving images. Which architecture should you use?

  • AApp Engine backed by Cloud Storage
  • BCompute Engine backed by Persistent Disk
  • CTransfer Appliance backed by Cloud Filestore
  • DCloud Content Delivery Network (CDN) backed by Cloud Storage (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Cloud Content Delivery Network (CDN) backed by Cloud Storage

Explanation

Cloud Storage provides durable, scalable object storage that is fully managed.

Topic 1 Β· Question 39

Your company's development teams want to use Cloud Build in their projects to build and push Docker images to Container Registry. The operations team requires all Docker images to be published to a centralized, securely managed Docker registry that the operations team manages. What should you do?

  • AUse Container Registry to create a registry in each development team's project. Configure the Cloud Build build to push the Docker image to the project's registry. Grant the operations team access to each development team's registry.
  • BCreate a separate project for the operations team that has Container Registry configured. Assign appropriate permissions to the Cloud Build service account in each developer team's project to allow access to the operation team's registry. (correct answer)
  • CCreate a separate project for the operations team that has Container Registry configured. Create a Service Account for each development team and assign the appropriate permissions to allow it access to the operations team's registry. Store the service account key file in the source code repository and use it to authenticate against the operations team's registry.
  • DCreate a separate project for the operations team that has the open source Docker Registry deployed on a Compute Engine virtual machine instance. Create a username and password for each development team. Store the username and password in the source code repository and use it to authenticate against the operations team's Docker registry.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Create a separate project for the operations team that has Container Registry configured. Assign appropriate permissions to the Cloud Build service account in each developer team's project to allow access to the opera...

Explanation

A service account provides an identity for workloads to access Google Cloud APIs securely. Cloud Build runs managed CI pipelines to build, test, and package code.

Topic 1 Β· Question 40

You are planning to deploy your application in a Google Kubernetes Engine (GKE) cluster. Your application can scale horizontally, and each instance of your application needs to have a stable network identity and its own persistent disk. Which GKE object should you use?

  • ADeployment
  • BStatefulSet (correct answer)
  • CReplicaSet
  • DReplicaController
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: StatefulSet.

Showing questions 21–40 of 359 Β· Page 2 of 18