
Answer-first summary for fast verification
Answer: Use Cloud Storage to cache intermediate artifacts.
The goal is to reduce build time while minimizing cost and development effort in Cloud Build. Option A is optimal because caching intermediate artifacts in Cloud Storage avoids redundant rebuilds of dependencies, directly cutting build time. This leverages Cloud Build's native integration with Cloud Storage, requiring minimal configuration (e.g., specifying a cache bucket in `cloudbuild.yaml`), thus aligning with low cost and effort. Option B introduces Jenkins, an external tool, increasing complexity, maintenance, and potential costs—contradicting the effort-minimization goal. Option C (smaller build steps) may not inherently reduce time without parallelization and could add overhead. Option D (larger VMs) reduces time but escalates costs significantly due to higher per-minute pricing for larger machines, violating cost-minimization requirements.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
How can you optimize build time in Cloud Build while minimizing costs and development effort for your application?
A
Use Cloud Storage to cache intermediate artifacts.
B
Run multiple Jenkins agents to parallelize the build.
C
Use multiple smaller build steps to minimize execution time.
D
Use larger Cloud Build virtual machines (VMs) by using the machine-type option.