Professional Cloud Developer Free Practice Questions — Page 9
Question 81
You recently deployed an application to GKE where Pods are writing files to a Compute Engine persistent disk. You have created a PersistentVolumeClaim (PVC) and a PersistentVolume (PV) object on Kubernetes for the disk, and you reference the PVC in the deployment manifest file.
You recently expanded the size of the persistent disk because the application has used up almost all of the disk space. You have logged on to one of the Pods, and you notice that the disk expansion is not visible in the container file system. What should you do?
A. Set the spec.capacity.storage value of the PV object to match the size of the persistent disk. Apply the updated configuration by using kubectl.
B. Recreate the application Pods by running the kubectl delete deployment DEPLOYMENT_NAME && kubectl apply deployment.yaml command, where the DEPLOYMENT_NAME parameter is the name of your deployment and deployment.yaml is its manifest file.
C. Set the spec.resources.requests.storage value of the PVC object to match the size of the persistent disk. Apply the updated configuration by using kubectl.
D. In the Pod, resize the disk partition to the maximum value by using the fdisk or parted utility.
Show Answer
Correct Answer: C
Explanation: After expanding the underlying Compute Engine persistent disk, Kubernetes must also be told that the claim requests the larger size. Updating spec.resources.requests.storage on the PersistentVolumeClaim triggers Kubernetes volume expansion (when supported by the StorageClass/CSI driver), including filesystem resize. Manually editing the PV capacity is not the correct workflow, recreating Pods alone does not request a larger volume, and manually resizing partitions inside the Pod is not the Kubernetes-managed solution.
Question 82
You are developing a flower ordering application. Currently you have three microservices:
• Order Service (receives the orders)
• Order Fulfillment Service (processes the orders)
• Notification Service (notifies the customer when the order is filled)
You need to determine how the services will communicate with each other. You want incoming orders to be processed quickly and you need to collect order information for fulfillment. You also want to make sure orders are not lost between your services and are able to communicate asynchronously. How should the requests be processed?
A.
B.
C.
D.
Show Answer
Correct Answer: D
Explanation: Use asynchronous messaging with Pub/Sub between microservices so the Order Service can acknowledge requests quickly while decoupling processing. Persist fulfillment data in a database (such as Firestore) for the Order Fulfillment Service, then publish another Pub/Sub event to trigger the Notification Service. This provides reliable, asynchronous communication and reduces the risk of losing orders.
Question 83
You are monitoring a web application that is written in Go and deployed in Google Kubernetes Engine. You notice an increase in CPU and memory utilization. You need to determine which function is consuming the most CPU and memory resources. What should you do?
A. Add print commands to the application source code to log when each function is called, and redeploy the application.
B. Create a Cloud Logging query that gathers the web application s logs. Write a Python script that calculates the difference between the timestamps from the beginning and the end of the application's longest functions to identify time-intensive functions.
C. Import OpenTelemetry and Trace export packages into your application, and create the trace provider. Review the latency data for your application on the Trace overview page, and identify which functions cause the most latency.
D. Import the Cloud Profiler package into your application, and initialize the Profiler agent. Review the generated flame graph in the Google Cloud console to identify time-intensive functions.
Show Answer
Correct Answer: D
Explanation: Cloud Profiler is designed to continuously profile CPU and memory usage in production applications, including Go applications running on Google Kubernetes Engine. After importing and initializing the Cloud Profiler agent, you can use the generated flame graphs to identify which functions consume the most CPU time and memory. Cloud Trace focuses on request latency rather than CPU/memory consumption, while logging or print statements cannot accurately profile resource usage.
Question 84
You are a developer at a social media company. The company runs their social media website on-premises and uses MySQL as a backend to store user profiles and user posts. Your company plans to migrate to Google Cloud, and your learn will migrate user profile information to Firestore. You are tasked with designing the Firestore collections. What should you do?
A. Create one root collection for user profiles, and create one root collection for user posts.
B. Create one root collection for user profiles, and create one subcollection for each user's posts.
C. Create one root collection for user profiles, and store each user's post as a nested list in the user profile document.
D. Create one root collection for user posts, and create one subcollection for each user's profile.
Show Answer
Correct Answer: B
Explanation: Firestore is designed for hierarchical document data. A root collection of user profile documents with a posts subcollection under each user is a common and scalable pattern for one-to-many relationships. It avoids document size limits that would arise from embedding all posts in a single profile document, while keeping posts naturally associated with their owner. Separate root collections for profiles and posts are possible in some designs, but for per-user posts, subcollections are the recommended model.
Question 85
You have a web application that publishes messages to Pub/Sub. You plan to build new versions of the application locally and need to quickly test Pub/Sub integration for each new build. How should you configure local testing?
A. In the Google Cloud console, navigate to the API Library, and enable the Pub/Sub API. When developing locally configure your application to call pubsub.googleapis.com.
B. Install the Pub/Sub emulator using gcloud, and start the emulator with a valid Google Project ID. When developing locally, configure your applicat.cn to use the local emulator by exporting the PUBSUB_EMULATOR_HOST variable.
C. Run the gcloud config set api_endpoint_overrides/pubsub https://pubsubemulator.googleapis.com.com/ command to change the Pub/Sub endpoint prior to starting the application.
D. Install Cloud Code on the integrated development environment (IDE). Navigate to Cloud APIs, and enable Pub/Sub against a valid Google Project IWhen developing locally, configure your application to call pubsub.googleapis.com.
Show Answer
Correct Answer: B
Explanation: For local development and rapid testing of Pub/Sub integration, Google Cloud provides the Pub/Sub emulator. Install it with gcloud, start it with a project ID, and configure the application to use the emulator by setting the PUBSUB_EMULATOR_HOST environment variable. This avoids calling the live Pub/Sub service and is the recommended approach for local testing.
Question 86
Your team has created an application that is hosted on a Google Kubemetes Engine (GKE) cluster. You need to connect the application to a legacy REST service that is deployed in two GKE clusters in two different regions. You want to connect your application to the legacy service in a way that is resilient and requires the fewest number of steps. You also want to be able to run probe-based health checks on the legacy service on a separate port. How should you set up the connection? (Choose two.)
A. Use Traffic Director with a sidecar proxy to connect the application to the service.
B. Set up a proxyless Traffic Director configuration for the application.
C. Configure the legacy service's firewall to allow health checks originating from the sidecar proxy.
D. Configure the legacy service's firewall to allow health checks originating from the application.
E. Configure the legacy service's firewall to allow health checks originating from the Traffic Director control plane.
Show Answer
Correct Answer: A, C
Explanation: Traffic Director with an Envoy sidecar is the recommended approach for connecting GKE workloads to legacy services across regions with resilience and support for advanced traffic management. Sidecar-based Traffic Director also supports proxy-based health checking on a separate port. Because the health checks originate from the sidecar proxy, the legacy service's firewall must allow those health-check requests. Proxyless Traffic Director does not provide the same sidecar-based capabilities for this legacy integration scenario.
Question 87
You recently developed an application that monitors a large number of stock prices. You need to configure Pub/Sub to receive a high volume messages and update the current stock price in a single large in-memory database. A downstream service needs the most up-to-date prices in the in-memory database to perform stock trading transactions. Each message contains three pieces or information:
• Stock symbol
• Stock price
• Timestamp for the update
How should you set up your Pub/Sub subscription?
A. Create a pull subscription with exactly-once delivery enabled.
B. Create a push subscription with both ordering and exactly-once delivery turned off.
C. Create a push subscription with exactly-once delivery enabled.
D. Create a pull subscription with both ordering and exactly-once delivery turned off.
Show Answer
Correct Answer: D
Explanation: Use a pull subscription with ordering and exactly-once delivery disabled. The workload only needs the latest stock price, and each message includes a timestamp, so the application can discard stale updates. Ordering adds overhead without providing value here. Exactly-once delivery also adds overhead and is unnecessary because duplicate deliveries can be handled by comparing timestamps. Pull subscriptions are appropriate for high-throughput consumers because they provide flow control and allow the subscriber to manage consumption rate. Push subscriptions do not support exactly-once delivery.
Question 88
You are a cluster administrator for Google Kubernetes Engine (GKE). Your organization’s clusters are enrolled in a release channel. You need to be informed of relevant events that affect your GKE clusters, such as available upgrades and security bulletins. What should you do?
A. Configure cluster notifications to be sent to a Pub/Sub topic.
B. Execute a scheduled query against the google_cloud_release_notes BigQuery dataset.
C. Query the GKE API for available versions.
D. Create an RSS subscription to receive a daily summary of the GKE release notes.
Show Answer
Correct Answer: A
Explanation: Cluster notifications are the GKE feature designed to notify administrators about cluster-related events, including available upgrades, security bulletins, and other important events for clusters enrolled in release channels. Notifications are delivered through a configured Pub/Sub topic. Querying APIs or BigQuery requires polling rather than notifications, and RSS release notes are general documentation updates rather than cluster-specific event notifications.
Question 89
You recently developed an application that monitors a large number of stock prices. You need to configure Pub/Sub to receive messages and update the current stock price in an in-memory database. A downstream service needs the most up-to-date prices in the in-memory database to perform stock trading transactions. Each message contains three pieces or information:
• Stock symbol
• Stock price
• Timestamp for the update
How should you set up your Pub/Sub subscription?
A. Create a push subscription with exactly-once delivery enabled.
B. Create a pull subscription with both ordering and exactly-once delivery turned off.
C. Create a pull subscription with ordering enabled, using the stock symbol as the ordering key.
D. Create a push subscription with both ordering and exactly-once delivery turned off.
Show Answer
Correct Answer: C
Explanation: Use a pull subscription with message ordering enabled and use the stock symbol as the ordering key so updates for each individual stock are processed in publication order. This prevents an older price update from overwriting a newer one for the same symbol. Exactly-once delivery is unnecessary because the application can use the timestamp to ignore stale or duplicate updates, and option A is not appropriate because exactly-once delivery is not supported for push subscriptions.
Question 90
Your company's security team uses Identity and Access Management (IAM) to track which users have access to which resources. You need to create a version control system that can integrate with your security team's processes. You want your solution to support fast release cycles and frequent merges to your main branch to minimize merge conflicts. What should you do?
A. Create a Cloud Source Repositories repository, and use trunk-based development.
B. Create a Cloud Source Repositories repository, and use feature-based development.
C. Create a GitHub repository, mirror it to a Cloud Source Repositories repository, and use trunk-based development.
D. Create a GitHub repository, mirror it to a Cloud Source Repositories repository, and use feature-based development.
Show Answer
Correct Answer: A
Explanation: Cloud Source Repositories integrates natively with Google Cloud IAM, satisfying the requirement to align with IAM-based access management. Trunk-based development is specifically designed for frequent integration into the main branch, enabling fast release cycles and reducing merge conflicts. There is no stated requirement for GitHub, so adding GitHub mirroring introduces unnecessary complexity without improving IAM integration.
$19
Get all 358 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.