Amazon Web Services certification · Exam DVA-C02

DVA-C02 Mock Exam Page 9

AWS Certified Developer - Associate

Free DVA-C02 mock exam questions 81–90, each with the answer and an explanation.

20 questions · 33 minutes · free, no sign-up

Free DVA-C02 questions

81–90 of 110 free
Question 81 Choose 1
An ecommerce startup is preparing for an annual sales event. As the traffic to the company's application increases, the development team wants to be notified when the Amazon EC2 instance's CPU utilization exceeds 80%. Which solution will meet this requirement?
Show answerHide answer

Correct answer: A Create a custom Amazon CloudWatch alarm that sends a notification to an Amazon SNS topic when the CPU utilization exceeds 80%.

Explanation

Explanation: Step-by-Step Breakdown:
Requirement Summary:
Get notified when EC2CPU Utilization > 80%
Option A: CloudWatch Alarm with SNS
Correct and standard AWS practice
CloudWatch automatically collectsEC2 metrics, including CPUUtilization.
You can set aCloudWatch Alarmwith a threshold (80% in this case).
Then,trigger an SNS notificationto email, SMS, Lambda, etc.
Option B: AWS CloudTrail alarm
Incorrect: CloudTrail logsAPI activity, not performance metrics.
It doesn’t track metrics like CPU utilization.
Option C: Cron job on EC2 running --describe-instance-information
Incorrect: This doesn’t give CPU usage.
Also inefficient, and polling is bad practice when CloudWatch already monitors this natively.
Option D: Lambda function querying CloudTrail for CPU usage
Incorrect and conceptually flawed.
CloudTrail does not store performance metrics; CloudWatch does.
Question 82 Choose 1
A developer created a Node.js-based AWS Lambda function by using a container image of an AWS OS-only base image. There is a new security patch for Node.js that must be patched to the new Lambda function. Which solution will meet this requirement?
Show answerHide answer

Correct answer: D Rebuild the Lambda container code with the latest Node.js patch version. Publish a new version of the Lambda function.

Explanation

Explanation:
Why Option D is Correct: When using a container-based AWS Lambda function, you are responsible for updating the base image for runtime patches. Rebuilding the container with the latest Node.js patch version ensures the function is updated with the required security patches. Publishing a new version of the Lambda function makes the updated image available for use.
Question 83 Choose 1
A company wants to use AWS AppConfig to gradually deploy a new feature to 15% of users to test the feature before a full deployment. Which solution will meet this requirement with the LEAST operational overhead?
Show answerHide answer

Correct answer: C Create an AWS AppConfig feature flag. Define a variant for the new feature, and create a rule to target 15% of users.

Explanation

Explanation: Comprehensive Detailed and Lengthy Step-by-Step Explanation with All AWS Developer References:
1. Understanding the Use Case:
The company wants to gradually release a new feature to 15% of users to perform testing. AWS AppConfig is designed to manage and deploy configurations, including feature flags, allowing controlled rollouts.
2. Key AWS AppConfig Features:
Feature Flags:Enable or disable features dynamically without redeploying code.
Variants:Define different configurations for subsets of users.
Targeting Rules:Specify rules for which users receive a particular variant.
3. Explanation of the Options:
Option A:"Set up a custom script within the application to randomly select 15% of users. Assign a flag for the new feature to the selected users."While possible, this approach requires significant operational effort to manage user selection and ensure randomness. It does not leverage AWS AppConfig's built-in capabilities, which increases overhead.
Option B:"Create separate AWS AppConfig feature flags for both groups of users.
Configure the flags to target 15% of users."Creating multiple feature flags for different user groups complicates configuration management and does not optimize the use of AWS AppConfig.
Option C:"Create an AWS AppConfig feature flag. Define a variant for the new feature, and create a rule to target 15% of users."This is the correct solution. Using AWS AppConfig feature flags with variants and targeting rules is the most efficient approach. It minimizes operational overhead by leveraging AWS AppConfig's builtin targeting and rollout capabilities.
Option D:"Use AWS AppConfig to create a feature flag without variants. Implement a custom traffic splitting mechanism in the application code."This approach requires custom implementation within the application code, increasing complexity and operational effort.
4. Implementation Steps for Option C:
Set Up AWS AppConfig:
Create a Feature Flag:
Define a Targeting Rule:
Deploy the Configuration:
Question 84 Choose 1
A developer is creating an AWS Lambda function that needs credentials to connect to an Amazon RDS for MySQL database. An Amazon S3 bucket currently stores the credentials. The developer needs to improve the existing solution by implementing credential rotation and secure storage. The developer also needs to provide integration with the Lambda function.
Which solution should the developer use to store and retrieve the credentials with the LEAST management overhead?
Show answerHide answer

Correct answer: C Store the credentials in AWS Secrets Manager. Set the secret type to Credentials for Amazon RDS database. Select the database that the secret will access. Use the default AWS Key Management Service (AWS KMS) key to encrypt the secret. Enable automatic rotation for the secret. Use the secret from Secrets Manager on the Lambda function to connect to the database.

Explanation

Explanation: AWS Secrets Manager is a service that helps you protect secrets needed to access your applications, services, and IT resources. Secrets Manager enables you to store, retrieve, and rotate secrets such as database credentials, API keys, and passwords. Secrets Manager supports a secret type for RDS databases, which allows you to select an existing RDS database instance and generate credentials for it. Secrets Manager encrypts the secret using AWS Key Management Service (AWS KMS) keys and enables automatic rotation of the secret at a specified interval. A Lambda function can use the AWS SDK or CLI to retrieve the secret from Secrets Manager and use it to connect to the database.
Question 85 Choose 1
A social media company is designing a platform that allows users to upload data, which is stored in Amazon S3. Users can upload data encrypted with a public key. The company wants to ensure that only the company can decrypt the uploaded content using an asymmetric encryption key. The data must always be encrypted in transit and at rest.
Show answerHide answer

Correct answer: D Use client-side encryption with a customer-managed encryption key to encrypt the data.

Explanation

Explanation:
Step 1: Problem Understanding
Asymmetric Encryption Requirement:Users encrypt data with apublic key, and only the company can decrypt it using aprivate key.
Data Encryption at Rest and In Transit:The data must be encrypted during upload (in transit) and when stored in Amazon S3 (at rest).
Step 2: Solution Analysis
Option A:Server-side encryption with Amazon S3 managed keys (SSE-S3).
Option B:Server-side encryption with customer-provided keys (SSE-C).
Option C:Client-side encryption with a data key.
Option D:Client-side encryption with a customer-managed encryption key.
Step 3: Implementation Steps for Option D
Generate Key Pair:
Encrypt Data on Client Side:
S3 Upload:
Decrypt Data on the Server:
AWS Developer References:
Amazon S3 Encryption Options
Asymmetric Key Cryptography in AWS
Question 86 Choose 1
An application that runs on AWS receives messages from an Amazon Simple Queue Service (Amazon SQS) queue and processes the messages in batches. The application sends the data to another SQS queue to be consumed by another legacy application. The legacy system can take up to 5 minutes to process some transaction data.
A developer wants to ensure that there are no out-of-order updates in the legacy system. The developer cannot alter the behavior of the legacy system.
Which solution will meet these requirements?
Show answerHide answer

Correct answer: A Use an SQS FIFO queue. Configure the visibility timeout value.

Explanation

Explanation:
  • An SQS FIFO queue is a type of queue that preserves the order of messages and ensures that each message is delivered and processed only once1. This is suitable for the scenario where the developer wants to ensure that there are no out-of-order updates in the legacy system.
  • The visibility timeout value is the amount of time that a message is invisible in the queue after a consumer receives it2. This prevents other consumers from processing the same message simultaneously. If the consumer does not delete the message before the visibility timeout expires, the message becomes visible again and another consumer can receive it2.
  • In this scenario, the developer needs to configure the visibility timeout value to be longer than the maximum processing time of the legacy system, which is 5 minutes. This will ensure that the message remains invisible in the queue until the legacy system finishes processing it and deletes it. This will prevent duplicate or out-of-order processing of messages by the legacy system.
Question 87 Choose 1
A developer uses AWS CloudFormation to deploy an Amazon API Gateway API and an AWS Step Functions state machine The state machine must reference the API Gateway API after the CloudFormation template is deployed The developer needs a solution that uses the state machine to reference the API Gateway endpoint. Which solution will meet these requirements MOST cost-effectively?
Show answerHide answer

Correct answer: A Configure the CloudFormation template to reference the API endpoint in the DefinitionSubstitutions property for the AWS StepFunctions StateMachme resource.

Explanation

Explanation:
  • CloudFormation and Dynamic References: The DefinitionSubstitutions property in CloudFormation allows you to pass values into Step Functions state machines at runtime.
  • Cost-Effectiveness: This solution is cost-effective as it leverages CloudFormation's built-in capabilities, avoiding the need for additional services like Secrets Manager or AppConfig.
Question 88 Choose 1
A company created an application to consume and process data. The application uses Amazon SQS and AWS Lambda functions. The application is currently working as expected, but it occasionally receives several messages that it cannot process properly. The company needs to clear these messages to prevent the queue from becoming blocked. A developer must implement a solution that makesqueue processing always operational. The solution must give the company the ability to defer the messages with errors and save these messages for further analysis. What is the MOST operationally efficient solution that meets these requirements?
Show answerHide answer

Correct answer: B Create a new SQS queue. Set the new queue as a dead-letter queue for the application queue. Configure the Maximum Receives setting.

Explanation

Explanation:
Using a dead-letter queue (DLQ) with Amazon SQS is the most operationally efficient solution for handling unprocessable messages.
Amazon SQS Dead-Letter Queue:
Why DLQ is the Best Option:
Why Not Other Options:
Steps to Implement:
Create a new SQS queue to serve as the DLQ.
Attach the DLQ to the primary queue and configure the Maximum Receives setting.
:
Using Amazon SQS Dead-Letter Queues
Best Practices for Using Amazon SQS with AWS Lambda
Question 89 Choose 1
A company has built an AWS Lambda function to convert large image files into output files that can be used in a third-party viewer application The company recently added a new module to the function to improve the output of the generated files However, the new module has increased the bundle size and has increased the time that is needed to deploy changes to the function code.
How can a developer increase the speed of the Lambda function deployment?
Show answerHide answer

Correct answer: B Use Lambda layers to package and load dependencies.

Explanation

Explanation:
  • Problem: Large bundle size increases Lambda deployment time.
  • Lambda Layers: Layers let you package dependencies separately from your function code. This optimizes the deployment package, making updates faster.
  • Modularization: Breaking down dependencies into layers improves code organization and reusability.
Question 90 Choose 1
A company has an application that is deployed on AWS Elastic Beanstalk. The application generates user-specific PDFs and stores the PDFs in an Amazon S3 bucket. The application then uses Amazon Simple Email Service (Amazon SES) to send the PDFs by email to subscribers.
Users no longer access the PDFs 90 days after the PDFs are generated. The S3 bucket is not versioned and contains many obsolete PDFs.
A developer must reduce the number of files in the S3 bucket by removing PDFs that are older than 90 days.
Which solution will meet this requirement with the LEAST development effort?
Show answerHide answer

Correct answer: C Create an S3 Lifecycle rule for the S3 bucket to expire objects after 90 days.

Full mock exam

Sit the DVA-C02 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real DVA-C02 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full DVA-C02 mock exam
  • 65questions per mock
  • 105 mintime limit
  • 368questions in the bank
  • Newmock on every attempt