Professional Cloud Developer Free Practice Questions — Page 17
Question 161
Case study -
This is a case study. Case studies are not timed separately. You can use as much exam time as you would like to complete each case. However, there may be additional case studies and sections on this exam. You must manage your time to ensure that you are able to complete all questions included on this exam in the time provided.
To answer the questions included in a case study, you will need to reference information that is provided in the case study. Case studies might contain exhibits and other resources that provide more information about the scenario that is described in the case study. Each question is independent of the other questions in this case study.
At the end of this case study, a review screen will appear. This screen allows you to review your answers and to make changes before you move to the next section of the exam. After you begin a new section, you cannot return to this section.
To start the case study -
To display the first question in this case study, click the Next button. Use the buttons in the left pane to explore the content of the case study before you answer the questions. Clicking these buttons displays information such as business requirements, existing environment, and problem statements. If the case study has an All Information tab, note that the information displayed is identical to the information displayed on the subsequent tabs. When you are ready to answer a question, click the Question button to return to the question.
Company Overview -
HipLocal is a community application designed to facilitate communication between people in close proximity. It is used for event planning and organizing sporting events, and for businesses to connect with their local communities. HipLocal launched recently in a few neighborhoods in Dallas and is rapidly growing into a global phenomenon. Its unique style of hyper-local community communication and business outreach is in demand around the world.
Executive Statement -
We are the number one local community app; it's time to take our local community services global. Our venture capital investors want to see rapid growth and the same great experience for new local and virtual communities that come online, whether their members are 10 or 10000 miles away from each other.
Solution Concept -
HipLocal wants to expand their existing service, with updated functionality, in new regions to better serve their global customers. They want to hire and train a new team to support these regions in their time zones. They will need to ensure that the application scales smoothly and provides clear uptime data, and that they analyze and respond to any issues that occur.
Existing Technical Environment -
HipLocal's environment is a mix of on-premises hardware and infrastructure running in Google Cloud Platform. The HipLocal team understands their application well, but has limited experience in global scale applications. Their existing technical environment is as follows:
• Existing APIs run on Compute Engine virtual machine instances hosted in GCP.
• State is stored in a single instance MySQL database in GCP.
• Release cycles include development freezes to allow for QA testing.
• The application has no logging.
• Applications are manually deployed by infrastructure engineers during periods of slow traffic on weekday evenings.
• There are basic indicators of uptime; alerts are frequently fired when the APIs are unresponsive.
Business Requirements -
HipLocal's investors want to expand their footprint and support the increase in demand they are seeing. Their requirements are:
• Expand availability of the application to new regions.
• Support 10x as many concurrent users.
• Ensure a consistent experience for users when they travel to different regions.
• Obtain user activity metrics to better understand how to monetize their product.
• Ensure compliance with regulations in the new regions (for example, GDPR).
• Reduce infrastructure management time and cost.
• Adopt the Google-recommended practices for cloud computing.
○ Develop standardized workflows and processes around application lifecycle management.
○ Define service level indicators (SLIs) and service level objectives (SLOs).
Technical Requirements -
• Provide secure communications between the on-premises data center and cloud-hosted applications and infrastructure.
• The application must provide usage metrics and monitoring.
• APIs require authentication and authorization.
• Implement faster and more accurate validation of new features.
• Logging and performance metrics must provide actionable information to be able to provide debugging information and alerts.
• Must scale to meet user demand.
For this question, refer to the HipLocal case study.
A recent security audit discovers that HipLocal’s database credentials for their Compute Engine-hosted MySQL databases are stored in plain text on persistent disks. HipLocal needs to reduce the risk of these credentials being stolen. What should they do?
A. Create a service account and download its key. Use the key to authenticate to Cloud Key Management Service (KMS) to obtain the database credentials.
B. Create a service account and download its key. Use the key to authenticate to Cloud Key Management Service (KMS) to obtain a key used to decrypt the database credentials.
C. Create a service account and grant it the roles/iam.serviceAccountUser role. Impersonate as this account and authenticate using the Cloud SQL Proxy.
D. Grant the roles/secretmanager.secretAccessor role to the Compute Engine service account. Store and access the database credentials with the Secret Manager API.
Show Answer
Correct Answer: D
Explanation: Storing database credentials in plain text on disk is insecure. Google Secret Manager is the recommended service for securely storing and accessing sensitive data such as database passwords. Granting the Compute Engine service account the secretmanager.secretAccessor role allows the application to retrieve credentials securely at runtime without embedding them on disk or downloading service account keys. Options A and B rely on downloaded service account keys, which is against best practices, and option C does not address credential storage.
Question 162
You are building a highly available and globally accessible application that will serve static content to users. You need to configure the storage and serving components. You want to minimize management overhead and latency while maximizing reliability for users. What should you do?
A. 1. Create a managed instance group. Replicate the static content across the virtual machines (VMs) 2. Create an external HTTP(S) load balancer. 3. Enable Cloud CDN, and send traffic to the managed instance group.
B. 1. Create an unmanaged instance group. Replicate the static content across the VMs. 2. Create an external HTTP(S) load balancer 3. Enable Cloud CDN, and send traffic to the unmanaged instance group.
C. 1. Create a Standard storage class, regional Cloud Storage bucket. Put the static content in the bucket 2. Reserve an external IP address, and create an external HTTP(S) load balancer 3. Enable Cloud CDN, and send traffic to your backend bucket
D. 1. Create a Standard storage class, multi-regional Cloud Storage bucket. Put the static content in the bucket. 2. Reserve an external IP address, and create an external HTTP(S) load balancer. 3. Enable Cloud CDN, and send traffic to your backend bucket.
Show Answer
Correct Answer: D
Explanation: The requirement is to serve static content with minimal management overhead, low latency, and high global availability. Using a Cloud Storage backend bucket eliminates VM management. A multi-regional Standard Cloud Storage bucket provides built-in redundancy across regions, improving reliability and latency for global users compared to a regional bucket. An external HTTP(S) load balancer with Cloud CDN further reduces latency by caching content at edge locations worldwide. This combination best satisfies all requirements.
Question 163
You are developing an application that will handle requests from end users. You need to secure a Cloud Function called by the application to allow authorized end users to authenticate to the function via the application while restricting access to unauthorized users. You will integrate Google Sign-In as part of the solution and want to follow Google-recommended best practices. What should you do?
A. Deploy from a source code repository and grant users the roles/cloudfunctions.viewer role.
B. Deploy from a source code repository and grant users the roles/cloudfunctions.invoker role
C. Deploy from your local machine using gcloud and grant users the roles/cloudfunctions.admin role
D. Deploy from your local machine using gcloud and grant users the roles/cloudfunctions.developer role
Show Answer
Correct Answer: B
Explanation: To securely allow only authorized end users to invoke a Cloud Function via an application using Google Sign-In, you should use IAM-based invocation control. Granting users (or a service account representing the application) the roles/cloudfunctions.invoker role follows Google best practices because it provides the minimum required permission (cloudfunctions.functions.invoke) without excessive privileges. Viewer does not allow invocation, while Admin and Developer grant unnecessary elevated permissions. Deployment method (source repository vs local gcloud) is not the key security factor here, but using IAM with the invoker role is.
Question 164
You are running a containerized application on Google Kubernetes Engine. Your container images are stored in Container Registry. Your team uses CI/CD practices. You need to prevent the deployment of containers with known critical vulnerabilities. What should you do?
A. • Use Web Security Scanner to automatically crawl your application • Review your application logs for scan results, and provide an attestation that the container is free of known critical vulnerabilities • Use Binary Authorization to implement a policy that forces the attestation to be provided before the container is deployed
B. • Use Web Security Scanner to automatically crawl your application • Review the scan results in the scan details page in the Cloud Console, and provide an attestation that the container is free of known critical vulnerabilities • Use Binary Authorization to implement a policy that forces the attestation to be provided before the container is deployed
C. • Enable the Container Scanning API to perform vulnerability scanning • Review vulnerability reporting in Container Registry in the Cloud Console, and provide an attestation that the container is free of known critical vulnerabilities • Use Binary Authorization to implement a policy that forces the attestation to be provided before the container is deployed
D. • Enable the Container Scanning API to perform vulnerability scanning • Programmatically review vulnerability reporting through the Container Scanning API, and provide an attestation that the container is free of known critical vulnerabilities • Use Binary Authorization to implement a policy that forces the attestation to be provided before the container is deployed
Show Answer
Correct Answer: D
Explanation: To prevent deploying containers with known critical vulnerabilities on GKE, you should use image vulnerability scanning and enforce deployment policies. Enabling the Container Scanning API provides automated vulnerability scanning for images in Container Registry. In a CI/CD workflow, programmatically reviewing the vulnerability results via the API allows automated gating. Binary Authorization then enforces that only images with an attestation (confirming no critical vulnerabilities) can be deployed. Web Security Scanner is for running web apps, not container image vulnerabilities, so options A and B are incorrect. Option D best matches automated CI/CD best practices.
Question 165
You have an application deployed in Google Kubernetes Engine (GKE). You need to update the application to make authorized requests to Google Cloud managed services. You want this to be a one-time setup, and you need to follow security best practices of auto-rotating your security keys and storing them in an encrypted store. You already created a service account with appropriate access to the Google Cloud service. What should you do next?
A. Assign the Google Cloud service account to your GKE Pod using Workload Identity.
B. Export the Google Cloud service account, and share it with the Pod as a Kubernetes Secret.
C. Export the Google Cloud service account, and embed it in the source code of the application.
D. Export the Google Cloud service account, and upload it to HashiCorp Vault to generate a dynamic service account for your application.
Show Answer
Correct Answer: A
Explanation: Using Workload Identity is the recommended best practice for GKE to access Google Cloud managed services. It provides a one-time setup, avoids exporting and managing service account keys, stores credentials securely, and supports automatic key rotation. The GKE Pod can securely impersonate the Google Cloud service account without embedding or distributing sensitive credentials.
Question 167
You are developing an application that will store and access sensitive unstructured data objects in a Cloud Storage bucket. To comply with regulatory requirements, you need to ensure that all data objects are available for at least 7 years after their initial creation. Objects created more than 3 years ago are accessed very infrequently (less than once a year). You need to configure object storage while ensuring that storage cost is optimized. What should you do? (Choose two.)
A. Set a retention policy on the bucket with a period of 7 years.
B. Use IAM Conditions to provide access to objects 7 years after the object creation date.
C. Enable Object Versioning to prevent objects from being accidentally deleted for 7 years after object creation.
D. Create an object lifecycle policy on the bucket that moves objects from Standard Storage to Archive Storage after 3 years.
E. Implement a Cloud Function that checks the age of each object in the bucket and moves the objects older than 3 years to a second bucket with the Archive Storage class. Use Cloud Scheduler to trigger the Cloud Function on a daily schedule.
Show Answer
Correct Answer: A, D
Explanation: A bucket-level retention policy of 7 years enforces regulatory compliance by preventing deletion or modification of objects before the retention period expires. A lifecycle policy that transitions objects from Standard Storage to Archive Storage after 3 years optimizes cost for data that is accessed very infrequently while keeping it available for the full retention period.
Question 168
You are developing an application using different microservices that must remain internal to the cluster. You want the ability to configure each microservice with a specific number of replicas. You also want the ability to address a specific microservice from any other microservice in a uniform way, regardless of the number of replicas the microservice scales to. You plan to implement this solution on Google Kubernetes Engine. What should you do?
A. Deploy each microservice as a Deployment. Expose the Deployment in the cluster using a Service, and use the Service DNS name to address it from other microservices within the cluster.
B. Deploy each microservice as a Deployment. Expose the Deployment in the cluster using an Ingress, and use the Ingress IP address to address the Deployment from other microservices within the cluster.
C. Deploy each microservice as a Pod. Expose the Pod in the cluster using a Service, and use the Service DNS name to address the microservice from other microservices within the cluster.
D. Deploy each microservice as a Pod. Expose the Pod in the cluster using an Ingress, and use the Ingress IP address to address the Pod from other microservices within the cluster.
Show Answer
Correct Answer: A
Explanation: Each microservice needs configurable replicas and stable internal addressing. A Deployment manages replica count and rolling updates. A Service provides a stable virtual IP and DNS name that load-balances traffic across all replicas, allowing other microservices to reach it uniformly inside the cluster. Ingress is for external HTTP(S) access, and standalone Pods do not support scaling.
Question 169
You are building an application that uses a distributed microservices architecture. You want to measure the performance and system resource utilization in one of the microservices written in Java. What should you do?
A. Instrument the service with Cloud Profiler to measure CPU utilization and method-level execution times in the service.
B. Instrument the service with Debugger to investigate service errors.
C. Instrument the service with Cloud Trace to measure request latency.
D. Instrument the service with OpenCensus to measure service latency, and write custom metrics to Cloud Monitoring.
Show Answer
Correct Answer: A
Explanation: The goal is to measure performance and system resource utilization inside a Java microservice. Cloud Profiler is designed for this purpose: it provides low‑overhead, continuous profiling of CPU usage, memory, and method‑level execution times in production services. Debugger is for inspecting code state, Cloud Trace focuses on request latency across services, and OpenCensus is mainly for distributed tracing and custom metrics rather than detailed CPU/method profiling.
Question 170
You are planning to add unit tests to your application. You need to be able to assert that published Pub/Sub messages are processed by your subscriber in order. You want the unit tests to be cost-effective and reliable. What should you do?
A. Implement a mocking framework.
B. Create a topic and subscription for each tester.
C. Add a filter by tester to the subscription.
D. Use the Pub/Sub emulator.
Show Answer
Correct Answer: D
Explanation: Using the Pub/Sub emulator allows you to run unit tests locally without incurring cloud costs, making it cost-effective. The emulator provides a controlled and deterministic environment, which is well suited for unit tests where you need reliable behavior and the ability to assert message ordering. The other options either add cost, operational overhead, or are more appropriate for integration testing rather than unit testing.
Question 171
You have an application deployed in Google Kubernetes Engine (GKE) that reads and processes Pub/Sub messages. Each Pod handles a fixed number of messages per minute. The rate at which messages are published to the Pub/Sub topic varies considerably throughout the day and week, including occasional large batches of messages published at a single moment.
You want to scale your GKE Deployment to be able to process messages in a timely manner. What GKE feature should you use to automatically adapt your workload?
A. Vertical Pod Autoscaler in Auto mode
B. Vertical Pod Autoscaler in Recommendation mode
C. Horizontal Pod Autoscaler based on an external metric
D. Horizontal Pod Autoscaler based on resources utilization
Show Answer
Correct Answer: C
Explanation: The workload needs to scale based on the backlog or publish rate of Pub/Sub messages, which is external to the pods themselves. Horizontal Pod Autoscaler with an external metric (such as number of undelivered Pub/Sub messages from Cloud Monitoring) allows scaling replicas according to message volume, handling bursty traffic. Resource-based HPA only reacts to CPU/memory usage, and Vertical Pod Autoscaler adjusts pod resources rather than replica count, so they do not address timely processing of variable message rates.
$19
Get all 357 questions with detailed answers and explanations
Instant download HTML + PDF delivered the moment payment clears.
Secure Stripe checkout we never see or store your card details.
7-day refund if files are defective see our refund policy.