Amazon AWS Certified Developer – Associate DVA-C02 Practice Test Questions and Exam Dumps Part3 Q41-60

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

 

Question 41

A developer is building a Lambda function that processes records from an Amazon Kinesis Data Stream. The function should process records in the order they appear within each shard. Which behavior should the developer expect?

  1. Records from each shard are processed in sequence.
  2. All records from every shard are processed globally in order.
  3. Records are always processed randomly.
  4. Kinesis does not support Lambda event source mappings.

Correct Answer: 1

Explanation

When AWS Lambda consumes records from an Amazon Kinesis Data Stream, records within each shard are processed in order. Kinesis provides ordering at the shard level rather than across the entire stream. Multiple shards can therefore be processed concurrently, while records belonging to the same shard maintain their sequence. This design allows applications to achieve parallel processing while preserving ordering where it matters. Developers should consider shard distribution when designing applications that require ordered processing. If strict global ordering across all records is required, additional application-level coordination would be necessary because Kinesis does not provide global ordering across multiple shards.

Question 42

A developer wants an API Gateway API to reject requests when clients exceed a configured request rate. Which feature should be used?

  1. API Gateway stages
  2. API Gateway throttling
  3. API Gateway models
  4. API Gateway mapping templates

Correct Answer: 2

Explanation

Amazon API Gateway throttling controls the rate at which clients can invoke an API. Throttling can help protect backend services from excessive traffic and prevent applications from becoming overloaded. API Gateway uses configured rate and burst limits to regulate incoming requests. When traffic exceeds the applicable limits, requests can receive throttling responses. Stages are used to represent different API deployment environments, models define data structures, and mapping templates transform request or response data. Throttling is therefore the appropriate feature when the primary requirement is to limit API request rates.

Question 43

A developer needs to retrieve a secret from AWS Secrets Manager from a Lambda function. Which approach is recommended?

  1. Hardcode the secret in the function source code.
  2. Store the secret in a public S3 bucket.
  3. Grant the Lambda execution role permission to retrieve the secret.
  4. Put the secret in the API Gateway URL.

Correct Answer: 3

Explanation

A Lambda function should retrieve secrets from AWS Secrets Manager using permissions granted through its execution role. The role can be configured with least-privilege permissions such as permission to call GetSecretValue for a specific secret. The AWS SDK can then retrieve the secret at runtime. This avoids exposing sensitive credentials in source code, URLs, or publicly accessible storage. Hardcoding secrets makes rotation and credential management difficult and creates security risks. Using IAM roles also provides temporary credentials to the Lambda environment, reducing the need for developers to manage long-term AWS access keys.

Question 44

A developer is designing a serverless application where an S3 upload should asynchronously invoke a processing function. Which service integration is appropriate?

  1. S3 event notification to Lambda
  2. S3 lifecycle rule to Lambda
  3. CloudFront distribution to Lambda
  4. Route 53 record to Lambda

Correct Answer: 1

Explanation

Amazon S3 event notifications can trigger AWS Lambda when specific events occur in a bucket. For example, an object-created event can invoke a Lambda function whenever a new file is uploaded. This pattern is useful for image processing, document validation, metadata extraction, and other event-driven workloads. S3 lifecycle rules are used to transition or expire objects rather than trigger processing functions. CloudFront handles content delivery, while Route 53 provides DNS services. Using S3 event notifications creates a loosely coupled architecture in which the storage event automatically initiates the required application processing.

Question 45

A developer wants to ensure that an application can safely retry a payment-processing request without accidentally performing the payment twice. Which application design principle is most important?

  1. Compression
  2. Idempotency
  3. Sharding
  4. Caching

Correct Answer: 2

Explanation

Idempotency means that repeating the same operation produces the same intended result rather than causing an unintended duplicate action. This is particularly important for operations such as payments, order creation, or resource provisioning. An application can use an idempotency key or another unique request identifier to recognize duplicate requests and return the result of the original operation instead of processing it again. Retries can occur because of network failures, service timeouts, or transient errors. Designing critical operations to be idempotent allows applications to safely retry requests while reducing the risk of duplicate side effects.

Question 46

A developer wants to invoke a Lambda function asynchronously and have failed events sent to another destination for further processing. Which feature can provide this capability?

  1. Lambda destinations
  2. Lambda layers
  3. Lambda environment variables
  4. Lambda function URLs only

Correct Answer: 1

Explanation

AWS Lambda destinations allow developers to route the results of asynchronous function invocations to supported destinations. A destination can be configured for successful or failed invocations. For example, failed events can be sent to an Amazon SQS queue or SNS topic for further processing, monitoring, or investigation. This can simplify asynchronous error handling compared with implementing all failure routing manually inside the function. Lambda layers are used to package reusable libraries and dependencies, while environment variables store configuration values. Destinations are therefore useful when an application needs controlled handling of the outcome of asynchronous Lambda executions.

Question 47

A developer needs to upload a very large file to Amazon S3 efficiently. Which S3 feature should be used?

  1. S3 Select
  2. Multipart upload
  3. S3 Inventory
  4. S3 Object Lock

Correct Answer: 2

Explanation

Amazon S3 Multipart Upload allows a large object to be uploaded as a set of separate parts. These parts can be uploaded independently and, when appropriate, in parallel. Multipart uploads improve performance for large files and make it possible to retry only failed parts instead of restarting the entire upload. Applications can also pause and resume multipart upload workflows. S3 Select is used to retrieve specific data from supported objects, Inventory provides object listings, and Object Lock helps prevent objects from being deleted or overwritten for configured retention requirements. Multipart Upload is therefore the appropriate feature for efficient large-object uploads.

Question 48

A developer wants to allow users to authenticate through a managed user directory and obtain tokens for accessing an application. Which AWS service is appropriate?

  1. Amazon Cognito
  2. Amazon Inspector
  3. Amazon CloudWatch
  4. Amazon Macie

Correct Answer: 1

Explanation

Amazon Cognito provides authentication and user-management capabilities for applications. Cognito user pools can manage application users and support authentication flows that provide tokens for authenticated users. These tokens can then be used with applications and APIs that require authenticated access. Cognito can reduce the need for developers to build authentication and user-management infrastructure from scratch. Amazon Inspector focuses on vulnerability management, CloudWatch provides monitoring, and Macie helps discover and protect sensitive data in S3. For managed application user authentication and token-based access, Amazon Cognito is the relevant AWS service.

Question 49

A developer needs a database that provides single-digit millisecond performance at scale for key-value application data. Which AWS service is most appropriate?

  1. Amazon Redshift
  2. Amazon DynamoDB
  3. Amazon Neptune
  4. Amazon Aurora

Correct Answer: 2

Explanation

Amazon DynamoDB is a fully managed NoSQL database designed to provide low-latency access at scale. It supports key-value and document data models and can automatically scale capacity when configured appropriately. DynamoDB is commonly used for applications requiring predictable low-latency access to individual items or collections of items. Amazon Redshift is designed primarily for data warehousing and analytics, Neptune is a graph database, and Aurora is a relational database service compatible with popular relational engines. When an application requires scalable key-value access with very low latency, DynamoDB is an appropriate choice.

Question 50

A developer needs to prevent a Lambda function from exceeding a defined number of concurrent executions. Which Lambda setting should be configured?

  1. Lambda layer size
  2. Reserved concurrency
  3. Environment variables
  4. Memory size only

Correct Answer: 2

Explanation

Lambda reserved concurrency can be configured to reserve and limit the number of concurrent executions available to a specific function. This can protect downstream systems from excessive load and ensure that a function does not consume more concurrency than intended. Reserved concurrency also guarantees that the configured amount is available to the function when needed, subject to account and Region limits. Memory size controls the amount of memory and influences CPU allocation, while layers package reusable dependencies. Environment variables provide configuration values. Therefore, reserved concurrency is the appropriate setting when execution concurrency must be controlled.

Question 51

A developer wants to automatically delete temporary DynamoDB records after a specified amount of time. Which feature should be configured?

  1. DynamoDB Streams
  2. DynamoDB TTL
  3. DynamoDB transactions
  4. DynamoDB global secondary index

Correct Answer: 2

Explanation

DynamoDB Time to Live, or TTL, allows applications to mark items for automatic expiration by storing an expiration timestamp in a designated attribute. DynamoDB uses that timestamp to identify expired items and remove them without requiring the application to issue individual delete requests. TTL is useful for temporary records such as sessions, cached information, and short-lived application data. DynamoDB Streams captures item changes, transactions provide coordinated operations across multiple items or tables, and global secondary indexes provide alternate access patterns. TTL therefore reduces the need for custom cleanup processes for data that naturally expires.

Question 52

A developer wants to expose a Lambda function through a simple HTTPS endpoint without building a complete API Gateway REST API. Which feature can be used?

  1. Lambda function URL
  2. DynamoDB endpoint
  3. S3 website endpoint only
  4. CloudWatch Logs endpoint

Correct Answer: 1

Explanation

Lambda function URLs provide a dedicated HTTPS endpoint for invoking a Lambda function directly. They can be configured with authentication controls and are useful for relatively simple HTTP-based workloads where a full API management layer is not required. Developers can use function URLs for webhooks, lightweight APIs, and simple HTTP integrations. API Gateway provides more extensive API management capabilities such as advanced routing, usage plans, and other API features. DynamoDB and CloudWatch do not provide equivalent direct HTTP endpoints for invoking arbitrary Lambda functions. A Lambda function URL can therefore simplify architectures that need straightforward HTTPS access to a function.

Question 53

A developer is using Amazon SQS and wants consumers to wait for messages instead of repeatedly polling when the queue is empty. Which feature should be enabled?

  1. Long polling
  2. Dead-letter queue
  3. Message deduplication
  4. Delay queue

Correct Answer: 1

Explanation

Amazon SQS long polling allows consumers to wait for messages to become available instead of immediately receiving an empty response when the queue has no messages. This can reduce unnecessary polling requests and lower costs while improving message retrieval efficiency. With long polling, the consumer waits for a configured period for messages to arrive. A dead-letter queue handles messages that repeatedly fail processing, message deduplication is associated with FIFO queue behavior, and delay queues postpone message visibility. Long polling is therefore the appropriate feature when the goal is to reduce empty polling responses.

Question 54

A developer needs to store application secrets securely and use customer-managed encryption keys to protect them. Which combination is appropriate?

  1. Amazon S3 and CloudFront
  2. AWS Secrets Manager and AWS KMS
  3. Amazon Route 53 and Amazon SNS
  4. Amazon DynamoDB and Amazon CloudFront

Correct Answer: 2

Explanation

AWS Secrets Manager provides secure storage and retrieval of application secrets, while AWS KMS provides managed cryptographic keys that can be used to encrypt protected information. Using these services together allows applications to store sensitive values securely while maintaining control over the encryption keys and permissions associated with them. Secrets Manager can also support automatic rotation for supported secrets. S3 and CloudFront are primarily storage and content delivery services, while Route 53 and SNS address DNS and messaging use cases. Combining Secrets Manager with KMS is appropriate when an application needs managed secret storage together with controlled encryption-key management.

Question 55

A developer wants to identify which AWS API calls were made in an account for auditing purposes. Which service should be used?

  1. AWS CloudTrail
  2. Amazon CloudFront
  3. Amazon ElastiCache
  4. Amazon EventBridge Scheduler only

Correct Answer: 1

Explanation

AWS CloudTrail records AWS account activity and API calls, providing an audit trail of actions performed through the AWS Management Console, SDKs, command-line tools, and other supported interfaces. CloudTrail records can help organizations investigate changes, troubleshoot unexpected activity, and support compliance requirements. CloudWatch focuses primarily on metrics, logs, and monitoring, while CloudFront provides content delivery and ElastiCache provides in-memory caching. CloudTrail is therefore the service designed specifically to record and track AWS API activity. Developers and administrators can use the recorded information to determine which actions occurred and which identities performed them.

Question 56

A developer is creating a DynamoDB table and needs an alternate query pattern using an attribute that is not part of the table’s primary key. Which feature should be used?

  1. DynamoDB Streams
  2. Global secondary index
  3. DynamoDB TTL
  4. Point-in-time recovery

Correct Answer: 2

Explanation

A DynamoDB global secondary index provides an alternate key structure that allows applications to query data using a different partition key and optional sort key than those defined for the base table. This is useful when application access patterns require queries based on attributes that are not part of the table’s primary key. Global secondary indexes can be created with different key attributes and can support additional query patterns. Streams are used to capture changes, TTL expires items, and point-in-time recovery provides recovery capabilities. Developers should design indexes around known access patterns because indexes also consume resources and affect write operations.

Question 57

A developer needs to deploy infrastructure repeatedly using templates that define AWS resources. Which service should be used?

  1. AWS CloudFormation
  2. Amazon CloudWatch
  3. AWS Secrets Manager
  4. Amazon SQS

Correct Answer: 1

Explanation

AWS CloudFormation enables developers to define AWS infrastructure as code using templates. Templates can describe resources such as Lambda functions, IAM roles, S3 buckets, DynamoDB tables, and many other AWS services. CloudFormation can then create and manage those resources as a stack. This approach improves repeatability and helps maintain consistent infrastructure across environments. CloudWatch is used for monitoring, Secrets Manager manages sensitive information, and SQS provides message queuing. Infrastructure as code also makes deployments easier to review, automate, and reproduce because the desired resource configuration is represented declaratively in a template.

Question 58

A developer wants an application to send a notification to many subscribers whenever a new event occurs. Which service is designed for this publish/subscribe pattern?

  1. Amazon RDS
  2. Amazon SNS
  3. Amazon ECR
  4. AWS KMS

Correct Answer: 2

Explanation

Amazon SNS is a managed publish/subscribe messaging service. An application can publish a message to an SNS topic, and the service can distribute the message to multiple subscribers. Subscribers can include SQS queues, Lambda functions, HTTP endpoints, and other supported destinations. This pattern is useful for notifications and event fanout because producers do not need to communicate directly with every consumer. RDS provides relational database capabilities, ECR stores container images, and KMS manages encryption keys. SNS is therefore appropriate when a single event needs to be distributed to multiple independent subscribers.

Question 59

A developer wants to inspect application performance and trace requests across multiple distributed AWS services. Which service should be used?

  1. Amazon Route 53
  2. AWS X-Ray
  3. Amazon S3
  4. Amazon ECR

Correct Answer: 2

Explanation

AWS X-Ray helps developers analyze and trace requests as they move through distributed applications. It can provide information about request paths, service interactions, latency, and errors across supported components. This is particularly useful for serverless and microservice architectures where a single request can pass through multiple services. X-Ray can help identify bottlenecks and understand where failures or delays occur. Route 53 provides DNS services, S3 provides object storage, and ECR stores container images. X-Ray is therefore the appropriate service when the primary requirement is distributed application tracing and performance analysis.

Question 60

A developer wants to deploy a new application version gradually to a subset of users before moving all traffic to it. Which deployment strategy is appropriate?

  1. Canary deployment
  2. Immediate replacement only
  3. Full database scan
  4. Static resource deployment

Correct Answer: 1

Explanation

A canary deployment gradually introduces a new application version to a small percentage of traffic before increasing the traffic directed to the new version. Developers can monitor metrics, errors, and application behavior during the initial phase. If the new version performs as expected, traffic can be increased progressively. If problems occur, the deployment can be stopped or rolled back before the new version reaches the entire user population. Canary strategies can reduce the impact of deployment problems and provide an opportunity to validate a release under real traffic conditions. AWS services such as Lambda and deployment tooling can support controlled traffic shifting.