Amazon AWS Certified Developer – Associate DVA-C02 Practice Test Questions and Exam Dumps Part18 Q341-360

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

 

Question 341

A developer needs to invoke a Lambda function whenever a message arrives in an SQS queue. Which AWS service integration should be configured?

  1. Amazon CloudFront
  2. Lambda event source mapping
  3. S3 Lifecycle
  4. API Gateway caching

Correct Answer: 2

Explanation

Lambda event source mappings allow Lambda to consume messages from supported event sources such as Amazon SQS. Lambda polls the queue and invokes the function with batches of messages according to the configured settings. Developers can configure parameters such as batch size and maximum batching window to control processing behavior. CloudFront is a content delivery service, S3 Lifecycle manages object transitions, and API Gateway caching stores API responses. An event source mapping is therefore the appropriate integration when an SQS queue should automatically trigger Lambda-based message processing.

Question 342

A developer wants to make a Lambda function available to applications running in another AWS account. Which mechanism can grant the other account permission to invoke the function?

  1. Lambda resource-based policy
  2. Lambda layer
  3. CloudWatch retention
  4. S3 lifecycle rule

Correct Answer: 1

Explanation

Lambda resource-based policies can grant invocation permissions to AWS accounts, IAM principals, or AWS services. For cross-account invocation, the function’s resource policy can allow the appropriate principal from another AWS account to invoke the function. The invoking principal must also have the necessary permissions on its side. Lambda layers provide reusable dependencies and do not control invocation authorization. CloudWatch retention and S3 lifecycle rules address logging and object management. A resource-based policy is therefore the appropriate mechanism for granting controlled cross-account Lambda invocation access.

Question 343

A developer needs to ensure that an SQS queue’s messages are encrypted while stored by the service. Which feature should be enabled?

  1. SQS long polling
  2. SQS server-side encryption
  3. SQS visibility timeout
  4. SQS delivery delay

Correct Answer: 2

Explanation

Amazon SQS supports server-side encryption to protect messages while they are stored in the queue. SQS can use AWS Key Management Service keys for encryption, allowing organizations to control key permissions and auditing. Long polling reduces empty responses when receiving messages, visibility timeout controls how long received messages remain hidden, and delivery delay postpones initial message availability. These settings do not provide encryption at rest. Therefore, server-side encryption is the appropriate feature when a developer needs stored SQS messages to be protected cryptographically.

Question 344

A developer wants an application to receive a notification when a CloudWatch alarm enters the ALARM state. Which service can be used as the notification target?

  1. Amazon SNS
  2. Amazon ECR
  3. Amazon DynamoDB
  4. Amazon ElastiCache

Correct Answer: 1

Explanation

Amazon SNS can receive notifications from CloudWatch alarms and distribute them to subscribed endpoints. For example, an SNS topic can send notifications through supported delivery mechanisms or trigger downstream processing. This provides a decoupled approach to alerting when a monitored metric crosses a configured threshold. ECR stores container images, DynamoDB provides NoSQL database capabilities, and ElastiCache provides in-memory caching. SNS is therefore the appropriate service for distributing notifications generated by CloudWatch alarms.

Question 345

A developer wants to ensure that a DynamoDB Query returns all matching items even when the result set is larger than the maximum response size. What should the application do?

  1. Use DynamoDB TTL
  2. Follow the LastEvaluatedKey
  3. Use DynamoDB Streams
  4. Increase the table name length

Correct Answer: 2

Explanation

DynamoDB Query operations can return paginated results when the matching data exceeds the response limit. When more results are available, DynamoDB returns a LastEvaluatedKey. The application should use this value as ExclusiveStartKey in a subsequent Query request and continue until no LastEvaluatedKey is returned. TTL removes expired items, Streams capture item-level changes, and table naming has no effect on pagination. Following LastEvaluatedKey is therefore the correct approach for retrieving all matching items across multiple DynamoDB Query responses.

Question 346

A developer needs to configure a Lambda function so that configuration values can differ between development and production without changing the deployment package. Which feature should be used?

  1. Lambda environment variables
  2. Lambda layers
  3. Lambda destinations
  4. Lambda event source mappings

Correct Answer: 1

Explanation

Lambda environment variables allow developers to provide configuration values separately from the function’s deployment package. The same application code can therefore be deployed to different environments while using different values for settings such as environment names, feature flags, or service endpoints. Layers provide reusable dependencies, destinations route asynchronous invocation results, and event source mappings connect Lambda to supported event sources. Environment variables are therefore suitable for separating environment-specific configuration from application code. Sensitive values should generally be stored using a dedicated secrets-management solution when appropriate.

Question 347

A developer wants an S3 bucket to automatically delete objects after a defined retention period. Which feature should be configured?

  1. S3 event notification
  2. S3 Lifecycle expiration rule
  3. S3 Transfer Acceleration
  4. S3 Access Point

Correct Answer: 2

Explanation

S3 Lifecycle rules can automatically expire objects after a specified period. This is useful when application data has a defined retention period and should no longer remain in the bucket after that period. Lifecycle configurations can also transition objects between storage classes before expiration. Event notifications communicate bucket events to other services, Transfer Acceleration improves supported data transfers, and access points provide specialized access configurations. An S3 Lifecycle expiration rule is therefore appropriate when objects should be automatically deleted based on their age or lifecycle policy.

Question 348

A developer needs to perform an operation on DynamoDB only when an item does not already exist. Which condition can be used?

  1. attribute_not_exists
  2. attribute_type
  3. begins_with
  4. contains

Correct Answer: 1

Explanation

The DynamoDB attribute_not_exists function can be used in a ConditionExpression to ensure that an attribute does not already exist. For example, an application can use it when creating a new item to prevent an existing item with the same key from being overwritten unintentionally. Other DynamoDB condition functions serve different purposes. attribute_type checks an attribute’s type, begins_with checks whether a string or binary value starts with a specified value, and contains checks whether a value contains another value. Therefore, attribute_not_exists is appropriate for conditional creation scenarios.

Question 349

A developer wants to securely provide temporary access to a specific S3 object without making the object publicly accessible. Which solution should be used?

  1. Public bucket policy
  2. S3 presigned URL
  3. S3 website hosting
  4. CloudFront default root object

Correct Answer: 2

Explanation

An S3 presigned URL provides temporary access to a specific S3 object or operation using permissions from the credentials that generated the URL. The object can remain private while the URL grants controlled access for a limited period. This is commonly used for temporary downloads or client-side uploads. Making the bucket public would provide broader access than necessary. S3 website hosting and CloudFront default root objects address content delivery and hosting behavior rather than temporary authorization. A presigned URL is therefore appropriate for secure, time-limited access to a private object.

Question 350

A developer wants to deploy a Lambda function without manually creating all the underlying AWS resources. Which AWS service or framework can define and deploy serverless resources using templates?

  1. AWS Serverless Application Model
  2. Amazon SQS
  3. Amazon ElastiCache
  4. Amazon Route 53

Correct Answer: 1

Explanation

AWS Serverless Application Model, commonly called AWS SAM, is a framework for defining and deploying serverless applications using templates. It extends AWS CloudFormation with simplified resource definitions for services such as Lambda, API Gateway, and DynamoDB. SAM can package and deploy application code and infrastructure together, helping developers manage repeatable deployments. SQS provides messaging, ElastiCache provides caching, and Route 53 provides DNS services. AWS SAM is therefore appropriate when a developer wants template-based deployment and management of serverless application resources.

Question 351

A developer needs to publish an application event and allow multiple independent systems to consume it without the publisher knowing the consumers. Which architecture is appropriate?

  1. Point-to-point messaging only
  2. Publish/subscribe using SNS
  3. Direct database polling
  4. Shared local file storage

Correct Answer: 2

Explanation

The publish/subscribe model provided by Amazon SNS allows a publisher to send an event to a topic without needing direct knowledge of individual subscribers. Multiple subscribers can receive the event independently, creating a decoupled architecture. Subscribers can include SQS queues, Lambda functions, and other supported endpoints. Point-to-point messaging is better suited to a single consumer workflow, while database polling and shared files introduce tighter coupling and additional operational complexity. SNS publish/subscribe is therefore appropriate when an event should be distributed to multiple independent consumers.

Question 352

A developer wants an SQS consumer to wait for messages instead of immediately returning an empty response when the queue has no available messages. Which feature should be used?

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

Correct Answer: 1

Explanation

SQS long polling allows a consumer to wait for messages to become available before returning a response, reducing unnecessary empty ReceiveMessage responses. This can lower API request volume and improve efficiency for applications that continuously consume messages. A dead-letter queue stores messages that repeatedly fail processing, message retention controls how long messages remain in the queue, and visibility timeout hides messages temporarily after they are received. Long polling is therefore the appropriate feature when a consumer should wait for available messages instead of repeatedly making short polling requests.

Question 353

A developer wants to store an application’s API credentials securely and rotate them automatically. Which AWS service is designed for this purpose?

  1. Amazon CloudWatch
  2. AWS Secrets Manager
  3. Amazon S3 Glacier
  4. Amazon ECR

Correct Answer: 2

Explanation

AWS Secrets Manager is designed to securely store sensitive information such as database credentials, API keys, and other application secrets. It supports controlled access through IAM and can support automatic secret rotation when integrated with supported services and rotation mechanisms. CloudWatch provides monitoring, Glacier storage classes are intended for archival storage, and ECR stores container images. Secrets Manager is therefore appropriate when an application needs centralized secret storage combined with controlled retrieval and rotation capabilities.

Question 354

A developer wants to detect when a Lambda function is being throttled because its concurrent execution limit has been reached. Which CloudWatch metric should be monitored?

  1. Invocations
  2. Duration
  3. Throttles
  4. IteratorAge

Correct Answer: 3

Explanation

The Lambda Throttles metric measures the number of invocation attempts that were throttled because the function could not accept additional concurrent executions or another configured concurrency limit was reached. Monitoring this metric can help developers identify insufficient concurrency capacity or traffic patterns that require architectural adjustments. Invocations counts invocation attempts, Duration measures execution time, and IteratorAge is relevant to certain stream-based event sources. Therefore, the Throttles metric is the appropriate CloudWatch metric for identifying Lambda throttling.

Question 355

A developer needs to route application events according to event type, such as order-created and payment-failed events. Which EventBridge component should contain these matching rules?

  1. Event bus rules
  2. S3 lifecycle configuration
  3. DynamoDB indexes
  4. Lambda layers

Correct Answer: 1

Explanation

Amazon EventBridge rules contain event patterns that determine which events should be matched and routed to configured targets. A developer can create different rules for event types such as order-created, payment-failed, or user-registered events. Each matching rule can send events to appropriate targets such as Lambda functions, SQS queues, or Step Functions. S3 lifecycle configurations manage objects, DynamoDB indexes optimize database access patterns, and Lambda layers package shared dependencies. EventBridge rules are therefore the correct mechanism for matching and routing application events according to their content.

Question 356

A developer wants to reduce Lambda startup latency for a function that receives latency-sensitive requests. Which Lambda feature can keep execution environments initialized and ready to respond?

  1. Provisioned concurrency
  2. Reserved concurrency only
  3. Lambda layers
  4. Dead-letter queue

Correct Answer: 1

Explanation

Lambda provisioned concurrency keeps a configured number of execution environments initialized and ready to respond to requests. This can reduce startup latency associated with creating and initializing a new execution environment, which is particularly useful for latency-sensitive applications. Reserved concurrency limits and reserves the maximum concurrency available to a function but does not itself keep execution environments initialized. Lambda layers manage dependencies, while dead-letter queues handle failed asynchronous processing. Provisioned concurrency is therefore the relevant feature when developers need more predictable startup latency for selected Lambda workloads.

Question 357

A developer needs to prevent a DynamoDB item from being overwritten if another process has already changed it. Which application pattern can be used?

  1. Optimistic locking with a version attribute
  2. S3 lifecycle expiration
  3. SQS long polling
  4. CloudFront caching

Correct Answer: 1

Explanation

Optimistic locking can be implemented in DynamoDB using a version attribute and a ConditionExpression. The application reads the current version and includes the expected version in the update condition. If another process has already modified the item and changed its version, the condition fails and the update is rejected. This helps prevent lost updates without requiring a traditional database lock. S3 lifecycle rules, SQS long polling, and CloudFront caching address unrelated requirements. Optimistic concurrency control is therefore suitable for protecting updates when multiple processes may modify the same item.

Question 358

A developer wants to invoke a Lambda function from an HTTP API and requires request throttling, authentication, and API management capabilities. Which service should be placed in front of Lambda?

  1. Amazon API Gateway
  2. Amazon ECR
  3. Amazon S3
  4. Amazon DynamoDB

Correct Answer: 1

Explanation

Amazon API Gateway provides managed API capabilities and can integrate with Lambda functions. It supports features such as authentication and authorization integrations, throttling, request validation, stages, usage plans, and API monitoring. This makes it suitable when a Lambda function needs to be exposed through a managed HTTP API rather than simply using a basic function URL. ECR stores container images, S3 provides object storage, and DynamoDB provides NoSQL database services. API Gateway is therefore appropriate when the application requires broader API management capabilities in front of Lambda.

Question 359

A developer wants to automatically deploy application changes whenever code is pushed to a source repository. Which AWS service can provide the build stage of this workflow?

  1. AWS CodeBuild
  2. Amazon SQS
  3. Amazon Route 53
  4. Amazon ElastiCache

Correct Answer: 1

Explanation

AWS CodeBuild is a managed build service that compiles source code, runs tests, and produces build artifacts. It can be integrated into CI/CD workflows so that application changes trigger automated build and test operations. CodeBuild can also work with services such as CodePipeline to create broader continuous delivery workflows. SQS provides messaging, Route 53 provides DNS services, and ElastiCache provides in-memory caching. CodeBuild is therefore appropriate for the automated build and test stage of a software delivery process.

Question 360

A developer needs to execute several dependent tasks in sequence and retry a failed task according to configured rules. Which AWS service is designed for this orchestration?

  1. Amazon S3
  2. AWS Step Functions
  3. Amazon ECR
  4. Amazon CloudFront

Correct Answer: 2

Explanation

AWS Step Functions provides workflow orchestration for coordinating multiple tasks and AWS services. A state machine can define sequential steps, branching, parallel execution, waiting periods, and retry or catch behavior for failures. This allows developers to implement reliable workflows without manually managing the orchestration logic inside a single application component. S3 provides object storage, ECR stores container images, and CloudFront provides content delivery. Step Functions is therefore appropriate when an application needs to coordinate dependent tasks and define structured retry behavior.