Google Professional Cloud Developer exam dumps

Google Professional Cloud Developer practice question 259 of 481

Professional Cloud Developer. Professional level, Google Cloud. Free question with the correct answer and a full explanation.

Google Professional Cloud Developer Question 259

Select 3Google Cloud Platform

Your team is experiencing slow build times in a CI/CD pipeline for a Node.js application deployed on Google Cloud. You suspect unnecessary files and dependencies are being included in the build process. What steps can you take to optimize the build and reduce the time it takes?

  1. A

    Use a .gcloudignore file to exclude unnecessary files during the deployment process.

  2. B

    Enable Cloud Build caching to reuse layers from previous builds.

  3. C

    Add all files in your project directory to the build context to ensure completeness.

  4. D

    Use a package manager like npm or yarn to install only production dependencies during the build stage.

  5. E

    Create a custom container image for your application with all dependencies pre-installed.

Show answer and explanation

Correct answers: A, B, D

Explanation

Optimizing builds in a CI/CD pipeline often involves reducing unnecessary files and dependencies, leveraging caching mechanisms, and minimizing the size of the build context. Using a .gcloudignore file, enabling Cloud Build caching, and focusing only on production dependencies are effective ways to achieve this. Avoiding redundant files and dependencies ensures faster and more efficient builds.

  • A. Correct.

    Using a .gcloudignore file helps exclude unnecessary files (e.g., test files, local configuration files) from being uploaded to Google Cloud Build, reducing the build time and improving efficiency.

  • B. Correct.

    Enabling Cloud Build caching allows the reuse of unchanged layers from previous builds, which significantly optimizes build times.

  • C. Incorrect.

    Including all files in the project directory is unnecessary and counterproductive. It increases the build context size, leading to slower build times.

  • D. Correct.

    Installing only production dependencies (using npm or yarn with the '--production' flag) during the build stage ensures that dev dependencies are excluded, reducing the size of the application and improving build speed.

  • E. Incorrect.

    Creating a custom container image can be useful in some cases but is not specific to optimizing the build process in this scenario. It also adds complexity unless absolutely required.

Timed practice exam

Take a Google Professional Cloud Developer practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam