Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
You are building an event-driven application on Cloud Run in us-central1 that requires authenticated invocations and parses all incoming payloads using a CloudEvents SDK. Your service must react to two event sources:
orders collection, excluding nested subcollections.You want to minimize latency and operational overhead while ensuring both sources deliver events in a standardized CloudEvents format.
Which Eventarc configuration should you implement?
us-central1 associated with a service account that has the roles/run.invoker role: create a direct Cloud Firestore trigger with --event-filters-path-pattern="document=orders/*", and create a Pub/Sub trigger (type=google.cloud.pubsub.topic.v1.messagePublished) for the custom application's topic.Eventarc Standard is a serverless, fully managed eventing service that asynchronously routes state-change events from Google Cloud services and custom applications to destinations like Cloud Run. Regardless of the provider, Eventarc delivers every event to Cloud Run as an HTTP request in CloudEvents binary content mode, providing consistent metadata headers and payloads that a CloudEvents SDK can parse uniformly.
--event-filters-path-pattern. Using the single-segment wildcard orders/* matches only documents directly inside the orders collection while excluding nested subcollections.type=google.cloud.pubsub.topic.v1.messagePublished wraps those messages in the CloudEvents format before invoking Cloud Run.roles/run.invoker authorizes Eventarc to invoke the private Cloud Run service securely.us-central1 matches the Cloud Run service region and avoids cross-region latency, while direct Firestore events deliver faster than audit-log-based triggers.roles/run.invoker avoids overly permissive default identities.This design combines direct Google source routing for Cloud Firestore with Pub/Sub-backed Eventarc routing for custom workloads. Compared to Cloud Audit Logs, Eventarc Advanced, or raw Pub/Sub push subscriptions, it is the only configuration that supports Cloud Firestore direct events, excludes subcollections accurately, and delivers standardized CloudEvents to an authenticated Cloud Run service.
global using the Compute Engine default service account: create a direct Cloud Firestore trigger with --event-filters-path-pattern="document=orders/**", and create a Pub/Sub trigger using --event-filters with a regular expression to filter custom application message attributes.This option creates Eventarc Standard triggers in the global location using the Compute Engine default service account, attempts to isolate top-level Firestore documents with orders/**, and tries to filter custom Pub/Sub messages using a regular expression inside --event-filters.
orders/** is a multi-segment wildcard that matches both top-level documents in orders and any documents inside nested subcollections. Only orders/* restricts matches to direct children of the orders collection.--event-filters flag supports exact matches only and does not accept regular expressions or wildcards. Any trigger configured with a regex in --event-filters will fail validation or fail to match events as intended.global instead of us-central1 introduces potential performance and data residency issues when the Cloud Run service is regional. Additionally, relying on the Compute Engine default service account can violate least-privilege security or fail authenticated invocations depending on organization policies.us-central1).--event-filters-path-pattern supports * and ** path wildcards; standard --event-filters requires exact attribute values.roles/run.invoker is the recommended identity for authenticated Cloud Run targets.No such configuration is valid in Eventarc Standard because regular expressions are never supported in --event-filters, and orders/** would only be appropriate if nested subcollections were meant to be included.
Note that after an Eventarc trigger is created, its event type and source filters cannot be modified in place—fixing an incorrect filter like orders/** requires creating a new trigger and deleting the old one.
type=google.cloud.audit.log.v1.written) filtering Firestore updates via --event-filters="resourceName=orders/*", and configure a direct Pub/Sub push subscription to invoke the Cloud Run endpoint for the custom application.This option attempts to capture Cloud Firestore changes indirectly by listening to Cloud Audit Logs entries (google.cloud.audit.log.v1.written) using a standard --event-filters flag, while bypassing Eventarc altogether for the custom microservice by using a direct Pub/Sub push subscription to send messages straight to Cloud Run.
--event-filters flags perform exact matches only and do not support wildcards or regular expressions. Passing orders/* to --event-filters will fail to match documents dynamically; path pattern wildcards require the --event-filters-path-pattern flag.Your Google Cloud source did not support direct Eventarc events (requiring Cloud Audit Logs with a proper --event-filters-path-pattern flag) and your custom application only needed raw Pub/Sub push payloads without CloudEvents standardization.
Whenever a Google Cloud provider supports both direct events and Cloud Audit Logs events, using direct events is recommended for faster responsiveness, predictable strong typing, and lower cost.
us-central1, configure an enrollment using a Common Expression Language (CEL) filter matching orders/** for direct Cloud Firestore events, and publish custom application events via the Eventarc Publishing API to a pipeline targeting Cloud Run.Eventarc Advanced introduces a centralized bus, enrollments driven by Common Expression Language (CEL) expressions, and pipelines that can transform and route events from many providers—including direct publishers using the Eventarc Publishing API—to destinations such as Cloud Run.
orders/** uses the multi-segment wildcard (**), which matches zero or more path segments. That means it would capture updates in nested subcollections (such as orders/123/items/456), violating the requirement to process only top-level orders documents.**) match across nested hierarchy levels, whereas single-segment wildcards (*) stay within one collection level.You were routing events exclusively from supported Eventarc Advanced Google providers (such as AlloyDB or API Gateway) alongside custom publishers using the Eventarc Publishing API, and you intentionally wanted to capture nested subcollections or transform payloads before delivery.
Choosing between Eventarc Standard and Eventarc Advanced depends on both routing complexity and supported event providers. For Cloud Firestore and Pub/Sub integrations on Cloud Run, Eventarc Standard is required.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated