Google Professional Cloud Developer exam dumps

Google Professional Cloud Developer practice question 345 of 481

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

Google Professional Cloud Developer Question 345

Single answerGoogle Cloud Platform

You are developing a serverless application using Google Cloud Functions. The application needs to automatically process new images uploaded to a Cloud Storage bucket by resizing them. Which trigger option should you use to invoke the function when a file is uploaded to the bucket?

  1. A

    Cloud Pub/Sub trigger

  2. B

    Cloud Storage trigger

  3. C

    HTTP trigger

  4. D

    Cloud Scheduler trigger

Show answer and explanation

Correct answer: B

Explanation

The Cloud Storage trigger is the best choice for this scenario because it directly listens for events, such as file uploads to a Cloud Storage bucket, and automatically invokes the function. This eliminates the need for additional components like Pub/Sub or HTTP triggers, making the implementation simpler and more efficient.

  • A. Incorrect.

    A Cloud Pub/Sub trigger is used for messaging between services. While you could publish a message to a topic when a file is uploaded and then trigger a function, it is not the most direct or efficient approach for this use case.

  • B. Correct.

    A Cloud Storage trigger is specifically designed to invoke Cloud Functions when events occur in a Cloud Storage bucket, such as file uploads. This is the correct option for this scenario.

  • C. Incorrect.

    An HTTP trigger is used to invoke a function via HTTP requests. It would require additional setup (e.g., creating a trigger for uploads) and is not the best choice for processing events directly from Cloud Storage.

  • D. Incorrect.

    A Cloud Scheduler trigger is for scheduling tasks to run at specific times or intervals. It cannot be used to trigger functions based on Cloud Storage events like file uploads.

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