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.
Which method allows you to deploy a function to Google Cloud Functions using a local source code directory?
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.
What is an example of an event that can trigger a cloud function to execute?
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.
Which runtime environment can be selected when creating a new cloud function?
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.
How do cloud functions automatically scale in response to incoming requests or events?
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.
Which is a default limitation for a single invocation of a cloud function?
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.