Explore essential concepts of AWS Lambda, including event-driven execution, triggers, resource limits, and integration scenarios, to deepen your understanding of serverless functions. This quiz is designed for those looking to strengthen their knowledge of cloud-based compute services and serverless architecture.
Which of the following can directly trigger an AWS Lambda function to execute in response to an object upload?
Explanation: An object upload to cloud storage can be set as a trigger for a Lambda function, enabling event-driven automation. Logging into a web application does not automatically trigger Lambda unless configured via an authenticated backend. Refreshing a webpage only affects the client and doesn't invoke serverless functions by itself. Virtual machine restarts are unrelated to Lambda triggers and occur independently.
Which programming language is NOT natively supported for writing AWS Lambda functions as of 2024?
Explanation: Rust is not natively supported by the service, though Python, JavaScript, and Go are supported directly without extra configurations. You can run Rust code with custom runtimes, but it is not a built-in option. Python, JavaScript, and Go allow straightforward development and deployment with native support.
How does AWS Lambda handle multiple simultaneous invocations of the same function?
Explanation: Lambda automatically creates separate instances to handle parallel invocations, allowing functions to scale with incoming events. Lambda does not queue all requests serially, making parallel execution possible. Rejecting all but the first request and running only one instance ever would severely limit scalability and are incorrect.
What is the maximum execution time a Lambda function can run before it is forcibly terminated?
Explanation: The service imposes a 15-minute timeout on function execution, after which the function is stopped. Five hours and two days are far beyond permissible limits for such short-lived functions. Thirty seconds is too restrictive since functions can perform more extended tasks within the allowed window.
What must be included in a deployment package when uploading code for a Lambda function that relies on external libraries?
Explanation: A complete deployment package must include both the function code and all required external libraries to ensure the function runs correctly. Uploading only the function code will fail if dependencies are missing. Including just the libraries is not sufficient, and a database backup is unrelated to code execution requirements.
Which is a recommended use for environment variables in AWS Lambda functions?
Explanation: Environment variables are ideal for storing sensitive configuration data like database connection strings, which functions may need at runtime. Storing user passwords in plain text is insecure and not advised. Holding logs should be done in logging systems, not environment variables. Hosting static website files is unrelated to the purpose of environment variables.
In a serverless architecture, which service is commonly used to invoke Lambda functions via HTTP requests?
Explanation: API Gateway is designed to route HTTP requests to Lambda functions, enabling seamless serverless backend APIs. Cloud Monitor tracks resource metrics but doesn't handle HTTP invocation. DNS Resolver manages domain names and does not connect to Lambda, and Object Lifecycle Manager is related to storage management.
What is the maximum amount of memory you can allocate to a Lambda function as of 2024?
Explanation: The current memory allocation limit for Lambda functions is 10,240 MB, which balances between power and cost. 1,024 GB and 32,768 MB are much higher than supported, and 512 KB is far too low for typical workloads, making them incorrect.
Which scenario best demonstrates the pay-per-use billing advantage of using Lambda functions?
Explanation: With Lambda, you incur costs only when functions are executed, such as processing uploads on demand. Running continuous servers, manually managing machine scaling, or paying for reserved capacity do not benefit from pay-per-use pricing. Automatic, event-driven execution models the main advantage.
Which statement about Lambda functions and state is accurate?
Explanation: Lambda functions are designed to be stateless, so data is not preserved after execution ends. They do not save data automatically, nor do they rely on local storage for state. Long execution and permanent data storage are not supported within the function environment.