0
0
AWScloud~20 mins

Lambda pricing model in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Lambda Pricing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding AWS Lambda Pricing Components

Which of the following factors directly affect the cost of running an AWS Lambda function?

AThe number of requests and the duration of each execution measured in milliseconds.
BThe size of the deployment package and the number of environment variables used.
CThe number of concurrent executions and the size of the Lambda function's memory allocation.
DThe AWS region and the number of API Gateway endpoints connected.
Attempts:
2 left
💡 Hint

Think about what AWS charges for when you invoke a Lambda function.

service_behavior
intermediate
2:00remaining
Effect of Memory Allocation on Lambda Cost

You have a Lambda function that runs for 1 second. You increase its memory from 128 MB to 512 MB. How does this change affect the cost per invocation?

AThe cost per invocation doubles because memory increased four times but duration halves.
BThe cost per invocation stays the same because duration is unchanged.
CThe cost per invocation quadruples because memory increased four times.
DThe cost per invocation increases linearly with memory size and duration.
Attempts:
2 left
💡 Hint

Remember that cost depends on both memory size and execution time.

Architecture
advanced
2:00remaining
Optimizing Lambda Cost with Execution Duration

You have a Lambda function that processes data in 2 seconds with 256 MB memory. You optimize the code to run in 1 second but need 512 MB memory to do so. What is the impact on cost per invocation?

ACost remains the same because duration halves and memory doubles.
BCost doubles because memory doubles despite duration halving.
CCost halves because duration halves despite memory doubling.
DCost quadruples because memory doubles and duration halves.
Attempts:
2 left
💡 Hint

Calculate cost as memory size times duration.

security
advanced
2:00remaining
Impact of Lambda Provisioned Concurrency on Pricing

Which statement correctly describes how enabling Provisioned Concurrency affects AWS Lambda pricing?

AProvisioned Concurrency only affects cold start times and does not change pricing.
BYou pay a fixed hourly rate for the provisioned concurrency plus the usual request and duration charges.
CProvisioned Concurrency eliminates duration charges but increases request charges.
DProvisioned Concurrency replaces the request charges with a flat monthly fee.
Attempts:
2 left
💡 Hint

Think about what extra resource is reserved when you enable Provisioned Concurrency.

Best Practice
expert
3:00remaining
Choosing Memory Size for Cost Efficiency

You want to minimize AWS Lambda cost for a function that runs variable workloads. Which approach best balances cost and performance?

ASet memory to the lowest possible value to minimize cost per millisecond, accepting longer execution times.
BSet memory high enough to reduce execution time significantly, even if cost per millisecond is higher.
CRandomly adjust memory size and monitor costs without analyzing execution time.
DUse a memory size that results in the lowest total cost, considering both memory and execution time together.
Attempts:
2 left
💡 Hint

Think about total cost = memory size * execution duration.