Question 328 of 1,000
Google Cloud products, services, and solutionseasyMultiple ChoiceObjective-mapped

Serverless Function Execution on Google Cloud: Cloud Functions vs Cloud Run

This GCDL practice question tests your understanding of google cloud products, services, and solutions. Read the scenario carefully and evaluate each option against the stated constraints before committing to an answer. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A company wants to enable its developers to write and run code in various programming languages (Python, Node.js, Go) without provisioning or managing any servers. The code should execute in response to HTTP requests. Which Google Cloud product is designed for this serverless, function-level execution model?

Quick Answer

The answer is Cloud Functions, which is the correct choice because it is Google Cloud’s event-driven, serverless compute platform designed specifically for function-level execution. Unlike Cloud Run, which runs entire containerized applications, Cloud Functions allows developers to write and deploy single-purpose code in Python, Node.js, or Go that executes directly in response to HTTP requests, with automatic scaling and zero server management. On the Google Cloud Digital Leader exam, this question tests your ability to distinguish between serverless compute services—a common trap is confusing Cloud Run’s container model with Cloud Functions’ function-level model, but remember that Cloud Functions is the only product purpose-built for running discrete code snippets triggered by events or HTTP calls. A helpful memory tip: think “Functions for functions”—if the requirement is to run a small piece of code without worrying about containers or servers, Cloud Functions is your answer.

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

Cloud Functions, which executes code functions in response to events or HTTP requests with no server management required

Cloud Functions is the correct choice because it is Google Cloud's event-driven, serverless compute platform that allows developers to write and deploy single-purpose functions in languages like Python, Node.js, and Go. These functions automatically scale and execute in response to HTTP triggers (e.g., HTTP requests) without any server provisioning or management, directly matching the requirement for a function-level execution model.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • Cloud Functions, which executes code functions in response to events or HTTP requests with no server management required

    Why this is correct

    Cloud Functions is exactly the right fit: serverless, supports multiple languages, triggered by HTTP requests, billed per invocation, scales from zero automatically. Developers focus on writing function code with no infrastructure concerns.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Compute Engine, which provides virtual machines for running code in any language

    Why it's wrong here

    Compute Engine requires provisioning VMs, installing language runtimes, managing OS patches, and handling scaling. It is not serverless and requires significant infrastructure management.

  • Cloud SQL, which runs SQL queries in response to HTTP requests

    Why it's wrong here

    Cloud SQL is a managed relational database service. It stores and queries data; it doesn't execute arbitrary application code or serve HTTP requests.

  • Persistent Disk, which stores code that can be executed on demand

    Why it's wrong here

    Persistent Disk is block storage for VM instances. It stores data but has no code execution capability. Code stored on a Persistent Disk requires a VM to execute it.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Google Cloud often tests the distinction between serverless compute (Cloud Functions) and managed services that still require server management (Compute Engine) or are not compute services at all (Cloud SQL, Persistent Disk), leading candidates to confuse database or storage services with code execution platforms.

Detailed technical explanation

How to think about this question

Cloud Functions uses a stateless execution environment where each function instance is ephemeral and can be scaled to zero when idle. Under the hood, HTTP-triggered functions are exposed via a Cloud Load Balancing endpoint that routes requests to the function runtime, and the function's code is executed in a containerized sandbox (gVisor) for isolation. A real-world scenario is building a lightweight REST API for a mobile app backend where each endpoint is a separate Cloud Function, eliminating the need to manage a full web server like Express.js or Flask.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

An e-commerce site experiences heavy traffic on Black Friday and near-zero traffic during off-peak weeks. Rather than provisioning permanent large VMs, the team uses auto-scaling groups that add capacity automatically under load and reduce it overnight. Questions like this test whether you understand elasticity, availability zones, and cloud compute scaling patterns.

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

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related GCDL practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free GCDL practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this GCDL question test?

Google Cloud products, services, and solutions — This question tests Google Cloud products, services, and solutions — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Cloud Functions, which executes code functions in response to events or HTTP requests with no server management required — Cloud Functions is the correct choice because it is Google Cloud's event-driven, serverless compute platform that allows developers to write and deploy single-purpose functions in languages like Python, Node.js, and Go. These functions automatically scale and execute in response to HTTP triggers (e.g., HTTP requests) without any server provisioning or management, directly matching the requirement for a function-level execution model.

What should I do if I get this GCDL question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more ways this is tested on GCDL

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A developer wants to run a small piece of code that resizes images whenever a new image is uploaded to Cloud Storage. The code runs for less than a second and should only be triggered by the upload event. No always-on server is needed. Which Google Cloud service is ideal?

easy
  • A.A Compute Engine VM that runs continuously, checking for new uploads every minute.
  • B.Cloud Functions triggered by Cloud Storage object creation events.
  • C.Cloud Run with a permanent container that listens for uploads.
  • D.BigQuery scheduled query that processes new uploads daily.

Why B: Cloud Functions is the ideal serverless compute service for event-driven, short-lived tasks like image resizing triggered by Cloud Storage uploads. It automatically scales to zero when idle, charges only for execution time (sub-second in this case), and natively binds to Cloud Storage object creation events via the `google.storage.object.finalize` trigger, eliminating the need for any always-on infrastructure.

Keep practising

More GCDL practice questions

Last reviewed: Jun 30, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

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.