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.
Your team operates a nightly invoice processing system on Google Cloud that uses Cloud Scheduler (0 2 * * *) to trigger a parent workflow in Workflows, which in turn spawns thousands of child workflows. During recent runs, you encountered two reliability issues:
workflowexecutions.googleapis.com, duplicate parent workflow executions are launched.429 Too Many Requests errors, while transient 503 Service Unavailable responses from downstream billing APIs abort workflows prematurely.Which architecture should you implement to resolve these reliability issues?
X-CloudScheduler-JobName and X-CloudScheduler-ScheduleTime, enqueue child workflow invocations in a rate-limited Cloud Tasks queue, and wrap downstream billing calls in Workflows try/retry and try/except blocks.This architecture combines end-to-end request deduplication, rate-controlled task buffering, and workflow-level exception handling to eliminate duplicate triggers, quota exhaustion, and premature step failures across distributed orchestrations.
workflowexecutions.googleapis.com directly, the API ignores Cloud Scheduler's headers and starts a new execution on every retry. Placing a Cloud Run idempotent proxy in front of the Workflows API allows the handler to read X-CloudScheduler-JobName and X-CloudScheduler-ScheduleTime, hash them into a unique run_id, and perform an atomic Firestore transaction with a lease and TTL policy to guarantee only one parent run starts per scheduled interval.max_dispatches_per_second buffers bursts and regulates execution concurrency within safe quota boundaries.try/retry blocks automatically retries transient 503 errors with exponential backoff, while try/except blocks capture persistent failures for graceful recovery.Unlike relying on upstream triggers alone or firing unthrottled parallel calls, this layered design addresses each failure domain at the exact layer responsible—deduplication at the ingress proxy, rate limiting in Cloud Tasks, and step-level resilience inside Workflows.
X-CloudScheduler-ScheduleTime as a sequential Cloud Tasks task name, dispatch all child workflows at maximum queue throughput, and allow unhandled 503 errors in child workflows to trigger a full Cloud Scheduler retry.This pattern attempts to use Cloud Tasks named-task deduplication with timestamp-based names, pushes child workflows at unrestricted queue throughput, and propagates child 503 errors upward hoping Cloud Scheduler will re-run the entire batch.
X-CloudScheduler-ScheduleTime) as explicit Cloud Tasks names creates hotspotting in task metadata storage, which significantly increases latency and error rates. Best practices require a well-distributed prefix, such as a content hash.429 Too Many Requests quota errors and overwhelming downstream billing services.2xx, Cloud Scheduler's job is complete; unhandled 503 exceptions in asynchronous child workflows will not cause Cloud Scheduler to retry, and restarting an entire parent batch for one transient step failure wastes compute and risks duplicate processing.max_dispatches_per_second removes the primary protection against quota throttling.Task names used a hashed prefix for short-window deduplication, the queue enforced strict dispatch rate limits, and individual tasks handled their own retries cleanly rather than relying on an upstream scheduler.
workflowexecutions.googleapis.com directly with retryCount set to 0 and an extended attemptDeadline, launch child workflows using a Workflows parallel step, and rely on built-in Workflows connector retries for all downstream billing API calls.This configuration attempts to avoid duplicate runs by disabling Cloud Scheduler retries entirely, uses Workflows' native parallel execution syntax to fan out child workflows immediately, and depends on default connector retry behavior for error recovery.
retryCount to 0 eliminates automatic recovery if a transient network glitch or API blip prevents the initial 0 2 * * * trigger from reaching Workflows, causing missed nightly billing runs. Furthermore, direct calls to *.googleapis.com endpoints do not inspect X-CloudScheduler-JobName or X-CloudScheduler-ScheduleTime, offering no built-in deduplication.parallel step spawns concurrent branches simultaneously without external rate limiting. Launching thousands of child workflows in parallel immediately saturates the concurrent active executions quota, triggering 429 Too Many Requests failures.http.post or http.request calls require explicit try/retry policies and try/except blocks.parallel loops lack queue-based dispatch rate controls (max_dispatches_per_second).The workload only ran a small, fixed number of parallel branches well below Workflows concurrency limits, called exclusively Google Cloud APIs via connectors, and could tolerate skipping an entire nightly run rather than risking a retry.
every 24 hours targeting a Pub/Sub topic with an Eventarc trigger, rely on Eventarc's exponential backoff retry policy to recover from failed child workflow steps, and use sys.sleep loops inside Workflows to wait out downstream 503 errors.This design replaces a cron-based HTTP trigger with an interval-based Pub/Sub event routed through Eventarc, attempts to delegate workflow step failures to Eventarc's delivery retry policy, and uses sys.sleep polling inside Workflows to handle service unavailability.
unix-cron (0 2 * * *) to every 24 hours causes schedule drift over time and omits the deterministic X-CloudScheduler-ScheduleTime header needed for reliable deduplication, while Pub/Sub's at-least-once delivery can still deliver duplicate events.try/retry blocks with manual sys.sleep loops consumes additional workflow step quotas without exponential backoff with jitter, and it does nothing to prevent 429 Too Many Requests errors when spawning thousands of child workflows.sys.sleep enforce per-second dispatch limits on child workflows.2:00 AM.The goal were loosely coupled event choreography where a fixed daily time is unnecessary, and retry policies only needed to protect initial event delivery to a stateless HTTP handler rather than multi-step workflow execution.
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