AWS Associate Certified Developer - Associate 2 — Questions and Answers
Question 1: A developer needs to ensure messages in an SQS queue are processed exactly once. Which SQS feature should they use?
- Standard Queue with visibility timeout
- FIFO Queue with content-based deduplication (Correct answer)
- Dead-letter queue with redrive policy
- Long polling with message retention
Correct answer: FIFO Queue with content-based deduplication
FIFO queues with content-based deduplication use a SHA-256 hash of the message body to prevent duplicate processing.
Question 2: An application uses AWS Cognito for authentication. After a user signs in, which token is used to authorize API Gateway calls?
- Access token (Correct answer)
- Refresh token
- ID token
- SAML assertion
Correct answer: Access token
The access token contains scopes and groups and is used to authorize API calls, while the ID token contains user identity claims.
Question 3: A Lambda function must read configuration values that change infrequently. What is the MOST cost-effective approach?
- Store values in environment variables (Correct answer)
- Call SSM Parameter Store on every invocation
- Use AWS Secrets Manager with rotation
- Query a DynamoDB table on each invocation
Correct answer: Store values in environment variables
Environment variables are loaded at container initialization, avoiding per-invocation API calls and associated latency/cost.
Question 4: A developer is using the AWS SDK and receives a ThrottlingException. What retry strategy should be implemented?
- Retry immediately with the same request
- Retry with exponential backoff and jitter (Correct answer)
- Switch to a different AWS region
- Increase the request timeout value
Correct answer: Retry with exponential backoff and jitter
Exponential backoff with jitter reduces contention by spacing retries and randomizing intervals to avoid synchronized retry storms.
Question 5: Which DynamoDB feature allows a developer to read data with the lowest latency, accepting potentially stale data?
- Strongly consistent reads
- Transactional reads
- Eventually consistent reads (Correct answer)
- Global secondary index reads
Correct answer: Eventually consistent reads
Eventually consistent reads use half the read capacity units of strongly consistent reads and may return slightly stale data.
Question 6: A developer wants to test a new Lambda function version without affecting existing traffic. Which approach accomplishes this?
- Deploy to a new region
- Use Lambda aliases with traffic shifting (Correct answer)
- Create a separate IAM role
- Enable Lambda reserved concurrency
Correct answer: Use Lambda aliases with traffic shifting
Lambda aliases support weighted traffic routing, allowing a percentage of traffic to be directed to the new version for canary testing.
Question 7: An S3 bucket policy must allow a specific IAM role to perform GetObject operations. Which element in the policy specifies the allowed action?
- Resource
- Principal
- Action (Correct answer)
- Condition
Correct answer: Action
The Action element specifies which S3 API operations are permitted, such as s3:GetObject.
A developer needs to ensure messages in an SQS queue are processed exactly once.
Which SQS feature should they use?