Courseiva
Google Cloud Products and ServiceshardMultiple ChoiceObjective-mapped

Cloud Digital Leader Google Cloud Products and Services Practice Question

A company uses Cloud Functions to process image uploads. Each image triggers a function that uses Vision API to extract text and stores results in Firestore. The function sometimes fails due to timeout when images are large. How should they redesign for reliability and scale?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use Cloud Tasks with Cloud Run to process images asynchronously

Cloud Functions has a timeout limit (9 minutes max for gen2). For long-running operations, use Cloud Run or migrate processing to a queue. Cloud Tasks with Cloud Run decouples and allows async processing with longer timeouts.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use Cloud Tasks with Cloud Run to process images asynchronously

    Why this is correct

    Cloud Tasks decouples the image processing workload from the Cloud Function trigger, immediately returning a response to the client. Each upload is enqueued as a task that Cloud Run processes asynchronously, allowing you to configure timeouts up to 60 minutes or more. Cloud Run also scales to zero when idle, so you only pay for the processing time, and Cloud Tasks provides automatic retries for transient failures.

  • Use Cloud Scheduler to trigger the function every minute

    Why it's wrong here

    Cloud Scheduler is designed for time-based cron jobs, not event-driven request processing. Even with a trigger every minute, your function still has to process each individual upload within its own execution timeout, so the underlying problem persists. You'd also need to build a separate queue or state store to track which images are pending, adding latency and operational complexity.

  • Increase the function timeout to 60 minutes

    Why it's wrong here

    The maximum timeout for a Cloud Functions gen2 function is 9 minutes (540 seconds); 60 minutes is not an accepted value. Furthermore, even if you could set a longer timeout, holding an execution instance open for an hour is inefficient and costly, as you're paying for compute while waiting. This approach doesn't leverage asynchronous processing and can introduce cold-start or resource-limit issues.

  • Use Compute Engine VMs with startup scripts

    Why it's wrong here

    Compute Engine VMs require you to manage the instance lifecycle, including startup scripts, patching, and autoscaling rules to handle varying upload volumes. The VMs would need to poll for new images, and you'd incur costs even when idle, since VM instances typically run continuously. This adds significant operational overhead compared to a serverless solution that scales automatically and you only pay for the time actually spent processing.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

Courseiva writes every GCDL question from scratch — 829 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This GCDL practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the GCDL exam.