Last updated on February 16, 2024
Here are 10 AWS Certified Developer Associate DVA-C02 practice exam questions to help you gauge your readiness for the actual exam.
Question 1
A programmer is developing a Node.js application that will be run on a Linux server in their on-premises data center. The application will access various AWS services such as S3, DynamoDB, and ElastiCache using the AWS SDK.
Which of the following is the MOST suitable way to provide access for the developer to accomplish the specified task?
- Create an IAM role with the appropriate permissions to access the required AWS services. Assign the role to the on-premises Linux server.
- Go to the AWS Console and create a new IAM user with programmatic access. In the application server, create the credentials file at
~/.aws/credentials
with the access keys of the IAM user. - Create an IAM role with the appropriate permissions to access the required AWS services and assign the role to the on-premises Linux server. Whenever the application needs to access any AWS services, request temporary security credentials from STS using the
AssumeRole
API. -
Go to the AWS Console and create a new IAM User with the appropriate permissions. In the application server, create the credentials file at
~/.aws/credentials
with the username and the hashed password of the IAM User.Â
Question 2
A developer is moving a legacy web application from their on-premises data center to AWS. The application is used simultaneously by thousands of users, and their session states are stored in memory. The on-premises server usually reaches 100% CPU Utilization every time there is a surge in the number of people accessing the application.
Which of the following is the best way to re-factor the performance and availability of the application’s session management once it is migrated to AWS?
- Use an ElastiCache for Redis cluster to store the user session state of the application.
- Store the user session state of the application using CloudFront.
- Use an ElastiCache for Memcached cluster to store the user session state of the application.
- Use Sticky Sessions with Local Session Caching.
Question 3
A developer is working with an AWS Serverless Application Model (AWS SAM) application composed of several AWS Lambda functions. The developer runs the application locally on his laptop using sam local
commands. While testing, one of the functions returns Access denied
errors. Upon investigation, the developer discovered that the Lambda function is using the AWS SDK to make API calls within a sandbox AWS account.
Which combination of steps must the developer do to resolve the issue? (Select TWO)
-
Use the
aws configure
command with the--profile
parameter to add a named profile with the sandbox AWS account’s credentials. -
Create an AWS SAM CLI configuration file at the root of the SAM project folder. Add the
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
environment variables to it. -
Add the AWS credentials of the sandbox AWS account to the
Globals
section of thetemplate.yml
file and reference them in theAWS::Serverless::Function
properties section of the Lambda function. -
Run the function using
sam local invoke
with the--profile
parameter. -
Run the function using
sam local invoke
with the--parameter-overrides
parameter.
Question 4
A web application is uploading large files, which are over 4 GB in size, in an S3 bucket called http://data.tutorialsdojo.com
every 30 minutes. You want to minimize the time required to upload each file. Which of the following should you do to minimize upload time?
- Use the Multipart upload API.
- Enable Transfer Acceleration in the bucket.
- Use the BatchWriteItem API.
- Use the Putltem API.
Question 5
A web application is using an ElastiCache cluster that is suffering from cache churn. A developer needs to reconfigure the application so that data are retrieved from the database only in the event that there is a cache miss.
Which pseudocode illustrates the caching strategy that the developer needs to implement?
Option 1
<pre>
get_item(item_id):
   item_value = cache.get(item_id)
   if item_value is None:
     item_value = database.query(“SELECT * FROM Items WHERE id = ?”, item_id)
     cache.add(item_id, item_value)
   return item_value
</pre>
Option 2
<pre>
get_item(item_id):
    item_value = database.query(“SELECT * FROM Items WHERE id = ?”, item_id)
    if item_value is None:
       item_value = cache.set(item_id, item_value)
       cache.add(item_id, item_value)
    return item_value
</pre>
Option 3
<pre>
get_item(item_id):
    item_value = cache.get(item_id)
    if item_value is not None:
       item_value = database.query(“SELECT * FROM Items WHERE id = ?”, item_id)
       cache.add(item_id, item_value)
       return item_value
    else:
       return item_value
</pre>
Option 4
<pre>
get_item(item_id, item_value):
    item_value = database.query(“UPDATE Items WHERE id = ?”, item_id, item_value)
    cache.add(item_id, item_value)
    return ‘ok’
</pre>
Question 6
A Software Engineer is developing an application that will be hosted on an EC2 instance and read messages from a standard SQS queue. The average time that it takes for the producers to send a new message to the queue is 10 seconds.
Which of the following is the MOST efficient way for the application to query the new messages from the queue?
- Configure the SQS queue to use Long Polling.
- Configure each message in the SQS queue to have a custom visibility timeout of 10 seconds.
- Configure the SQS queue to use Short Polling.
- Configure an SQS Delay Queue with a value of 10 seconds.
Question 7
A developer has deployed a Lambda function that runs in DEV, UAT, and PROD environments. The function uses different parameters that varies based on the environment it is running in. The parameters are currently hardcoded in the function.
Which action should the developer do to reference the appropriate parameters without modifying the code every time the environment changes?
- Create a stage variable called
ENV
and invoke the Lambda function by its alias name. - Create individual Lambda Layers for each environment
- Publish three versions of the Lambda function. Assign the aliases DEV, UAT, and PROD to each version.
- Use environment variables to set the parameters per environment.
Question 8
A developer has recently completed a new version of a serverless application that is ready to be deployed using AWS SAM. There is a requirement that the traffic should shift from the previous Lambda function to the new version in the shortest time possible, but you still don’t want to shift traffic all-at-once immediately.
Which deployment configuration is the MOST suitable one to use in this scenario?
CodeDeployDefault.HalfAtATime
CodeDeployDefault.LambdaLinear10PercentEvery1Minute
CodeDeployDefault.LambdaLinear10PercentEvery2Minutes
CodeDeployDefault.LambdaCanary10Percent5Minutes
Question 9
A serverless application is composed of several Lambda functions which reads data from RDS. These functions must share the same connection string that should be encrypted to improve data security.
Which of the following is the MOST secure way to meet the above requirement?
- Create a Secure String Parameter using the AWS Systems Manager Parameter Store.
- Use AWS Lambda environment variables encrypted with KMS which will be shared by the Lambda functions.
- Create an IAM Execution Role that has access to RDS and attach it to the Lambda functions.
- Use AWS Lambda environment variables encrypted with CloudHSM.
Question 10
To improve their information security management system (ISMS), a company recently released a new policy which requires all database credentials to be encrypted and be automatically rotated to avoid unauthorized access.
Which of the following is the MOST appropriate solution to secure the credentials?
- Create a parameter to the Systems Manager Parameter Store using the PutParameter API with a type of
SecureString
. - Enable IAM DB authentication which rotates the credentials by default.
- Create an IAM Role which has full access to the database. Attach the role to the services which require access.
- Create a secret in AWS Secrets Manager and enable automatic rotation of the database credentials.
For more practice questions like these and to further prepare you for the actual AWS Certified Developer Associate DVA-C02 exam, we recommend that you take our top-notch AWS Certified Developer Associate Practice Exams, which have been regarded as the best in the market.Â
Also check out our AWS Certified Developer Associate DVA-C02 Exam Study Guide here.