SAP-C02 Continuous Improvement for Existing Solutions Practice Question
A company has an AWS Lambda function that processes messages from an SQS queue. The function is experiencing timeouts. Which TWO changes could help resolve the timeout issue? (Choose 2)
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
✓
Increase the Lambda function timeout.
Option C is correct because the Lambda function timeout setting defines the maximum execution time before Lambda terminates the invocation; if the function legitimately needs more time to process messages, raising the timeout (up to 15 minutes) directly prevents timeout errors. Option D is correct because Lambda allocates CPU and network bandwidth proportionally to memory, so increasing the memory allocation gives the function more compute power and can significantly reduce processing time, resolving timeouts caused by slow execution. Option A is not appropriate because increasing the SQS batch size means each invocation processes more messages, which typically increases execution duration and worsens timeouts. Option B is not relevant because SQS queue encryption (SSE) protects data at rest and does not affect Lambda execution time. Option E is not appropriate because decreasing the visibility timeout makes messages reappear sooner for reprocessing, which can cause duplicate processing and does not fix the underlying Lambda timeout.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Increase the batch size in the SQS event source mapping.
Why it's wrong here
A larger batch means each invocation processes more messages within the same Lambda timeout window, increasing the chance of exceeding it. It is tempting because batching reduces invocation count and cost, but for timeout resolution the batch size should be reduced, not increased.
- ✗
Enable SQS queue encryption.
Why it's wrong here
Encryption at rest protects queued message data but adds no processing time relief, so function timeouts persist unchanged. It is tempting because encryption is a common security hardening step for SQS queues, yet it addresses confidentiality, not Lambda execution duration.
- ✓
Increase the Lambda function timeout.
Why this is correct
Raising the function's configured timeout directly addresses the stem's timeout constraint: Lambda terminates execution once the limit is reached, so a longer duration lets genuinely slow processing finish. This suits the SQS-triggered workload, though it only helps when the function's actual runtime exceeds the current limit rather than being stuck.
- ✓
Increase the Lambda function memory allocation.
Why this is correct
Increasing memory allocation also proportionally raises allocated vCPU, which accelerates processing and reduces execution duration, directly addressing the timeout constraint. Lambda scales CPU with memory, so a CPU-bound function finishes faster within the same configured timeout window.
- ✗
Decrease the SQS visibility timeout.
Why it's wrong here
Shortening the visibility timeout causes messages to reappear and be reprocessed while the original invocation is still running, amplifying duplicate work and timeouts. It is tempting because a long visibility timeout can delay retries, but the timeout must exceed the function's maximum execution duration.
Visual reference
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
One of 984 original SAP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This SAP-C02 practice question is part of Courseiva's free Amazon Web Services 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 SAP-C02 exam.