20+ practice questions focused on Building and testing applications — one of the most tested topics on the Google Professional Cloud Developer exam. Each question includes a detailed explanation so you learn why the right answer is correct.
Start Building and testing applications PracticeA team is developing a microservice that processes messages from Pub/Sub. The service is deployed on Cloud Run and uses Cloud Firestore to store processed data. During load testing, the service frequently fails with 'DeadlineExceeded' errors from Firestore. What is the most likely cause and best practice to fix it?
Explanation: The 'DeadlineExceeded' error is raised by the Firestore client-side SDK when the operation exceeds its default timeout (e.g., 60 seconds). However, the underlying cause in this Cloud Run environment is that the default Cloud Run request timeout (5 minutes) is too short for the entire processing pipeline, causing the container to be terminated before the Firestore operation completes. When the container is terminated, the pending Firestore request fails with 'DeadlineExceeded'. Increasing the Cloud Run request timeout prevents premature termination, allowing the Firestore operation to finish within the container's lifetime. This is the most direct fix, as it addresses the infrastructure timeout that triggers the client-side error.
Your team has developed a containerized application that processes streaming data from Pub/Sub. The application is deployed on Cloud Run. Under normal load, it processes messages within seconds. However, during spikes, processing time increases and some messages are not acknowledged before the Cloud Run request timeout of 60 minutes. You need to ensure that all messages are processed reliably without losing data. You have the following options: A) Increase the Cloud Run request timeout to 120 minutes. B) Use Cloud Run jobs instead of services to handle the processing asynchronously. C) Set up a second subscription to Pub/Sub with a different push endpoint to parallelize processing. D) Use a Cloud Tasks queue to decouple the Pub/Sub push and process messages with retries. Which option should you choose?
Explanation: Cloud Run jobs are designed for asynchronous, batch-style processing that can run longer than the 60-minute request timeout of Cloud Run services. By using a job, you can pull messages from Pub/Sub, process them without a hard timeout, and acknowledge them only after successful processing, ensuring reliable message handling during spikes.
You are a Cloud Developer working for an e-commerce company. The company uses Cloud Build to build and deploy a Python application to App Engine standard environment. The application uses Cloud SQL for its database. The team recently updated the application code and added a new dependency. The build succeeds, but the deployment fails with 'Error Response: [9] Application startup error!' You check the logs and see 'ImportError: No module named requests'. The team uses a requirements.txt file. However, the requirements.txt file has been configured correctly in the past. The team also uses a custom runtime config in app.yaml with a 'entrypoint' field. They did not change any configuration files. What is the most likely cause of this error?
Explanation: The error 'ImportError: No module named requests' indicates that the dependency was not installed. In App Engine standard, when using 'runtime: python27', dependencies listed in requirements.txt are not automatically installed; you must use a third-party library or vendor them manually. Since the team uses a custom entrypoint in app.yaml, this does not override the runtime's default behavior for Python 2.7, which does not support automatic dependency installation from requirements.txt.
A company is developing a microservices application on Google Cloud. Each service is deployed as a Docker container on Cloud Run. The development team wants to ensure that inter-service communication is encrypted and authenticated. What is the best approach?
Explanation: Cloud Run automatically provisions TLS certificates for all incoming requests and supports IAM-based authentication for internal requests between services in the same Google Cloud project. This means inter-service communication is encrypted by default via HTTPS and can be authenticated by configuring the receiving service to require a valid IAM token from the caller, without any additional infrastructure or sidecar proxies.
A developer is designing a CI/CD pipeline for a Node.js application hosted on Cloud Run using Cloud Build. The pipeline should run unit tests, build the container, push to Artifact Registry, and deploy to Cloud Run. The developer wants to minimize build time by caching dependencies. What is the recommended approach?
Explanation: Cloud Build supports built-in caching via persistent volumes (e.g., `/cache` or `/workspace`) that can store `node_modules` across builds. By configuring a cache volume in the `cloudbuild.yaml` and using `npm ci --prefer-offline`, the pipeline avoids re-downloading dependencies on every run, significantly reducing build time for Node.js applications on Cloud Run.
+15 more Building and testing applications questions available
Practice all Building and testing applications questions1. Baseline your knowledge
Start with 10 questions to gauge your current understanding of Building and testing applications. This tells you whether you need a concept refresher or just practice.
2. Review every explanation
For each question — right or wrong — read the full explanation. Understanding why an answer is correct is more valuable than knowing the answer itself.
3. Focus on exam traps
Building and testing applications questions on the PCD frequently use trap wording. Look for subtle differences in answers that test your precision, not just general knowledge.
4. Reach 80% consistently
Do repeated sessions until you score 80%+ three times in a row. Then move to mixed-mode practice to test cross-topic recall under realistic conditions.
The exact number varies per candidate. Building and testing applications is tested as part of the Google Professional Cloud Developer blueprint. Practicing with targeted Building and testing applications questions ensures you can handle any format or difficulty that appears.
Yes. Courseiva provides free PCD practice questions across all exam topics and domains. The platform includes topic-based practice, mock exams, missed-question review, bookmarked questions, and readiness tracking — no account required.
Difficulty is subjective, but Building and testing applications is a high-priority exam concept tested in multiple ways — direct recall, scenario analysis, and command-output interpretation. Consistent practice is the best way to build confidence.
Launch a full Building and testing applications practice session with instant scoring and detailed explanations.
Start Building and testing applications Practice →