Amazon Web Services · Free Practice Questions · Last reviewed May 2026
24real exam-style questions organised by domain, each with the correct answer highlighted and a plain-English explanation of why it's right — and why the others are wrong.
32% of exam · 6 sample questions below
A developer has an AWS Lambda function that processes messages from an Amazon SQS queue. The function is configured with a batch size of 10, reserved concurrency of 5, and a timeout of 5 minutes. The SQS queue has a large backlog, and CloudWatch metrics show high throttling (Throttles) for the Lambda function. The function is idempotent and can process up to 100 messages in a single invocation. What is the MOST effective way to increase throughput without increasing the reserved concurrency?
Increase the batch size to 100.
Increasing the batch size for an SQS event source mapping allows each AWS Lambda invocation to process a larger number of messages simultaneously. This significantly reduces the total number of Lambda invocations required to process a given volume of messages, thereby lowering the demand for concurrent executions. By processing more work per invocation, the function is less likely to hit its concurrency limit and experience throttling, effectively optimizing resource utilization without increasing reserved concurrency.
Increase the reserved concurrency to 10.
Reduce the batch size to 1.
Enable the SQS queue to use long polling.
A developer has an AWS Lambda function that processes messages from an Amazon SQS standard queue. The function is idempotent and currently has a batch size of 10. The developer wants to increase throughput and increases the batch size to 100. After the change, CloudWatch metrics show a significant increase in throttles and the queue backlog is growing. The function's reserved concurrency is set to 10. What is the most effective action to resolve the throttling and improve throughput?
Increase the reserved concurrency of the Lambda function
Increasing reserved concurrency directly allocates a dedicated maximum number of simultaneous executions for this specific Lambda function. This prevents the function from being throttled by the account's unreserved concurrency limit or other functions consuming available capacity. By ensuring more invocations can run in parallel, the function can effectively process larger SQS batch sizes without messages backing up, significantly improving overall message consumption rate and throughput.
Increase the memory allocation of the Lambda function
Switch the SQS queue to a FIFO queue
Decrease the batch size back to 10
A developer is using AWS X-Ray to trace a serverless application. The application uses an AWS Lambda function to query a DynamoDB table. The trace shows that the DynamoDB subsegment takes a significant portion of the total response time. The developer wants to reduce the DynamoDB query latency. Which service should the developer integrate with the Lambda function to achieve the lowest latency for repeated read queries?
DynamoDB Accelerator (DAX)
DynamoDB Accelerator (DAX) is a fully managed, in-memory cache specifically designed to sit in front of DynamoDB tables. It provides microsecond response times for read-heavy workloads by caching frequently accessed data, significantly improving performance for serverless applications. DAX is API-compatible with DynamoDB, requiring minimal application code changes to integrate and benefit from its high-performance caching capabilities, making it ideal for reducing read latency.
Amazon ElastiCache for Redis
DynamoDB Global Tables
DynamoDB Streams
A developer is building a serverless application using AWS Step Functions to orchestrate multiple AWS Lambda functions. One of the Lambda functions occasionally fails due to a transient error. The developer wants the Step Functions execution to automatically retry the failed task up to three times with exponential backoff. Which configuration should the developer set in the Step Functions state machine definition?
Add a Retry clause in the Lambda function's configuration with a maximum retry count of 3.
Use the Amazon States Language (ASL) Retry field in the Task state definition.
The Amazon States Language (ASL) Retry field is the definitive and recommended mechanism within AWS Step Functions for handling transient failures in Task states. This declarative approach allows developers to specify which error types to retry, the maximum number of attempts, the initial delay, and an exponential backoff rate. Implementing retries directly in the state machine definition ensures robust error handling without modifying the underlying Lambda function code.
Wrap the Lambda function invocation in a custom while loop within the function code.
Use the Amazon States Language Catch field in the Task state to redirect to a retry logic.
A developer is building a REST API using Amazon API Gateway and AWS Lambda. The API receives a large number of requests with duplicate payloads from the same client within a short time window. To reduce Lambda invocations and improve performance, the developer wants to return the previously computed response for identical requests based on a unique client ID in the header. How can the developer achieve this using API Gateway features?
Enable API Gateway caching on the stage and configure the client ID header as a cache key parameter. Set a cache TTL of 5 minutes.
API Gateway caching uses cache key parameters to index responses. By including the client ID header in the cache key, different clients get separate cached responses. The TTL controls how long the response is cached.
Configure a usage plan with a quota and throttle settings to limit requests per client ID.
Use request validation to reject requests that have the same client ID within 5 minutes.
Reduce the Lambda function's batch size to 1 and implement caching logic inside the function using an external cache like ElastiCache.
A developer is building a RESTful API using Amazon API Gateway (REST API) and AWS Lambda. The API receives a large number of requests with duplicate payloads within a short time window. To improve performance and reduce costs, the developer wants to ensure that if the same request (based on a unique client ID) is sent within 5 minutes, the Lambda function is not invoked again, and the previously calculated response is returned. Which API Gateway feature should the developer use?
Enable API caching on the stage with a TTL of 300 seconds and configure the client ID as a cache key parameter.
API Gateway's built-in caching mechanism is exclusively available for REST APIs, not HTTP APIs. While enabling caching on a stage with a specified TTL and using a client ID as a cache key parameter is a valid strategy for optimizing REST API performance and reducing backend load, this functionality is simply not supported for HTTP APIs. Therefore, this option cannot be implemented for the API type specified in the question, rendering it ineffective for the stated goal.
Enable request validation to reject duplicate requests.
Configure a usage plan with a throttle rate to limit requests from each client.
Enable stage variables to store the previous response.
Want more Development with AWS Services practice?
Practice this domainA developer has an AWS Lambda function that needs to read objects from an S3 bucket in another account. The Lambda function's execution role includes an IAM policy that allows s3:GetObject on the bucket. The bucket owner has added a bucket policy that grants s3:GetObject to the Lambda execution role. However, the Lambda function receives Access Denied errors. The S3 bucket uses SSE-KMS for encryption. What is the most likely cause?
The S3 bucket does not have versioning enabled.
The Lambda function's execution role does not have an explicit allow for s3:GetObject.
The Lambda function is not in the same AWS region as the S3 bucket.
The Lambda function does not have kms:Decrypt permission on the KMS key used by the bucket.
When an S3 bucket utilizes Server-Side Encryption with AWS KMS (SSE-KMS) for object encryption, any entity attempting to read those encrypted objects requires two distinct sets of permissions. First, it needs `s3:GetObject` permission on the S3 bucket and object. Second, and critically, the Lambda function's execution role must also have `kms:Decrypt` permission on the specific AWS KMS key used to encrypt the objects. This `kms:Decrypt` permission is granted via the KMS key policy, not the S3 bucket policy, and without it, the Lambda cannot decrypt the object data even if it successfully retrieves the encrypted bytes from S3.
A company has multiple AWS accounts managed under AWS Organizations. The security team requires that all Amazon S3 buckets with bucket names containing 'logs' must be encrypted with a specific KMS key (key ID: alias/logs-key) at rest. A developer must enforce this using an SCP (Service Control Policy). Which SCP effect and condition key should be used to deny any PutObject request that does not use the required KMS key?
Deny effect with a Condition: StringNotEquals on s3:x-amz-server-side-encryption-aws-kms-key-id
This SCP will deny any PutObject request that specifies a KMS key that is not the required key. The StringNotEquals condition ensures that if the request does not use the specific key ID, the request is denied. This is the standard way to enforce encryption with a specific KMS key using SCPs.
Deny effect with a Condition: StringEquals on s3:x-amz-server-side-encryption
Allow effect with a Condition: StringEquals on kms:RequestTag/key-id
Deny effect with a Condition: IpAddress on aws:SourceIp
A developer needs to grant a user in another AWS account (Account B) read-only access to objects in an Amazon S3 bucket owned by Account A. The developer has already added a bucket policy that grants s3:GetObject access to the IAM user in Account B. However, the user in Account B still gets Access Denied when trying to read objects. What additional configuration is required?
The user in Account B must have an IAM policy that allows s3:GetObject on the bucket ARN
Cross-account access requires both a bucket policy that grants the user permissions and an IAM policy in the user's account that allows the action. The IAM policy is necessary because the default is to deny all actions.
The bucket must be made public by unchecking 'Block all public access'
The developer must create a new IAM role in Account A and have the user in Account B assume that role
The user in Account B must use the S3 console instead of the AWS CLI
A developer needs to ensure that every cryptographic operation performed on an AWS KMS customer master key (CMK) used for server-side encryption in Amazon S3 is recorded in AWS CloudTrail for auditing. The developer has already enabled CloudTrail and is logging management events. However, the security team wants to see all calls to the KMS Decrypt and Encrypt APIs for this specific key. What must the developer do?
Enable CloudTrail data events for the S3 bucket containing the encrypted objects.
Create an additional CloudTrail trail that logs all management events for the KMS key.
Enable CloudTrail data events for the specific KMS key ARN.
CloudTrail data events for KMS record every call to Decrypt, Encrypt, GenerateDataKey, etc. By specifying the key ARN in the data event selector, only operations on that key are logged, meeting the audit requirement without excessive logging.
Enable CloudTrail Insights events on the existing trail.
A developer is building a mobile application that uses Amazon Cognito for user authentication. After a user signs in, the application needs to access an Amazon DynamoDB table. The developer has set up an identity pool with an authenticated role. The IAM role attached to the authenticated identity has a policy allowing the required DynamoDB actions. However, users report that they cannot perform DynamoDB operations. What is the MOST likely cause of this issue?
The identity pool is not configured to use the authenticated role.
The app is not passing the correct identity ID.
The IAM role's trust policy does not allow Cognito to assume it.
The trust policy of an IAM role explicitly defines which entities are permitted to assume that role. For Amazon Cognito Identity Pools to issue temporary AWS credentials to an authenticated user, the IAM role associated with the authenticated identity must have a trust policy that grants the Cognito Identity service principal (cognito-identity.amazonaws.com) the sts:AssumeRole permission. Without this crucial trust relationship, Cognito cannot generate the necessary temporary credentials, leading to 'Access Denied' errors when the application attempts to interact with other AWS services, regardless of the permissions policy attached to the role.
The DynamoDB table is encrypted with a different KMS key.
A company uses a customer managed AWS KMS key to encrypt sensitive data stored in DynamoDB. A Lambda function reads from the DynamoDB table and needs to decrypt the data. The Lambda function's execution role has an IAM policy that allows kms:Decrypt on the key. However, access is denied. What must the developer add to the KMS key policy to resolve the issue?
Add a statement granting kms:Decrypt to the Lambda function's execution role.
When a Lambda function needs to interact with a customer-managed AWS KMS key, the key policy associated with that KMS key must explicitly grant permissions to the entity making the request. The Lambda function assumes an IAM execution role, and it is this role that makes API calls to KMS. Therefore, the KMS key policy must include a statement allowing the kms:Decrypt action for the specific ARN of the Lambda function's execution role, ensuring direct access control and adherence to the principle of least privilege.
Add a statement granting kms:Decrypt to the Lambda function's resource-based policy.
Add a statement granting kms:Decrypt to the Lambda service principal.
Add a statement granting kms:Decrypt to the account root user with a condition for the Lambda function.
Want more Security practice?
Practice this domainA developer is using AWS CodeDeploy with a blue/green deployment strategy to update an application running on Amazon ECS with the Fargate launch type. After the new (green) task set is created and traffic is shifted to it, users immediately report errors when trying to write data. The developer discovers that the green task set is connecting to a different database than the blue task set. The database endpoints are configured in the ECS task definition. What is the simplest way to prevent this issue in future deployments?
Modify the blue/green deployment configuration to use the same database endpoint for both task sets by updating the environment variables in the task definition before deployment.
During an AWS CodeDeploy blue/green deployment, both the existing (blue) and new (green) application versions must access the same persistent data store to maintain data consistency. By updating environment variables within the ECS task definition, such as `DATABASE_ENDPOINT`, before deployment, both task sets can be configured to point to the single, shared database instance. This approach avoids data migration complexities and ensures a seamless transition without modifying the container image itself, making it the most straightforward and efficient solution for database connectivity.
Create two separate Amazon RDS databases and use an Amazon Route 53 weighted routing policy to distribute traffic.
Use an Application Load Balancer (ALB) with stickiness to route each user to the correct task set.
Use AWS CloudFormation to create a new database stack for each deployment and update the task definition dynamically.
A developer is using AWS CodeDeploy with a blue/green deployment on an Amazon ECS service running on Fargate. The developer wants to ensure that the new (green) task set is fully healthy and serving traffic before the old (blue) task set is terminated. The deployment should automatically roll back to the blue task set if the green task set fails health checks. Which configuration should the developer set in the CodeDeploy deployment group?
Deployment type: blue/green, with rollback configuration enabled to trigger automatic rollback and reroute traffic to the original task set
This configuration leverages AWS CodeDeploy's integrated rollback capabilities for blue/green deployments. By enabling rollback, CodeDeploy actively monitors predefined CloudWatch alarms or health checks during the traffic shifting phase. If any alarm is triggered, indicating a deployment failure or performance degradation, CodeDeploy automatically initiates a rollback, rerouting all traffic back to the original, stable task set to maintain application availability and minimize impact.
Deployment type: blue/green, Deployment configuration: CodeDeployDefault.ECSAllAtOnce
Deployment type: blue/green, Deployment configuration: CodeDeployDefault.ECSLinear10PercentEvery1Minutes
Deployment type: blue/green, with an Application Load Balancer
A developer is deploying a multi-container Docker application on Amazon ECS using the Fargate launch type. The application consists of a web server and a background worker. The web server must be scaled independently and must be accessible from the internet via an Application Load Balancer. The worker should not be accessible from the internet. Which ECS configuration should the developer use?
Create one ECS service with both containers in the same task definition, but only expose the web server port.
Create two separate ECS services, each with its own task definition, and place the web server in a public subnet with the worker in a private subnet.
This approach correctly leverages ECS services for independent lifecycle management and scaling of distinct application components. By defining separate task definitions and services for the web server and worker, each can be scaled independently based on its specific load requirements, optimizing resource utilization. Placing the web server service in a public subnet, typically behind an Application Load Balancer, allows it to serve internet traffic, while the worker service in a private subnet ensures it remains isolated from direct public access, enhancing security and adhering to best practices for backend components.
Create one ECS service with two tasks, each containing one container.
Create one ECS service with two containers in the same task, and use a service discovery to expose the worker.
A developer is using AWS CodeDeploy to deploy an application to an EC2 Auto Scaling group. The application must remain fully available; only one instance should be taken offline at a time. The developer wants to configure the deployment to update instances one by one, ensuring that the deployment fails fast if any instance fails to deploy. Which deployment configuration should the developer choose?
CodeDeployDefault.AllAtOnce
CodeDeployDefault.HalfAtATime
CodeDeployDefault.OneAtATime
The CodeDeployDefault.OneAtATime configuration updates only one instance in the target deployment group at a time. This strategy ensures maximum application availability by keeping the vast majority of instances serving traffic throughout the deployment process. It minimizes the blast radius of any potential deployment failure and allows for quick rollback or termination of the deployment if issues are detected on the single updated instance, making it ideal for critical applications requiring continuous operation.
CodeDeployDefault.BlueGreen
A developer is using AWS CodeDeploy to deploy an application to an Auto Scaling group of EC2 instances. The application is critical and must have zero downtime. The Auto Scaling group currently has 4 instances spread across 2 Availability Zones. Which predefined deployment configuration minimizes the number of instances taken out of service at any given time?
CodeDeployDefault.AllAtOnce
CodeDeployDefault.HalfAtATime
CodeDeployDefault.OneAtATime
OneAtATime deploys to a single instance at a time, minimizing the number of instances offline and best preserving availability.
CodeDeployDefault.LambdaCanary10Percent5Minutes
A company uses AWS Elastic Beanstalk to run a web application. They want to deploy a new version with zero downtime and roll forward if successful. They have two environments: a production environment (current version) and a staging environment (new version). After verifying the staging environment, they want to swap the URLs so that production now points to the new version. Which deployment strategy should they use?
Blue/green deployment with environment CNAME swap
Blue/green deployment with environment CNAME swap is the most robust strategy for zero-downtime deployments and easy rollback. It involves creating a completely new, separate Elastic Beanstalk environment (the "green" environment) running the new application version, while the existing "blue" environment continues to serve traffic. After thorough testing of the green environment, the CNAME record of the load balancer is atomically swapped, redirecting all traffic to the new environment instantly. This approach ensures the new version is fully validated before going live and allows for immediate rollback by swapping the CNAME back.
All at once deployment
Rolling deployment with additional batch
Immutable deployment
Want more Deployment practice?
Practice this domain18% of exam · 6 sample questions below
A developer deployed a new version of an AWS Lambda function that is part of a serverless application. The function uses an Amazon DynamoDB table as a data store. After deployment, the developer notices that the function's latency has increased significantly for some requests. CloudWatch traces show that the increase is due to DynamoDB throttle events. The function is configured with a reserved concurrency of 100 and the DynamoDB table has 5 read capacity units (RCUs) and 5 write capacity units (WCUs). What is the most effective way to reduce the throttling while maintaining application performance?
Decrease the reserved concurrency of the Lambda function to 10
Increase the read and write capacity units on the DynamoDB table
Increasing the read and write capacity units (RCU/WCU) on the DynamoDB table directly raises its maximum sustained throughput. These units define the number of strongly consistent reads and 1KB writes the table can handle per second. By provisioning more capacity, the table can accommodate a higher volume of operations, directly mitigating throttling errors that occur when request rates exceed the current limits.
Enable DynamoDB Accelerator (DAX) for caching reads
Enable auto scaling on the DynamoDB table
A developer is running an AWS Lambda function that is triggered by Amazon S3 events. The function writes processed data to an Amazon DynamoDB table. Over time, the function's execution time has increased significantly. CloudWatch Logs show many DynamoDBProvisionedThroughputExceededException errors. The table is configured with 5 read capacity units (RCUs) and 5 write capacity units (WCUs). The function performs both reads and writes. Which optimization will MOST effectively reduce throttling errors while maintaining performance?
Increase the RCUs and WCUs of the table to 50 each
Switch the DynamoDB table to on-demand capacity mode
Switching to on-demand capacity mode allows DynamoDB to automatically scale read and write throughput based on the actual traffic patterns generated by the Lambda function. This eliminates ProvisionedThroughputExceededException errors by dynamically adjusting capacity, ensuring the table can handle unpredictable or spiky workloads without manual intervention or capacity planning. It directly resolves throttling issues stemming from insufficient provisioned capacity.
Implement a DynamoDB Accelerator (DAX) cluster for caching reads
Increase Lambda function memory to 1024 MB
A web application runs on Amazon EC2 instances behind an Application Load Balancer (ALB). During peak hours, users report receiving HTTP 503 (Service Unavailable) errors. The developer checks Amazon CloudWatch metrics and finds that the ALB's request count is high but below the limit, and the target group's healthy host count drops to zero intermittently. The Auto Scaling group for the instances is configured with a minimum of 2, maximum of 10, and a simple scaling policy to add 2 instances when CPU utilization exceeds 70% for 5 consecutive minutes. What is the most likely cause of the 503 errors?
The Auto Scaling group's cooldown period prevents new instances from being added quickly enough during rapid traffic spikes
During a rapid traffic spike, an Auto Scaling group's cooldown period, typically 300 seconds by default, prevents additional scaling activities from initiating immediately after a previous one. This delay means that even if the scaling policy is triggered multiple times, new instances cannot launch quickly enough to meet the escalating demand. Consequently, existing instances become overloaded and unhealthy, leading to 503 Service Unavailable errors as the application cannot process requests.
The ALB's idle timeout is set too low, causing dropped connections
The Auto Scaling group's maximum capacity of 10 is insufficient
The health check grace period is preventing instances from being marked healthy
A developer is troubleshooting an AWS Lambda function that processes large CSV files (up to 1 GB) uploaded to an Amazon S3 bucket. The function uses Python and the pandas library to perform data transformations. Recently, the function started timing out on large files. CloudWatch Logs show that the function's execution time is close to the 15-minute Lambda timeout, and memory utilization peaks at around 80% of the configured 3,008 MB. The function has not been modified in months. Which action will most likely resolve the timeout issue without requiring code changes?
Increase the memory allocation of the Lambda function to the maximum available (10,240 MB)
Increasing the Lambda function's memory allocation directly scales the available CPU power, network bandwidth, and ephemeral storage. For CPU-intensive tasks like `pandas` processing of large CSV files, more CPU can significantly accelerate computations, reducing the overall execution time. This approach is highly effective in preventing timeouts by providing the necessary resources to complete the workload within the allowed duration, without requiring any changes to the existing function code.
Increase the function timeout to the maximum allowed (900 seconds is already the max)
Use S3 Select to filter columns and rows before invoking the Lambda function
Increase the batch size of the S3 event notification to invoke the function with multiple files
A developer is troubleshooting an AWS Lambda function that is invoked from an Amazon S3 bucket via event notifications. The function processes images and stores metadata in Amazon DynamoDB. The developer notices that some images are being processed multiple times, resulting in duplicate entries in DynamoDB. The S3 event notification is configured to send events to the Lambda function with the 's3:ObjectCreated:*' event type. The function uses the 'uuid' library to generate a unique ID for each image upon processing. What is the most likely cause of the duplicate processing?
S3 event notifications are delivered at least once, and the Lambda function is not idempotent.
S3 event notifications operate on an "at least once" delivery model, meaning that a single S3 event, such as an object creation, might trigger the associated Lambda function multiple times. If the Lambda function's logic is not designed to be idempotent, each duplicate invocation will independently process the event and perform its side effects, leading to duplicate data entries or actions. Implementing idempotency, often by using a unique identifier from the S3 event (like the object key) as a check, is crucial to prevent these redundant operations.
The Lambda function's concurrency is set too high, causing race conditions.
The DynamoDB table does not have a primary key that prevents duplicates.
The S3 bucket is configured with versioning, causing multiple object creation events.
A developer is troubleshooting an AWS Lambda function that processes records from an Amazon Kinesis Data Stream. The function is configured with a batch size of 100 and a parallelization factor of 1. The developer notices that the function is processing records slowly, and the iterator age is increasing. CloudWatch Logs show that the function is not experiencing errors or throttling, but the execution time per invocation is close to the 5-minute timeout. The stream has 10 shards. What is the most cost-effective way to increase processing throughput?
Increase the batch size to 1000
Increase the parallelization factor to 10
The parallelization factor determines the number of concurrent Lambda invocations per shard. Increasing it allows multiple invocations to process records from the same shard simultaneously, dramatically increasing throughput without additional shard costs.
Increase the memory of the Lambda function
Split the stream into more shards
Want more Troubleshooting and Optimization practice?
Practice this domainThe DVA-C02 exam has 65 questions and must be completed in 130 minutes. The passing score is 720/1000.
Scenario-based questions covering exam objectives with detailed answer explanations.
The exam covers 4 domains: Development with AWS Services, Security, Deployment, Troubleshooting and Optimization. Questions are weighted by domain — higher-weight domains appear more on your actual exam.
No. These are original exam-style practice questions written against the official Amazon Web Services DVA-C02 exam objectives. They are not copied from the real exam. Courseiva focuses on genuine understanding, not memorisation of braindumps.
Courseiva tracks your accuracy per domain and routes you toward weak areas automatically. Free, no account required.