google professional-cloud-developer practice test

Professional Cloud Developer


Question 1

Your application takes an input from a user and publishes it to the user's contacts. This input is stored in a table in Cloud
Spanner. Your application is more sensitive to latency and less sensitive to consistency.
How should you perform reads from Cloud Spanner for this application?

  • A. Perform Read-Only transactions.
  • B. Perform stale reads using single-read methods.
  • C. Perform strong reads using single-read methods.
  • D. Perform stale reads using read-write transactions.
Answer:

D

Explanation:
Reference: https://cloud.google.com/solutions/best-practices-cloud-spanner-gaming-database

Discussions

Question 2

Your API backend is running on multiple cloud providers. You want to generate reports for the network latency of your API.
Which two steps should you take? (Choose two.)

  • A. Use Zipkin collector to gather data.
  • B. Use Fluentd agent to gather data.
  • C. Use Stackdriver Trace to generate reports.
  • D. Use Stackdriver Debugger to generate report.
  • E. Use Stackdriver Profiler to generate report.
Answer:

C E

Discussions

Question 3

You are a SaaS provider deploying dedicated blogging software to customers in your Google Kubernetes Engine (GKE)
cluster. You want to configure a secure multi-tenant platform to ensure that each customer has access to only their own blog
and cant affect the workloads of other customers. What should you do?

  • A. Enable Application-layer Secrets on the GKE cluster to protect the cluster.
  • B. Deploy a namespace per tenant and use Network Policies in each blog deployment.
  • C. Use GKE Audit Logging to identify malicious containers and delete them on discovery.
  • D. Build a custom image of the blogging software and use Binary Authorization to prevent untrusted image deployments.
Answer:

B

Explanation:
Reference: https://cloud.google.com/kubernetes-engine/docs/concepts/multitenancy-overview

Discussions

Question 4

Your website is deployed on Compute Engine. Your marketing team wants to test conversion rates between 3 different
website designs.
Which approach should you use?

  • A. Deploy the website on App Engine and use traffic splitting.
  • B. Deploy the website on App Engine as three separate services.
  • C. Deploy the website on Cloud Functions and use traffic splitting.
  • D. Deploy the website on Cloud Functions as three separate functions.
Answer:

A

Explanation:
Reference: https://cloud.google.com/appengine/docs/standard/python/splitting-traffic

Discussions

Question 5

You are planning to migrate a MySQL database to the managed Cloud SQL database for Google Cloud. You have Compute
Engine virtual machine instances that will connect with this Cloud SQL instance. You do not want to whitelist IPs for the
Compute Engine instances to be able to access Cloud SQL.
What should you do?

  • A. Enable private IP for the Cloud SQL instance.
  • B. Whitelist a project to access Cloud SQL, and add Compute Engine instances in the whitelisted project.
  • C. Create a role in Cloud SQL that allows access to the database from external instances, and assign the Compute Engine instances to that role.
  • D. Create a CloudSQL instance on one project. Create Compute engine instances in a different project. Create a VPN between these two projects to allow internal access to CloudSQL.
Answer:

C

Explanation:
Reference: https://cloud.google.com/sql/docs/mysql/connect-external-app

Discussions

Question 6

You are developing an ecommerce application that stores customer, order, and inventory data as relational tables inside
Cloud Spanner. During a recent load test, you discover that Spanner performance is not scaling linearly as expected. Which
of the following is the cause?

  • A. The use of 64-bit numeric types for 32-bit numbers.
  • B. The use of the STRING data type for arbitrary-precision values.
  • C. The use of Version 1 UUIDs as primary keys that increase monotonically.
  • D. The use of LIKE instead of STARTS_WITH keyword for parameterized SQL queries.
Answer:

B

Discussions

Question 7

You support an application that uses the Cloud Storage API. You review the logs and discover multiple HTTP 503 Service
Unavailable error responses from the API. Your application logs the error and does not take any further action. You want to
implement Google-recommended retry logic to improve success rates. Which approach should you take?

  • A. Retry the failures in batch after a set number of failures is logged.
  • B. Retry each failure at a set time interval up to a maximum number of times.
  • C. Retry each failure at increasing time intervals up to a maximum number of tries.
  • D. Retry each failure at decreasing time intervals up to a maximum number of tries.
Answer:

C

Discussions

Question 8

You are using Cloud Build build to promote a Docker image to Development, Test, and Production environments. You need
to ensure that the same Docker image is deployed to each of these environments.
How should you identify the Docker image in your build?

  • A. Use the latest Docker image tag.
  • B. Use a unique Docker image name.
  • C. Use the digest of the Docker image.
  • D. Use a semantic version Docker image tag.
Answer:

D

Discussions

Question 9

You are designing a schema for a Cloud Spanner customer database. You want to store a phone number array field in a
customer table. You also want to allow users to search customers by phone number.
How should you design this schema?

  • A. Create a table named Customers. Add an Array field in a table that will hold phone numbers for the customer.
  • B. Create a table named Customers. Create a table named Phones. Add a CustomerId field in the Phones table to find the CustomerId from a phone number.
  • C. Create a table named Customers. Add an Array field in a table that will hold phone numbers for the customer. Create a secondary index on the Array field.
  • D. Create a table named Customers as a parent table. Create a table named Phones, and interleave this table into the Customer table. Create an index on the phone number field in the Phones table.
Answer:

C

Discussions

Question 10

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?

  • A. Build a test harness to generate requests and deploy it to Cloud Run. Analyze the VPC Flow Logs using Cloud Logging.
  • B. Create a Google Kubernetes Engine cluster running the Locust or JMeter images to dynamically generate load tests. Analyze the results using Cloud Trace.
  • C. Create 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.
  • D. Create 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.
Answer:

B

Discussions
To page 2