You are a lead developer working on a new retail system that runs on Cloud Run and
Firestore. A web UI requirement is for the user to be able to browse through alt products. A
few months after go-live, you notice that Cloud Run instances are terminated with HTTP
500: Container instances are exceeding memory limits errors during busy times.
This error coincides with spikes in the number of Firestore queries
You need to prevent Cloud Run from crashing and decrease the number of Firestore
queries. You want to use a solution that optimizes system performance What should you
do?
Show answerHide answer
Correct answer: BModify the query that returns the product list using cursors with limits
Question 22Choose 1
You are running an application on App Engine that you inherited. You want to find out
whether the application is using insecure binaries or is vulnerable to XSS attacks. Which
service should you use?
Show answerHide answer
Correct answer: CCloud Security Scanner
Question 23Choose 1
Your team is building an application for a financial institution. The application's frontend
runs on Compute Engine, and the data resides in Cloud SQL and one Cloud Storage
bucket. The application will collect data containing PII, which will be stored in the Cloud
SQL database and the Cloud Storage bucket. You need to secure the PII data. What
should you do?
Show answerHide answer
Correct answer: C1) Configure a private IP address for Cloud SQL
2) Use VPC-SC to create a service perimeter
3) Add the Cloud SQL database and the Cloud Storage bucket to the same service
perimeter
Question 24Choose 1
You are responsible for deploying a new API. That API will have three different URL paths:
• https://yourcompany.com/students
• https://yourcompany.com/teachers
• https://yourcompany.com/classes
You need to configure each API URL path to invoke a different function in your code. What
should you do?
Show answerHide answer
Correct answer: DCreate three Cloud Functions as three backend services exposed using an HTTPS load
balancer.
Question 25Choose 1
Your team develops services that run on Google Cloud. You want to process messages
sent to a Pub/Sub topic, and then store them. Each message must be processed exactly
once to avoid duplication of data and any data conflicts. You need to use the cheapest and
most simple solution. What should you do?
Show answerHide answer
Correct answer: BProcess the messages with a Dataflow streaming pipeline using Apache Beam's
PubSubIO package, and write the output to storage.
Question 26Choose 1
You are designing a deployment technique for your new applications on Google Cloud. As
part of your deployment planning, you want to use live traffic to gather performance metrics for both new and existing applications. You need to test against the full production load
prior to launch. What should you do?
Show answerHide answer
Correct answer: AUse canary deployment
Question 27Choose 1
You are building a mobile application that will store hierarchical data structures in a
database. The application will enable users working offline to sync changes when they are
back online. A backend service will enrich the data in the database using a service
account. The application is expected to be very popular and needs to scale seamlessly and
securely. Which database and IAM role should you use?
Show answerHide answer
Correct answer: CUse Firestore in Native mode and assign the roles/datastore.user role to the service
account.
Explanation
Cloud Firestore supports offline data persistence. This feature caches a copy of the Cloud
Firestore data that your app is actively using, so your app can access the data when the
device is offline. You can write, read, listen to, and query the cached data. When the device
comes back online, Cloud Firestore synchronizes any local changes made by your app to
the Cloud Firestore backend.
Question 28Choose 1
Your operations team has asked you to create a script that lists the Cloud Bigtable,
Memorystore, and Cloud SQL databases running within a project. The script should allow
users to submit a filter expression to limit the results presented. How should you retrieve
the data?
Show answerHide answer
Correct answer: DRun gcloud bigtable instances list, gcloud redis instances list, and gcloud sql databases
list. Use --filter flag with each command, and then display the results
Question 29Choose 1
You are developing an application that consists of several microservices running in a
Google Kubernetes Engine cluster. One microservice needs to connect to a third-party
database running on-premises. You need to store credentials to the database and ensure
that these credentials can be rotated while following security best practices. What should
you do?
Show answerHide answer
Correct answer: DStore the credentials as a Kubernetes Secret, and use the Cloud Key Management
Service plugin to handle encryption and decryption.
Explanation
By default, Google Kubernetes Engine (GKE) encrypts customer content stored at rest,
including Secrets. GKE handles and manages this default encryption for you without any
additional action on your part.
Application-layer secrets encryption provides an additional layer of security for sensitive
data, such as Secrets, stored in etc. Using this functionality, you can use a key managed
with Cloud KMS to encrypt data at the application layer. This encryption protects against
attackers who gain access to an offline copy of etc.
Question 30Choose 1
You want to create “fully baked” or “golden” Compute Engine images for your application.
You need to bootstrap your application to connect to the appropriate database according to
the environment the application is running on (test, staging, production). What should you
do?
Show answerHide answer
Correct answer: DWhen creating the Compute Engine instance, create a metadata item with a key of
“DATABASE” and a value for the appropriate database connection string. In your
application, query the metadata server for the “DATABASE” value, and use the value to
connect to the appropriate database.
Full mock exam
Sit the Professional-Cloud-Developer exam before exam day
Full-length mocks with the same number of questions and the same time limit as the real Professional-Cloud-Developer exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.