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: In Kubernetes on GKE, resizing a persistent disk that is already bound to a Pod requires updating the PersistentVolumeClaim, not the PersistentVolume or the Pod. When volume expansion is supported by the StorageClass, increasing spec.resources.requests.storage on the PVC triggers Kubernetes to expand the underlying persistent disk and make the new capacity available to the filesystem. Updating the PV directly is not supported, recreating Pods alone does not resize the filesystem, and manually resizing partitions inside the container is not the correct or supported approach.
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: Asynchronous, reliable communication is required with no message loss and fast intake. Using a Pub/Sub queue between services decouples them, allows the Order Service to accept requests quickly, ensures durability, and lets the Order Fulfillment and Notification services process events independently and asynchronously.
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: To identify which functions consume the most CPU and memory in a Go application running on GKE, you need continuous, low-overhead profiling. Google Cloud Profiler is designed for this purpose: after importing and initializing the Profiler agent, it collects CPU and memory profiles from production workloads and presents them as flame graphs in the Cloud Console. These flame graphs clearly show which functions are responsible for the highest CPU time and memory usage. The other options rely on logging or tracing, which are not suitable for detailed CPU and memory attribution.
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 optimized for hierarchical, document-based data. User profiles are a natural top-level entity, while posts are owned by and accessed in the context of a user. Modeling posts as a subcollection under each user profile scales well, avoids document size limits, supports efficient queries like "all posts for a user," and prevents unbounded array growth. Separate root collections or nested lists are less aligned with Firestore best practices for access patterns and scalability.
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: Local development and rapid iteration are best supported by using the Pub/Sub emulator. Installing it via gcloud and configuring the application to point to it with the PUBSUB_EMULATOR_HOST environment variable allows testing Pub/Sub interactions without calling the real cloud service, avoiding network latency, quotas, and costs. The other options still rely on the real Pub/Sub service or incorrect endpoint configuration.
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: Using Traffic Director with a sidecar proxy provides a resilient, multi-region service mesh solution that can route traffic across GKE clusters with minimal application changes. Sidecar proxies support advanced traffic management and allow probe-based health checks on a separate port. To enable those health checks, the legacy service’s firewall must allow health check traffic originating from the sidecar proxy, not from the application itself or the Traffic Director control plane.
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: A
Explanation: The key requirement is handling a very high message volume while safely updating a single in-memory database with the latest stock prices. Duplicate message delivery would cause unnecessary reprocessing and could overwrite newer prices with older ones, so exactly-once delivery is important. In Google Cloud Pub/Sub, exactly-once delivery is supported only for pull subscriptions (including StreamingPull), not for push subscriptions. Message ordering is not required because each update includes a timestamp and the system only needs the most recent value per stock symbol. Therefore, a pull subscription with exactly-once delivery enabled is the correct configuration.
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: GKE provides built-in cluster notifications that publish events such as available upgrades, security bulletins, and other cluster-relevant changes to a Pub/Sub topic. This is the supported and recommended way to be proactively informed about events affecting clusters enrolled in release channels. The other options either require manual polling or provide general release information rather than cluster-specific, actionable 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: Updates for the same stock must be applied in order so that an older price does not overwrite a newer one. Pub/Sub message ordering with the stock symbol as the ordering key guarantees per-symbol ordering while still allowing parallelism across symbols. Exactly-once delivery is unnecessary because later updates supersede earlier ones, and pull subscriptions are commonly used for controlled processing into an in-memory store.
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: The security team uses IAM, which integrates natively with Cloud Source Repositories, allowing fine‑grained access control and auditing without extra synchronization. The requirement for fast release cycles and frequent merges to the main branch directly aligns with trunk‑based development. Introducing GitHub and mirroring adds unnecessary complexity and weaker IAM integration without improving the stated goals.
$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.