Google Cloud Functions Basics Quiz Quiz

Discover essential concepts of Google Cloud Functions, including deployment, triggers, runtime environments, and limitations. This quiz helps you assess your knowledge of core features and functionalities relevant to event-driven, serverless computing.

  1. Deployment Methods

    Which method allows you to deploy a function to Google Cloud Functions using a local source code directory?

    1. Directly editing source files online
    2. Uploading a compiled binary
    3. Adding function code in a spreadsheet
    4. Deploying via local directory upload

    Explanation: Deploying via local directory upload is the standard approach, where the local codebase is packaged and sent to the platform for deployment. Directly editing source files online is not a supported deployment method for complete functions; usually, changes are made locally. Uploading a compiled binary is not applicable, as functions are typically deployed as source code. Adding function code in a spreadsheet is not related to cloud function deployment and is an invalid option.

  2. Triggers

    What is an example of an event that can trigger a cloud function to execute?

    1. A new file being uploaded to cloud storage
    2. Typing text into a website search bar
    3. A spreadsheet formula recalculating
    4. Downloading a file to a local folder

    Explanation: A new file being uploaded to cloud storage is a classic trigger for serverless functions, initiating code execution based on storage events. Spreadsheet formula recalculation and typing into a search bar occur outside the supported trigger sources. Downloading a file to a local folder is not monitored by cloud functions, so it cannot act as a trigger.

  3. Supported Runtimes

    Which runtime environment can be selected when creating a new cloud function?

    1. COBOL
    2. Visual Basic
    3. Node.js
    4. Pascal

    Explanation: Node.js is a widely supported runtime option for cloud functions, allowing you to write serverless code in JavaScript or TypeScript. Visual Basic, COBOL, and Pascal are not supported runtimes for deploying such cloud functions, even though they are programming languages. Only Node.js correctly matches the supported options provided by the platform.

  4. Function Scalability

    How do cloud functions automatically scale in response to incoming requests or events?

    1. By creating new instances as needed
    2. By requiring manual scaling through configuration
    3. By increasing hard drive size
    4. By permanently keeping maximum resources allocated

    Explanation: Cloud functions scale automatically by creating more instances of the function in response to higher demand, ensuring responsiveness to events. Increasing hard drive size is unrelated to automatic scaling. Manual scaling is typically not required, making that option incorrect. Keeping maximum resources always allocated counters the serverless concept of allocating resources only when needed.

  5. Resource Limitations

    Which is a default limitation for a single invocation of a cloud function?

    1. No limits on concurrent executions
    2. Unlimited memory usage
    3. Unlimited network bandwidth
    4. Maximum execution time

    Explanation: Cloud functions have a maximum execution time per invocation, after which they are forcibly stopped. They do not allow unlimited memory usage or network bandwidth; limits are enforced for both. There are also restrictions on concurrent executions, so stating there are no limits is incorrect. The only correct answer is the presence of a maximum execution time.