Amazon AWS Certified Developer – Associate DVA-C02 Practice Test Questions and Exam Dumps Part4 Q61-80

View Full Amazon AWS Certified Developer – Associate DVA-C02 Exam Dumps and Practice Test Dumps.

 

Question 61

A developer needs to allow an application running on Amazon EC2 to access an S3 bucket without storing long-term AWS credentials on the instance. Which solution should be used?

  1. Create an IAM role and attach it to the EC2 instance profile.
  2. Store access keys in a text file on the instance.
  3. Make the S3 bucket publicly accessible.
  4. Embed credentials in the application source code.

Correct Answer: 1

Explanation

An IAM role attached to an EC2 instance through an instance profile allows applications running on the instance to obtain temporary AWS credentials. The AWS SDK can automatically retrieve these credentials from the instance metadata service when making AWS API calls. This eliminates the need to store long-term access keys on the server. The role should follow the principle of least privilege and contain only the permissions required by the application. Storing credentials in files or source code creates unnecessary security risks. Making an S3 bucket public is also inappropriate when the application needs authenticated access to private resources.

Question 62

A developer needs to retrieve only specific attributes from items returned by a DynamoDB query. Which parameter should be used?

  1. FilterExpression
  2. KeyConditionExpression
  3. ProjectionExpression
  4. ConditionExpression

Correct Answer: 3

Explanation

A ProjectionExpression in DynamoDB specifies the attributes that should be returned in the response. It can reduce the amount of data transferred to the application when only a subset of item attributes is required. KeyConditionExpression is used to define the key conditions for a Query operation, while FilterExpression filters results after the initial read operation. ConditionExpression is commonly used with write operations to enforce conditions before an update, put, or delete occurs. Using ProjectionExpression can make application responses smaller and simplify processing when the application does not require every attribute stored in the DynamoDB item.

Question 63

A developer wants an S3 bucket to retain previous versions of an object whenever the object is overwritten. Which feature should be enabled?

  1. S3 Transfer Acceleration
  2. S3 Versioning
  3. S3 Inventory
  4. S3 Select

Correct Answer: 2

Explanation

Amazon S3 Versioning maintains multiple versions of an object in the same bucket. When an object is overwritten or deleted, previous versions can remain available depending on the bucket configuration. Versioning is useful for protecting against accidental overwrites and deletions and for recovering earlier versions of files. Transfer Acceleration improves transfer performance, Inventory provides reports about objects, and S3 Select allows applications to retrieve specific data from supported objects. Enabling Versioning is therefore appropriate when an application needs to preserve previous object versions and support recovery from accidental changes.

Question 64

A developer needs a Lambda function to connect securely to a relational database hosted inside a VPC. Which configuration may be required?

  1. Configure the Lambda function to access the appropriate VPC subnets and security groups.
  2. Make the database publicly accessible.
  3. Store database credentials in the Lambda function name.
  4. Disable all database security groups.

Correct Answer: 1

Explanation

A Lambda function can be configured to access resources inside a VPC by specifying appropriate subnets and security groups. The network configuration must allow the Lambda execution environment to communicate with the database on the required port. The database security group should allow inbound traffic from the security group associated with the Lambda function when appropriate. Database credentials should be managed separately using services such as Secrets Manager or Parameter Store. Making the database publicly accessible is generally unnecessary and increases exposure. Correct VPC and security-group configuration allows Lambda to communicate privately with database resources.

Question 65

A developer wants an SQS message to become available to consumers only after a short delay. Which SQS feature should be configured?

  1. Visibility timeout
  2. Message retention
  3. Delivery delay
  4. Long polling

Correct Answer: 3

Explanation

Amazon SQS delivery delay causes newly sent messages to remain temporarily unavailable to consumers for the configured delay period. This is useful when an application needs to postpone processing after a message is submitted. Visibility timeout has a different purpose: it temporarily hides a message after a consumer receives it so another consumer does not immediately process the same message. Long polling reduces empty polling requests, while message retention controls how long messages remain in the queue. Delivery delay is therefore the appropriate feature when messages should not become available immediately after being sent.

Question 66

A developer is creating a Lambda function that requires third-party libraries shared by several functions. Which feature can be used to package these dependencies separately?

  1. Lambda layers
  2. Lambda aliases
  3. Lambda destinations
  4. Lambda reserved concurrency

Correct Answer: 1

Explanation

AWS Lambda layers allow developers to package libraries, dependencies, and other reusable components separately from function code. Multiple Lambda functions can reference the same layer, reducing duplication and simplifying dependency management. Layers can contain runtime libraries, custom modules, or shared utilities required by several functions. Aliases point to specific published function versions, destinations route asynchronous invocation results, and reserved concurrency controls concurrent executions. Using layers can make deployments more consistent when multiple functions rely on common dependencies. Developers should still manage layer versions carefully so that function behavior remains predictable after dependency updates.

Question 67

A developer needs to retrieve a single DynamoDB item using its complete primary key. Which operation should be used?

  1. Scan
  2. Query
  3. GetItem
  4. BatchGetItem only

Correct Answer: 3

Explanation

The DynamoDB GetItem operation retrieves a single item using its primary key. For a table with a composite primary key, both the partition key and sort key are required to uniquely identify the item. GetItem is appropriate when the application already knows the exact key of the item it needs. Query is used to retrieve multiple items based on a partition key and optional sort-key conditions. Scan examines items across a table or index, while BatchGetItem retrieves multiple specific items in one request. Using GetItem avoids unnecessary scanning when the exact primary key is already known.

Question 68

A developer wants to prevent unauthorized users from invoking a protected API Gateway endpoint. Which mechanism should be configured?

  1. API Gateway authorizer
  2. API Gateway cache only
  3. API Gateway stage name
  4. API Gateway response model only

Correct Answer: 1

Explanation

API Gateway authorizers provide a mechanism for controlling access to protected API methods. Depending on the architecture, an authorizer can validate tokens from Amazon Cognito or use a Lambda function to evaluate authorization information. The authorization decision is made before the request reaches the backend integration. API caching can improve performance but does not itself provide authentication. Stage names identify deployment environments, while response models describe response structures. Using an appropriate authorizer helps ensure that only authenticated and authorized callers can invoke protected API operations.

Question 69

A developer wants to automatically scale DynamoDB capacity based on application traffic without manually changing provisioned capacity. Which option should be considered?

  1. DynamoDB Streams
  2. DynamoDB auto scaling
  3. DynamoDB TTL
  4. DynamoDB point-in-time recovery

Correct Answer: 2

Explanation

DynamoDB auto scaling can automatically adjust provisioned read and write capacity based on utilization targets. This helps applications respond to changing workloads without requiring developers to manually modify capacity settings continuously. Auto scaling works with provisioned capacity mode and uses AWS Application Auto Scaling to adjust capacity within configured minimum and maximum limits. DynamoDB Streams records item changes, TTL removes expired items, and point-in-time recovery provides continuous backups for recovery purposes. Developers should select capacity and scaling configurations according to application traffic patterns and workload requirements.

Question 70

A developer wants to send a message to an SQS FIFO queue and ensure that related messages are processed in order. Which feature should be used?

  1. Message group ID
  2. S3 object key
  3. CloudWatch metric filter
  4. Lambda layer

Correct Answer: 1

Explanation

Amazon SQS FIFO queues use message group IDs to maintain ordering for related messages. Messages belonging to the same message group are processed in order, while messages from different groups can be processed independently. This allows applications to preserve ordering where required while still achieving parallelism across groups. The message group ID is therefore important for workloads such as order processing or event sequences where related operations must occur in a defined order. S3 object keys, CloudWatch metric filters, and Lambda layers do not provide message ordering capabilities for SQS.

Question 71

A developer needs to encrypt an S3 object automatically when it is uploaded without requiring the application to perform encryption itself. Which S3 capability should be configured?

  1. S3 server-side encryption
  2. S3 Inventory
  3. S3 Transfer Acceleration
  4. S3 Select

Correct Answer: 1

Explanation

Amazon S3 server-side encryption allows S3 to encrypt objects as they are stored. The encryption process is handled by the service rather than requiring the application to encrypt the data before uploading it. S3 supports several server-side encryption options, including SSE-S3 and SSE-KMS. When greater control over encryption keys and permissions is required, AWS KMS integration can be used. S3 Inventory provides object reports, Transfer Acceleration improves transfer performance, and S3 Select retrieves selected data from supported objects. Server-side encryption is therefore appropriate when stored S3 data must be encrypted automatically.

Question 72

A developer wants to invoke a Lambda function on a schedule, such as every five minutes. Which AWS service can be used to create the schedule?

  1. Amazon ECR
  2. Amazon EventBridge Scheduler
  3. Amazon DynamoDB Streams
  4. AWS KMS

Correct Answer: 2

Explanation

Amazon EventBridge Scheduler can create scheduled invocations for AWS services, including Lambda functions. A schedule can use a rate or cron expression to determine when the target should be invoked. This is useful for periodic jobs such as cleanup tasks, data processing, report generation, and scheduled maintenance. DynamoDB Streams is designed to capture database item changes, ECR stores container images, and KMS manages encryption keys. EventBridge Scheduler separates scheduling logic from the application itself, allowing developers to trigger functions at predefined intervals without implementing their own timer mechanism.

Question 73

A developer wants to reduce the number of database requests for frequently accessed DynamoDB items. Which AWS service can provide an in-memory caching layer?

  1. Amazon ElastiCache
  2. Amazon CloudTrail
  3. Amazon Route 53
  4. AWS CloudFormation

Correct Answer: 1

Explanation

Amazon ElastiCache provides managed in-memory data stores that can be used to cache frequently accessed application data. By retrieving commonly requested information from memory instead of repeatedly querying DynamoDB, an application can reduce database load and potentially improve response latency. Developers must design cache expiration and invalidation strategies according to application consistency requirements. CloudTrail records account activity, Route 53 provides DNS services, and CloudFormation manages infrastructure as code. ElastiCache is therefore suitable when an application requires a separate high-speed caching layer in front of persistent data storage.

Question 74

A developer wants an application to process messages from an SQS queue using Lambda without continuously writing custom polling code. Which feature should be configured?

  1. Lambda event source mapping
  2. Lambda layer
  3. Lambda alias
  4. Lambda function URL

Correct Answer: 1

Explanation

Lambda event source mappings allow Lambda to automatically poll supported event sources such as Amazon SQS and invoke a function with batches of retrieved messages. This removes the need for developers to implement their own continuous polling mechanism. Lambda manages the polling process and invokes the function when messages are available. The function should process messages successfully and handle failures appropriately because retry behavior can result in messages being delivered again. Layers package reusable dependencies, aliases manage published versions, and function URLs expose Lambda through HTTP. Event source mapping is therefore the appropriate integration for SQS-to-Lambda processing.

Question 75

A developer wants to store an application parameter securely using encryption and retrieve it at runtime through AWS Systems Manager. Which parameter type should be used?

  1. StringList
  2. String
  3. SecureString
  4. JSONList

Correct Answer: 3

Explanation

AWS Systems Manager Parameter Store supports the SecureString parameter type for storing sensitive configuration values in encrypted form. SecureString parameters use AWS KMS for encryption and can be retrieved by applications with appropriate IAM permissions. This is useful for passwords, tokens, and other sensitive configuration information when a full secrets-management workflow is not required. String parameters store ordinary text values, while StringList stores comma-separated lists. SecureString provides an additional protection layer by encrypting the parameter value rather than keeping sensitive information as plain text.

Question 76

A developer needs to make a Lambda function available to multiple environments while ensuring that each environment can point to a different published version. Which feature should be used?

  1. Lambda aliases
  2. Lambda layers only
  3. Lambda memory settings
  4. Lambda timeout settings

Correct Answer: 1

Explanation

Lambda aliases provide stable references to published function versions. An application can create aliases such as development, staging, and production and point each alias to a different immutable Lambda version. This allows deployments to change the version associated with an environment without requiring application clients to change their integration configuration. Aliases can also support controlled traffic shifting between versions. Layers provide reusable dependencies, while memory and timeout settings control execution characteristics. Lambda aliases are therefore useful for managing multiple environments and controlled version promotion.

Question 77

A developer wants to ensure that a failed SQS message is eventually moved to another queue after a configured number of unsuccessful processing attempts. Which feature should be used?

  1. Visibility timeout only
  2. Dead-letter queue
  3. Long polling
  4. Message delay

Correct Answer: 2

Explanation

An Amazon SQS dead-letter queue can store messages that cannot be successfully processed after a configured number of attempts. The source queue can define a redrive policy that specifies the maximum receive count before a message is moved to the dead-letter queue. This prevents repeatedly failing messages from continuously blocking normal processing and gives developers an opportunity to inspect and troubleshoot them separately. Visibility timeout controls temporary message invisibility, long polling controls how consumers wait for messages, and delivery delay postpones message availability. A dead-letter queue is therefore the appropriate feature for handling repeatedly failed messages.

Question 78

A developer is troubleshooting a Lambda function and wants to create an alarm when the number of errors exceeds a threshold. Which AWS service should be used?

  1. Amazon CloudWatch
  2. Amazon ECR
  3. Amazon Cognito
  4. AWS KMS

Correct Answer: 1

Explanation

Amazon CloudWatch provides monitoring capabilities for AWS resources and applications, including Lambda functions. CloudWatch metrics can be used to track Lambda errors, invocations, duration, throttles, and other execution characteristics. Developers can create CloudWatch alarms that respond when a metric crosses a configured threshold. For example, an alarm can notify an operations team when Lambda errors exceed an acceptable level. ECR manages container images, Cognito manages application users, and KMS manages encryption keys. CloudWatch is therefore the appropriate service for monitoring Lambda execution metrics and creating threshold-based alarms.

Question 79

A developer wants to create an HTTP API that invokes a Lambda function and requires low-latency API processing with simple API management requirements. Which service is appropriate?

  1. Amazon API Gateway
  2. Amazon S3 Glacier
  3. Amazon RDS
  4. Amazon ECR

Correct Answer: 1

Explanation

Amazon API Gateway provides managed APIs that can integrate directly with AWS Lambda. It supports request routing, authorization, throttling, monitoring integrations, and other API management capabilities. API Gateway can expose Lambda-backed application functionality through HTTP endpoints without requiring the developer to operate web servers. S3 Glacier is designed for archival storage, RDS provides relational databases, and ECR stores container images. API Gateway is therefore a suitable service for exposing Lambda functions as managed HTTP APIs. The specific API type should be selected based on required features, authentication, routing, and operational needs.

Question 80

A developer wants to build a loosely coupled application in which one component publishes events and multiple independent consumers process those events. Which architecture is appropriate?

  1. Direct database sharing between all components
  2. Amazon SNS with separate subscriptions for consumers
  3. One Lambda function containing all application logic
  4. A single shared configuration file

Correct Answer: 2

Explanation

Amazon SNS supports a publish/subscribe architecture in which a producer publishes an event to a topic and multiple subscribers receive the event independently. Each consumer can have its own subscription and processing behavior. SNS can also fan out messages to separate SQS queues, allowing consumers to process messages asynchronously and independently. This approach reduces direct dependencies between application components and improves scalability and maintainability. Sharing a database directly between unrelated components can create tighter coupling, while placing all logic in one function reduces separation of responsibilities. SNS-based event fanout is therefore useful for loosely coupled event-driven systems.