Every Exam PrepFREE EXAM PREP
Ask AI

AWS Developer Associate (DVA-C02) Practice Test

160 free AWS Developer Associate (DVA-C02) practice questions with answers and explanations.

No signup required.

The AWS Developer Associate (DVA-C02) exam is administered by Amazon Web Services (AWS), with 65 scored questions, a time limit of 2 hours 10 minutes and a 720/1000 result.

About these practice questions
Verified against the official content outline

These are original study questions written from published exam objectives—not recalled, copied, or confidential live-exam items. Always confirm current coverage with the official sources linked on this page.

Difficulty
QUESTION 1 / 100DeploymentMedium0/0
An Elastic Beanstalk environment must never serve a mixture of old and new application versions, and a failed deployment must leave the running instances untouched. Which deployment policy fits?
0/0session
Browse all questions & answers

Loading the remaining 60 questions…

Deployment

17 questions
  1. 1. An Elastic Beanstalk environment must never serve a mixture of old and new application versions, and a failed deployment must leave the running instances untouched. Which deployment policy fits?

    • A. Immutable, which launches a full set of new instances in a separate Auto Scaling group and terminates them if unhealthy
    • B. Rolling with an additional batch, which launches one extra batch of instances first so environment capacity is never reduced
    • C. All at once, which replaces the application on every instance simultaneously so no mixed state exists
    • D. Rolling, which takes one batch out of service at a time and leaves the rest serving the old version
    Show answer & explanation

    Answer: A
    An immutable deployment launches a complete set of new instances in a separate Auto Scaling group alongside the existing ones and, if the new instances fail health checks, terminates them and leaves the original instances untouched. Rolling (D) and rolling with an additional batch (B) both deploy in batches, so completed batches serve the new version while pending batches serve the old one. All at once (C) takes every instance out of service briefly and, on failure, leaves the environment broken rather than intact.

  2. 2. A developer needs to make an EC2-hosted application connect to a private RDS database that lives in a different VPC within the same AWS Region, without traversing the public internet and without using a NAT gateway or VPN. Which AWS networking feature is the best fit?

    • A. An interface VPC endpoint (AWS PrivateLink) for the rds.amazonaws.com API in the EC2 instance's VPC, with private DNS names enabled
    • B. A gateway VPC endpoint for Amazon RDS in the EC2 subnet's route table, since gateway endpoints are free of charge
    • C. An RDS read replica created in the EC2 instance's VPC, with the application pointed at the replica's endpoint
    • D. VPC peering connection between the two VPCs, with route table entries directing traffic to the peered CIDR range
    Show answer & explanation

    Answer: D
    A VPC peering connection links two VPCs with non-overlapping CIDR blocks so that instances communicate over private IP addresses across the AWS network; after both sides add routes to the peer CIDR and the RDS security group allows the instance, traffic never crosses the internet, a NAT gateway or a VPN. Option A reaches the RDS control-plane API (DescribeDBInstances and similar), not the database's TCP endpoint; PrivateLink does not connect you to a database listener in another VPC. Option B does not exist: gateway endpoints are available only for Amazon S3 and DynamoDB. Option C gives the application a read-only copy; writes would still have to reach the primary in the other VPC, which is the problem the question is asking you to solve.

  3. 3. A deployment must shift traffic gradually to a new version and roll back automatically if error rates rise. Which deployment strategy is this?

    • A. In-place deployment with the CodeDeployDefault.OneAtATime configuration and a manual rollback command
    • B. Blue/green with an all-at-once traffic reroute after a 5-minute wait on the new fleet
    • C. Canary or linear traffic shifting with automated rollback triggered by alarm state
    • D. Immutable deployment recreating the whole environment from scratch each release
    Show answer & explanation

    Answer: C
    Canary (a small first increment, then the rest after an interval) and linear (equal increments at fixed intervals) traffic shifting expose only part of the traffic to the new version while metrics are watched, and CodeDeploy rolls back automatically when an alarm attached to the deployment fires; blue/green switches everything at once and offers fast rollback without gradual exposure. Option A updates instances one by one in place with no traffic percentage control, and rollback depends on a human noticing and acting. Option B provisions a parallel fleet but moves 100 percent of traffic in one step after the wait; it is not gradual and the rollback described is manual. Option D replaces the fleet but says nothing about shifting traffic in steps or rolling back on an alarm, which are the two properties the question asks for.

  4. 4. A team defines infrastructure declaratively so environments can be recreated identically. What benefit does this provide beyond automation?

    • A. The infrastructure becomes immune to configuration drift, because CloudFormation rejects console or CLI changes to resources it manages
    • B. The infrastructure definition becomes reviewable and version-controlled, so changes carry the same history and approval as application code
    • C. The infrastructure no longer needs integration testing, because a template that passes cfn-lint is guaranteed to deploy without errors
    • D. The underlying resources stop incurring charges between deployments, because a template only bills while a stack update is running
    Show answer & explanation

    Answer: B
    Infrastructure as code turns environment changes into commits: they are diffed, peer reviewed, versioned and revertible, and a change set shows what a deployment will do before it runs. Drift is still possible when someone changes a resource outside the tooling, which is why CloudFormation offers drift detection to find and correct it. Option A overstates the control: CloudFormation does not block out-of-band changes; drift detection reports them (MODIFIED, DELETED, IN_SYNC) after the fact. Option C confuses linting with testing; cfn-lint checks template syntax and some rules, but a valid template can still fail at deploy time or produce infrastructure that does not behave as intended. Option D misunderstands billing; the resources a template creates are billed the same as resources created any other way.

  5. 5. An application's configuration differs between development, staging and production. What is the recommended approach?

    • A. Externalizing configuration into a parameter or configuration service resolved at runtime by environment, so one artifact deploys everywhere
    • B. Editing the configuration directly on each server after deployment and recording the change in a CloudTrail-backed change ticket for auditability
    • C. Maintaining a Git branch per environment with its own configuration files, merging development into staging and staging into production
    • D. Building one deployment artifact per environment with the values compiled in, so each build is tested against exactly the configuration it will run with
    Show answer & explanation

    Answer: A
    Keeping environment-specific values in Systems Manager Parameter Store, AWS AppConfig or Secrets Manager and resolving them at startup means the artifact promoted to production is byte-for-byte the one that passed staging; only the configuration differs, and it can be changed and audited without a rebuild. Option D means the production binary is a different build from the one that was tested, so a dependency or toolchain difference can reach production untested. Option C lets the branches diverge over time, mixes configuration changes with code changes in every merge, and still produces a different build per environment. Option B leaves servers in states nobody can reproduce; CloudTrail records AWS API calls, not edits made over SSH, so the ticket documents intent rather than what is actually running.

  6. 6. A containerized application must be deployed with a new image version. What practice avoids ambiguity about what is running?

    • A. Always deploying the latest tag, since ECR refuses a push that would move it to a different image digest
    • B. Rebuilding the image on each host at deployment time from the same Dockerfile and base image
    • C. Enabling ECR image scanning on push so that only vulnerability-free images receive the tag
    • D. Referencing an immutable image tag or digest rather than a mutable tag such as latest
    Show answer & explanation

    Answer: D
    A mutable tag such as latest can point at different content over time, so two hosts pulling the same tag may run different code and a rollback may not return to the previous state. Pinning a unique version tag or the sha256 digest (and turning on tag immutability in ECR) makes what is running unambiguous and reproducible. Option A is wrong about ECR, which lets a mutable tag move to a new digest on every push unless tag immutability is enabled on the repository; that is the ambiguity being avoided. Option B produces a different image on every host, because base image and package resolution can change between builds; nothing guarantees the hosts run identical code. Option C is a security control, not an identity control; scanning does not fix the fact that a tag can be reassigned.

  7. 7. A build pipeline produces an artifact that fails only in production. What practice most reduces this class of problem?

    • A. Rebuilding from source at each environment boundary so that every environment's dependencies are resolved against its own base image
    • B. Promoting the identical artifact through each environment and keeping environment differences to externalized configuration
    • C. Testing only in production behind a feature flag, since it is the only environment whose configuration is certain to match
    • D. Reducing the number of tests in the pipeline so builds reach production before dependency versions can drift
    Show answer & explanation

    Answer: B
    Failures that appear only in production live in the differences between environments; promoting one immutable artifact (the same zip, container digest or CloudFormation package) through development, staging and production removes the build itself as a variable and confines every remaining difference to configuration that can be compared. Option A reintroduces the variable being eliminated; dependency resolution or toolchain versions can differ between the tested build and the deployed one. Option C removes the safety net; a feature flag limits blast radius but does not test the artifact before real users hit it. Option D trades away verification for speed and misdiagnoses the cause, which is environment difference rather than the time between build and deploy.

  8. 8. A developer must roll back a deployment quickly after a defect reaches production. What makes rollback reliable?

    • A. Reverting the source commit and waiting for the pipeline to rebuild, test and redeploy the previous version
    • B. Restoring the database from the most recent automated snapshot and then redeploying the current artifact
    • C. Retaining the previous artifact version and ensuring database changes are backward compatible with it
    • D. Editing the deployed code on each instance by hand, since a hotfix is faster than any redeployment
    Show answer & explanation

    Answer: C
    Rollback is only quick if the previous artifact is still available to redeploy (a kept Lambda version, container digest or S3 object) and only safe if the schema migration that shipped with the release still works with the old code, which is why expand-and-contract migrations are the enabling practice. Option A is the slow path at exactly the moment speed matters most; a rebuild and full pipeline run can take far longer than redeploying a retained artifact. Option B throws away every transaction since the snapshot and keeps the defective code running; it is data loss, not rollback. Option D produces inconsistent servers with no record of what runs where, and the next automated deployment overwrites the edits.

  9. 9. A developer discovers that a deployed function's environment variable containing a value was changed manually in the console. What is the risk?

    • A. The deployed state no longer matches the declared configuration, so the next automated deployment silently reverts the change
    • B. The function is marked as drifted and refuses to execute until drift detection is run and the stack is updated
    • C. The change is written back to the source repository by CloudFormation, creating an unreviewed commit on the main branch
    • D. There is no risk, because CloudFormation treats the console value as authoritative and updates the template to match on the next deploy
    Show answer & explanation

    Answer: A
    An out-of-band edit creates drift between the running configuration and the declared one; the pipeline knows nothing about it, so the next deployment applies the template's value and silently undoes the change, a confusing failure because the system worked until an unrelated release. The fix is to change the declared configuration and deploy it. Option B misstates both facts: the function keeps running with the edited value, and drift detection only reports MODIFIED resources, it never blocks execution. Option C invents a write-back; CloudFormation does not modify source repositories and drift is not propagated anywhere automatically. Option D has the direction backwards: the template is the source of truth and its value overwrites the console change on the next deployment.

  10. 10. A team is deploying a new version of a Lambda-backed API and wants to gradually shift a small percentage of production traffic to the new version, monitoring error rates before shifting all traffic, with automatic rollback if CloudWatch alarms trigger. Which AWS deployment approach fits this best?

    • A. AWS Elastic Beanstalk traffic-splitting deployments applied to the Lambda function, sending 10 percent of sessions to the new version for 5 minutes
    • B. AWS CodeDeploy with a Lambda deployment configuration using canary or linear traffic shifting and CloudWatch alarm rollback
    • C. An Amazon API Gateway canary release on the stage, pointing the canary at the function's $LATEST version and promoting it when the stage's 5XX alarm stays OK
    • D. A Lambda alias with weighted routing between two versions, updated by hand from 10 to 100 percent after the team reviews the Errors metric
    Show answer & explanation

    Answer: B
    CodeDeploy's Lambda compute platform shifts alias traffic with predefined canary (for example Canary10Percent5Minutes) or linear (Linear10PercentEvery1Minute) configurations, runs optional pre- and post-traffic hooks, and rolls back automatically when a CloudWatch alarm attached to the deployment group fires; AWS SAM exposes the same mechanism through DeploymentPreference. Option A applies only to Elastic Beanstalk EC2 environments behind an Application Load Balancer; Elastic Beanstalk does not deploy Lambda functions. Option C shifts traffic between API Gateway stage deployments, not between Lambda versions, and API Gateway has no automatic rollback tied to an alarm; $LATEST is also the unpublished version, which should not receive canary traffic. Option D is manual: someone has to watch the metric and move the weights, and nothing rolls the alias back automatically when errors rise.

  11. 11. A developer wants to define their application's AWS resources — a Lambda function, an API Gateway API, and a DynamoDB table — as code, and deploy them together as a single versioned unit that can be repeatedly and consistently redeployed across environments. Which AWS service is designed for this?

    • A. AWS Systems Manager Automation runbooks with approval steps
    • B. AWS Elastic Beanstalk saved configurations per environment
    • C. AWS Config conformance packs applied to each account
    • D. AWS CloudFormation (or the AWS SAM framework built on top of it)
    Show answer & explanation

    Answer: D
    CloudFormation provisions a set of related resources from a template as one stack that can be versioned, diffed with change sets, updated and rolled back; AWS SAM adds serverless resource types (AWS::Serverless::Function, Api, SimpleTable) that transform into CloudFormation, so a Lambda function, API and DynamoDB table deploy together as one unit. Option A runs procedural steps against existing resources with an approval workflow; it is not a declarative, versioned definition of a stack of resources. Option B captures the settings of an Elastic Beanstalk environment (instances, load balancer, platform) and cannot define a Lambda function, an API Gateway API or a DynamoDB table. Option C packages AWS Config rules that evaluate whether resources comply with policy after they exist; conformance packs do not create application resources.

  12. 12. A team uses AWS Elastic Beanstalk to host a web application and needs zero-downtime deployments where a full new set of instances is provisioned, verified healthy, and then production traffic is switched over — allowing an immediate rollback by switching back if problems are found. Which Elastic Beanstalk deployment policy matches this description?

    • A. Blue/green using a swap of environment URLs (CNAME swap) between a new and existing environment
    • B. Immutable, which launches a full set of new instances in a second Auto Scaling group inside the same environment before terminating the old ones
    • C. Rolling with additional batch, which launches one extra batch of new instances first so that capacity never drops while each batch is updated in place
    • D. Traffic splitting, which sends a configured percentage of new client sessions to a temporary Auto Scaling group for an evaluation period
    Show answer & explanation

    Answer: A
    Blue/green in Elastic Beanstalk means deploying the new version to a separate environment, testing it, and then choosing Swap environment URLs so the CNAME records of the two environments are exchanged; traffic moves instantly and swapping back is the rollback, which is the only option that keeps two independently addressable environments. Option B does provision a fresh fleet, but inside the existing environment with a single URL; there is no second environment to swap back to, and rollback means another deployment. Option C updates the existing instances batch by batch in place; it maintains capacity during the update but never provisions a complete parallel set of instances. Option D is Elastic Beanstalk's canary test within one environment (it requires an Application Load Balancer); traffic is split gradually rather than switched, and there is no URL swap.

  13. 13. A CI/CD pipeline built with AWS CodePipeline needs to run unit tests and build a deployment artifact from source code before deploying it. Which AWS service is typically used as the build stage within CodePipeline to compile code and run tests?

    • A. Amazon EventBridge
    • B. AWS Direct Connect
    • C. AWS CodeBuild
    • D. AWS CodeCommit
    Show answer & explanation

    Answer: C
    CodeBuild is a managed build service that compiles source code, runs tests, and produces deployment-ready artifacts, and it's the standard build-stage action integrated into CodePipeline. CodeCommit (D) is a managed Git source-control repository service, used for storing source code, not for building or testing it. EventBridge (A) is an event bus for routing events between AWS services and applications, not a build/test execution service. Direct Connect (B) is a dedicated network connection service between on-premises and AWS, entirely unrelated to CI/CD build processes.

  14. 14. A team wants their CodePipeline deployment to automatically pause and require a manual approval action before the production deployment stage runs, so a release manager can review changes first. How can this be configured?

    • A. Disable the inbound transition into the production stage and have the release manager re-enable it after reviewing each change
    • B. Insert a CodeBuild action that polls an SNS topic and fails until an approval message is published
    • C. Configure an EventBridge rule on the pipeline's Stage Execution State Change event to call StopPipelineExecution before production
    • D. Add a manual approval action to the pipeline stage immediately before the production deployment stage
    Show answer & explanation

    Answer: D
    A manual approval action is a built-in CodePipeline action type: the execution stops at the action, optionally publishes an SNS notification with a review URL and comments, and resumes when someone with codepipeline:PutApprovalResult approves; if nobody responds within seven days the action fails. Option A is a coarse on/off switch for the whole stage rather than a per-execution approval: once re-enabled it lets every queued and subsequent revision through, and it records no approver, comment or timeout. Option B burns build minutes polling and gives the release manager nothing to review in the console; it is a fragile imitation of a feature CodePipeline already provides. Option C stops the execution outside the pipeline's own control flow; a stopped execution does not resume with an approval, and no review link or approver record is produced.

  15. 15. A team wants to deploy updates to an application running on Amazon ECS behind an Application Load Balancer with zero downtime, automatically running new task definitions alongside old ones and shifting traffic once health checks pass, with the ability to roll back automatically on failed health checks. Which deployment controller/service integration fits this best?

    • A. AWS Direct Connect with a redundant virtual interface
    • B. ECS with AWS CodeDeploy blue/green deployment integration
    • C. Manually stopping all running tasks and starting new ones in a single step with no health check gating
    • D. Amazon S3 static website hosting with versioned objects
    Show answer & explanation

    Answer: B
    ECS's CodeDeploy blue/green deployment integration provisions a new (green) task set alongside the running (blue) one, uses ALB target group health checks to validate the new set, shifts traffic over, and can automatically roll back if health checks or CloudWatch alarms fail — matching every requirement described. Manually stopping and starting all tasks at once (C) causes downtime and provides no automated health-check gating or rollback. S3 static website hosting (D) serves static files and is unrelated to container orchestration or ECS deployments. Direct Connect (A) is a dedicated network link between on-premises infrastructure and AWS, entirely unrelated to application deployment strategy.

  16. 16. A developer wants CloudFormation to automatically undo all resource changes if a stack update fails partway through, returning the stack to its last known good state without manual intervention. Which CloudFormation behavior provides this by default?

    • A. Drift detection
    • B. Nested stack change sets executed in DisableRollback=true mode
    • C. Automatic rollback on stack update failure
    • D. Stack termination protection
    Show answer & explanation

    Answer: C
    By default, if a CloudFormation stack update fails, CloudFormation automatically rolls back the changes to restore the stack to its last successful state, requiring no manual intervention. Stack termination protection (D) simply prevents a stack from being accidentally deleted, it has nothing to do with handling failed updates. Drift detection (A) identifies when actual resource configuration has diverged from the stack's template, it does not perform any rollback action. Explicitly setting DisableRollback=true (B) would do the opposite of what's needed — it prevents automatic rollback, leaving the stack in a partially updated/failed state for manual troubleshooting.

  17. 17. A company's Lambda function needs to access resources in a private VPC subnet (such as an RDS instance with no public endpoint) but must also be able to call public AWS service endpoints like DynamoDB and S3. What must the developer configure to satisfy both requirements?

    • A. Attach the Lambda function to the private VPC/subnets with an appropriate security group, and provide outbound connectivity to AWS public services via a NAT gateway or VPC endpoints
    • B. Attach the Lambda function to a public subnet with an internet gateway route and auto-assign public IPv4 enabled, so its ENI receives a public address that reaches DynamoDB and S3 directly
    • C. Attach the Lambda function to the private subnets and add the AWSLambdaVPCAccessExecutionRole managed policy, which grants the function's ENIs internet egress through the Lambda-managed VPC
    • D. Keep the function outside the VPC and enable public accessibility on the RDS instance with a security group rule for the Lambda service's IP ranges
    Show answer & explanation

    Answer: A
    Once a function is attached to a VPC it can reach only what that VPC can reach, so the private RDS instance is accessible but public AWS endpoints are not; the documented answer is a NAT gateway in a public subnet or, cheaper and more direct, a gateway endpoint for S3 and DynamoDB (or interface endpoints for other services), with a security group that allows the required traffic. Option B does not work: Lambda's documentation states that connecting a function to a public subnet gives it neither internet access nor a public IP address; the ENI is always private. Option C misreads the managed policy, which only lets the Lambda service create and manage the network interfaces (ec2:CreateNetworkInterface and related actions); it provides no route to the internet. Option D abandons the private-connectivity requirement by exposing the database publicly, and Lambda has no published set of IP ranges to allow in a security group.

Troubleshooting and Optimization

13 questions
  1. 18. A Lambda function that queries an RDS database is experiencing intermittent 'too many connections' errors under moderate concurrent load, even though the function's own logic is correct. What is the most likely root cause and appropriate fix?

    • A. Each concurrent Lambda execution environment opens its own database connection, and without a connection pooler such as RDS Proxy the number of concurrent connections can exceed the database's connection limit
    • B. The function's execution role lacks the rds-db:connect permission needed for IAM database authentication, so the database rejects each new session with 'too many connections' until the policy is corrected
    • C. Lambda is reusing one frozen connection across all concurrent invocations, so the database sees a single client holding every slot; setting reserved concurrency to 1 releases the extra connections
    • D. The database's max_connections parameter is being consumed by RDS Performance Insights and Enhanced Monitoring agents; disabling both features frees the connection slots the function needs
    Show answer & explanation

    Answer: A
    Lambda scales by adding execution environments, and each one that initializes a database client holds its own connection, so a burst of concurrency can open more connections than the instance class allows. RDS Proxy pools and multiplexes those connections in front of the database, which is the recommended fix for serverless clients. Option B would produce an authentication or access-denied error, not 'too many connections'; a missing IAM permission never consumes a connection slot. Option C describes the opposite of how Lambda works: environments never share a connection, and throttling the function to a single environment would cripple the application rather than fix the root cause. Option D blames monitoring features that do not hold client connections; the connections are coming from the many concurrent function environments.

  2. 19. A developer notices that a Lambda function has high p99 latency only on the first invocation after periods of inactivity, but subsequent invocations are fast. What AWS Lambda concept explains this pattern, and what is a common way to mitigate it for latency-sensitive workloads?

    • A. Execution environment recycling every few hours; raising the function timeout to its 15-minute maximum keeps the environment alive between invocations
    • B. Cold starts caused by new execution environment initialization; provisioned concurrency can keep initialized environments warm and ready
    • C. Lambda's concurrency scaling rate of 1,000 environments every 10 seconds; setting reserved concurrency to 1 pins a single environment in place
    • D. ENI creation for VPC-attached functions on each invocation; moving the function to a public subnet gives it a persistent network interface
    Show answer & explanation

    Answer: B
    The first request after idle time lands on a new execution environment, so Lambda must download the code, start the runtime and run the initialization code before the handler; that Init phase is the cold start. Provisioned concurrency keeps a configured number of environments initialized, so those requests skip the cold start (SnapStart is an alternative for Java, Python and .NET). Option A confuses the invocation timeout with environment lifetime; the timeout bounds one invocation and has no effect on how long an idle environment is kept. Option C misapplies two concurrency controls: the scaling rate governs bursts, and reserved concurrency caps how many environments may run without keeping any of them warm. Option D is outdated and wrong: Hyperplane ENIs are created when the VPC configuration is saved and shared by environments, and a public subnet gives a Lambda function neither a public IP nor faster starts.

  3. 20. A developer is debugging a distributed serverless application spanning API Gateway, Lambda, and DynamoDB, and wants a single view showing the full request path with latency at each hop to identify which component is the bottleneck. Which combination of instrumentation is most appropriate?

    • A. Enable API Gateway execution logging at INFO with full request data and correlate $context.requestId with the Lambda REPORT line and DynamoDB CloudTrail data events
    • B. Enable CloudWatch Lambda Insights and Contributor Insights for DynamoDB, which together render the API Gateway to Lambda to DynamoDB path with per-hop latency
    • C. Enable VPC Flow Logs on the subnets used by the Lambda function and query the packet timestamps between the API Gateway, Lambda and DynamoDB endpoints
    • D. Enable AWS X-Ray active tracing on API Gateway and Lambda, and ensure the DynamoDB SDK calls are instrumented so they appear as subsegments in the trace
    Show answer & explanation

    Answer: D
    X-Ray builds one trace per request: API Gateway with active tracing emits the first segment and propagates the X-Amzn-Trace-Id header, the Lambda service and function add their segments, and an instrumented DynamoDB client records a subsegment for each call, so the trace timeline and service map show the latency of every hop side by side. Option A requires stitching three different log sources together by hand and still yields no per-hop timing; CloudTrail data events record that a DynamoDB call happened, not how long it took. Option B misdescribes both features: Lambda Insights reports CPU, memory and network for the function, and Contributor Insights shows the most accessed keys in a table; neither draws a request path. Option C captures IP-level flow metadata for traffic in your VPC; API Gateway and the DynamoDB service endpoint are not in that path, and flow logs never show application request latency.

  4. 21. A developer instruments an application with distributed tracing. What does it provide that logs alone do not?

    • A. A per-minute count of requests, errors and throttles for each service, aggregated into CloudWatch metrics with 15-month retention
    • B. A record of every AWS API call made by each service's role, including caller identity and source IP, retained for 90 days
    • C. A line-by-line profile of CPU time inside the handler code, sampled every 10 ms and attributed to the source file and function
    • D. A connected view of a single request's path across services with timing at each segment, revealing where latency accumulates
    Show answer & explanation

    Answer: D
    A trace collects the segments and subsegments that one request generated across services and shows them on a timeline, so you can see which downstream call accounts for the latency; logs scattered across services cannot reconstruct that path without a shared correlation ID and manual joining. Option A describes metrics: they show how many requests were slow or failed per service, not the path of one request or where inside it the time went. Option B describes CloudTrail event history; it is an audit record of control-plane and some data-plane calls and carries no request latency. Option C describes a code profiler, which shows where CPU time goes inside one process; it cannot follow a request into another service.

  5. 22. A developer adds structured logging to a service. What advantage does structured output have over free-text log lines?

    • A. Fields can be queried, filtered and aggregated directly, rather than requiring pattern matching against arbitrary text
    • B. Structured entries are stored in the Infrequent Access log class automatically, cutting the ingestion cost by half for every function
    • C. Structured entries are compressed before ingestion, so CloudWatch Logs bills them at a lower per-gigabyte rate than free-text lines
    • D. Structured entries are exempt from the 256 KB event size limit and from the retention setting until they are queried
    Show answer & explanation

    Answer: A
    Emitting JSON fields lets CloudWatch Logs Insights discover the fields and filter, aggregate and chart on them (for example, stats avg(duration) by route), and lets metric filters match on field values, without regular expressions that break whenever a message is reworded; the trade-off is more bytes per entry, not fewer. Option B confuses format with storage class; the log class is chosen when the log group is created and cannot be changed, and it is unrelated to how entries are formatted. Option C invents a pricing rule; ingestion is billed per gigabyte regardless of format, and JSON entries are usually larger than the equivalent sentence. Option D invents exemptions; the 256 KB event limit and the retention policy apply to every event in the log group.

  6. 23. A function's execution duration is close to its configured timeout and occasionally exceeds it. What should be evaluated first?

    • A. Whether the function's memory is below 1,769 MB, since a function with less than one full vCPU cannot finish inside a 15-minute timeout
    • B. Whether the function's execution role has too many attached policies, since IAM policy evaluation time counts toward the timeout
    • C. Whether a downstream call lacks its own timeout, since an unbounded dependency can consume the entire execution budget
    • D. Whether the deployment package exceeds 50 MB zipped, since Lambda re-downloads oversized packages on every invocation
    Show answer & explanation

    Answer: C
    A dependency call without a client-side timeout can hang until the function itself is killed, which turns a slow downstream call into a hard failure with no useful error. Setting the SDK or HTTP client timeout below the function timeout lets the code catch the failure, retry or degrade, and return something meaningful. Option A misuses a real number: 1,769 MB is where a function gets one full vCPU, but smaller functions finish fine; memory affects speed, not the ability to complete. Option B invents an overhead; IAM authorization happens before the invocation starts and does not consume the function's execution time. Option D is wrong twice: 50 MB is the limit for direct upload, not a performance threshold, and code is downloaded once per execution environment, not per invocation.

  7. 24. A function's memory allocation is increased and its execution time falls. Why does this occur?

    • A. Higher memory settings move the function onto Graviton processors, which finish the same code faster at a lower per-millisecond price than x86
    • B. CPU and other resources are allocated proportionally to memory, so raising memory can shorten duration and sometimes reduce total cost
    • C. Higher memory settings extend the execution environment's lifetime, so more invocations land on a warm environment and skip the Init phase
    • D. Higher memory settings raise the ephemeral /tmp allocation, so the function spends less time evicting cached files
    Show answer & explanation

    Answer: B
    Lambda allocates CPU in proportion to memory (a function reaches one full vCPU at 1,769 MB), so a CPU-bound function runs faster with more memory, and because billing is memory multiplied by duration the shorter run can cost the same or less; the optimum is found by measuring, for example with the Lambda Power Tuning tool. Option A confuses two independent settings; the architecture (x86_64 or arm64) is chosen separately from memory, and memory never moves a function between processor types. Option C invents a relationship; how long Lambda keeps an idle environment is not controlled by the memory setting, and a warm start does not shorten the handler's own work. Option D is wrong because /tmp size is configured independently (512 MB to 10,240 MB) and has nothing to do with how fast the handler's code executes.

  8. 25. A developer needs to fetch a specific set of attributes from many items with known keys in one round trip. Which operation is appropriate?

    • A. A parallel Scan with a FilterExpression on the key attribute and TotalSegments set equal to the number of items wanted
    • B. A batch get operation retrieving multiple items by key, with a projection limiting the attributes returned
    • C. A TransactGetItems call, which retrieves up to 100 items and costs one read capacity unit per item, the same as a batch get
    • D. A Query against a global secondary index for each key, issued in parallel and merged in the application code
    Show answer & explanation

    Answer: B
    BatchGetItem fetches up to 100 items (16 MB) by primary key in one request, retrieving them in parallel, and a ProjectionExpression returns only the attributes you name; any keys returned in UnprocessedKeys are retried with backoff. Option A reads and pays for the entire table before filtering, so its cost grows with table size regardless of how few items match; a scan is the most expensive way to answer a key-based lookup. Option C does retrieve up to 100 items, but it is the wrong tool and the cost claim is false: transactions perform two underlying reads per item, and they exist for a consistent snapshot, not for bulk retrieval. Option D issues one request per key and requires an index that is unnecessary when the primary keys are already known.

  9. 26. A Lambda function that processes DynamoDB Streams records is falling behind, and CloudWatch shows the IteratorAge metric steadily increasing. What does a rising IteratorAge most directly indicate, and what is a reasonable first remediation step?

    • A. Records are expiring from the stream's 24-hour retention window before the function reads them; enabling point-in-time recovery on the table extends the window to 35 days
    • B. The consumer Lambda function is not processing records as fast as they arrive; increasing the function's concurrency or batch processing efficiency is a reasonable first step
    • C. The function's batch reads are being throttled against the table's provisioned read capacity; lowering BatchSize to 1 and adding read capacity units to the table will clear the backlog
    • D. The event source mapping's shard iterator has expired because it was created with the LATEST starting position; deleting and re-creating the mapping with TRIM_HORIZON resets the metric
    Show answer & explanation

    Answer: B
    IteratorAge is the age of the last record in a batch when Lambda reads it, so a steadily rising value means records are being written faster than the consumer drains them. Raising ParallelizationFactor (1 to 10 concurrent batches per shard, still ordered per item), making each batch cheaper to process, or filtering unneeded events are the documented first responses. Option A confuses two features: DynamoDB Streams records do live for 24 hours, but point-in-time recovery is a backup feature for the table and has no effect on stream retention or on the consumer's lag. Option C is wrong because reading a DynamoDB stream does not consume the table's read capacity units, and a batch size of 1 makes the function process fewer records per invocation, so the lag grows. Option D would make the metric worse, not better: re-creating the mapping at TRIM_HORIZON re-reads the oldest retained records, and the starting position has nothing to do with sustained lag.

  10. 27. An application's Lambda function frequently receives a 'Rate Exceeded' throttling error when calling a downstream AWS service API directly via the SDK. What is the recommended coding pattern to handle this gracefully instead of failing immediately?

    • A. Set AWS_MAX_ATTEMPTS to 1 and AWS_RETRY_MODE to legacy so the SDK returns the throttling error immediately to the caller
    • B. Retry the call at a fixed 50 ms interval up to 20 times, since the SDK's standard retry mode already adds the required jitter on the caller's behalf
    • C. Raise the function's reserved concurrency so more execution environments spread the calls across the service
    • D. Implement exponential backoff with jitter when retrying the throttled API call, ideally using the SDK's built-in retry configuration
    Show answer & explanation

    Answer: D
    Throttling means the service is asking the caller to slow down. Exponential backoff with full jitter spreads retries over a widening random window (the SDK's standard mode makes 3 attempts by default, with a 1,000 ms base delay for throttling errors and a 20-second cap), which lets the service recover instead of being hit by synchronized retries. Option A turns retries off entirely, so every throttled call fails on the first attempt, and legacy mode exists only for backward compatibility. Option B is a tight fixed-interval loop that ignores backoff and misreads standard mode: the SDK's jitter applies to the SDK's own retries, not to a loop the application writes around them. Option C adds callers, which increases the request rate against a service that is already rejecting requests; the downstream quota is independent of the function's concurrency.

  11. 28. A developer must distinguish between a 4xx and a 5xx response from a service API. What does each indicate about retry behavior?

    • A. 4xx indicates the request was accepted but is still processing and should be polled again, while 5xx indicates a permanent outage that must never be retried
    • B. 4xx indicates a signing or clock-skew failure that the SDK repairs by refreshing credentials, while 5xx indicates the caller's payload exceeded a size quota
    • C. 4xx generally indicates a client-side problem that retrying will not fix, except throttling, while 5xx indicates a server-side condition that is often worth retrying
    • D. Both classes are retried identically by the SDK's standard mode, which makes 3 attempts with a 20-second backoff cap regardless of whether the error is 4xx or 5xx
    Show answer & explanation

    Answer: C
    The SDKs classify errors by code: validation, access-denied and not-found errors (4xx) are returned immediately because retrying cannot fix the request, throttling errors (also 4xx) are retried with a longer backoff, and 500, 502, 503 and 504 responses are treated as transient and retried; retry logic must therefore inspect the error code, not just the status class. Option A misdescribes both classes: 4xx means the request itself was rejected, and 5xx errors are the ones most often transient and worth retrying. Option B invents meanings; a signature or clock-skew problem is one specific 4xx cause among many, and an oversized payload is reported as a 4xx validation error, not a 5xx. Option D is wrong about the SDK, which returns non-retryable 4xx errors such as ValidationException immediately and applies the 3-attempt backoff only to transient and throttling errors.

  12. 29. A serverless application's Lambda function occasionally times out when calling a downstream third-party HTTP API. The developer wants to understand exactly how much time is spent in the Lambda function's own code versus waiting on the external HTTP call, across many invocations. Which AWS service is best suited to visualize this breakdown?

    • A. CloudWatch Lambda Insights, which reports CPU, memory and network use per invocation
    • B. Logs Insights queries over the REPORT line's Duration and Billed Duration fields
    • C. AWS CloudTrail Lake queries joining the Lambda Invoke event with the third-party API's HTTP calls made during the invocation
    • D. AWS X-Ray with the X-Ray SDK instrumenting the outbound HTTP call as a subsegment
    Show answer & explanation

    Answer: D
    With active tracing on the function and the X-Ray SDK wrapping the outbound HTTP client, each trace shows the function segment with a subsegment for the downstream call, so the time inside the handler and the time waiting on the third-party API are separated per request and aggregated on the service map. Option A gives resource-level metrics (CPU, memory, network) per invocation; it does not attribute wall-clock time to an individual outbound call. Option B shows only the total duration of each invocation; the REPORT line has no breakdown of where inside the invocation the time went. Option C records AWS API activity, not HTTP calls to a third-party endpoint, and carries no latency data for them.

  13. 30. A NoSQL query returns fewer items than expected along with a pagination token. What does this mean?

    • A. The result set exceeded the response size limit, and the caller must issue further requests using the token to retrieve remaining items
    • B. The table's provisioned read capacity was exhausted midway, and the token lets the caller resume once the 1-minute throttling window has passed
    • C. The items after the token are stored in a global secondary index, and the caller must repeat the query against that index to retrieve them
    • D. The query's FilterExpression removed the remaining items, and the token confirms that no further matching data exists in the table
    Show answer & explanation

    Answer: A
    Query and Scan return at most 1 MB of data per call (or the number set by Limit) and include LastEvaluatedKey when they stopped at a page boundary; the caller passes it as ExclusiveStartKey until a response has no LastEvaluatedKey. Treating the first page as the whole result silently drops data as the table grows. Option B confuses pagination with throttling; exceeding capacity raises ProvisionedThroughputExceededException, and pagination tokens are returned on successful reads. Option C invents a storage split; a table's items are not moved to an index, and a query returns items from whatever table or index it was issued against. Option D gets the token's meaning backwards: because the filter is applied after the 1 MB read, a page can even return zero items and still carry a LastEvaluatedKey, which means keep paging.

Development with AWS Services

51 questions
  1. 31. A function processes messages from a queue and occasionally fails. What configuration prevents a persistently failing message from blocking the queue indefinitely?

    • A. A dead-letter queue configured on the Lambda function's asynchronous invocation settings, which also covers messages from SQS event source mappings
    • B. A visibility timeout of 12 hours on the queue, so a failing message stays hidden until the defect is fixed and redeployed
    • C. A dead-letter queue with a maximum receive count, so a message exceeding the threshold is moved aside for separate investigation
    • D. A message retention period of 14 days with a 15-minute delivery delay, so failing messages age out of the queue
    Show answer & explanation

    Answer: C
    A redrive policy on the source queue with a maximum receive count moves a message to the dead-letter queue after that many failed receives, so a poison message stops being redelivered and can be inspected or redriven later while healthy messages keep flowing; Lambda's documentation says to configure the DLQ on the queue itself for SQS event sources. Option A does not apply here: the function-level dead-letter queue captures only asynchronous invocation failures, and an SQS event source mapping invokes the function synchronously, so the failing message keeps returning to the queue. Option B only delays the next redelivery; the message reappears after the timeout and blocks again, and a 12-hour timeout would also stall every legitimate retry. Option D lets the message be retried for two weeks before silently disappearing, which is data loss rather than investigation, and a delivery delay applies to new messages, not to redeliveries.

  2. 32. A message queue delivers the same message twice to a consumer. How should the consumer be designed?

    • A. To fail the invocation on any message ID it has already seen, so the batch returns to the queue and the dead-letter queue receives it
    • B. To assume duplicates cannot occur, because at-least-once delivery only redelivers a message after the 14-day retention period
    • C. To process only the first message of each batch, because SQS orders redelivered duplicates to the tail of the receive batch
    • D. Idempotently, so processing the same message more than once produces the same result as processing it once
    Show answer & explanation

    Answer: D
    At-least-once delivery makes a duplicate a normal event, typically because a consumer processed a message but did not delete it before the visibility timeout expired. An idempotent consumer, one that records processed message IDs or performs naturally repeatable operations such as setting a value instead of incrementing it, produces the same result no matter how many times the message arrives. Option A punishes the whole batch for one duplicate and turns an expected condition into a failure path; the other messages in the batch are retried and the duplicate lands in the DLQ for no reason. Option B is wrong about the mechanism: redelivery happens after the visibility timeout (30 seconds by default), and the retention period is when unconsumed messages are deleted. Option C invents an ordering guarantee; a standard queue makes no promise about where a redelivered message appears in a batch.

  3. 33. A developer needs event data delivered to multiple consumers with the ability to replay past events. Which service model fits?

    • A. A streaming service retaining records for a configured period, where consumers track their own position independently
    • B. A standard SNS topic fanning each event out to every subscriber at publish time, retaining nothing after delivery has been attempted
    • C. An SQS FIFO queue with 14-day retention, where each consumer deletes messages after processing them
    • D. An Amazon Data Firehose delivery stream buffering events for up to 900 seconds before writing them to S3
    Show answer & explanation

    Answer: A
    Kinesis Data Streams keeps records for a configurable retention period (24 hours by default, up to 365 days) and each consumer application reads with its own shard iterator or checkpoint, so several consumers process the same records independently and a new or recovering consumer can replay from an earlier position. Option B delivers and forgets: a subscriber that was down or added later never sees past events, because SNS keeps no record after delivery. Option C removes a message once a consumer deletes it, so only one consumer sees each message and there is nothing left to replay. Option D is a delivery pipeline into S3, Redshift or OpenSearch; it does not let consumer applications track a position or read the stream directly.

  4. 34. A developer must ensure a multi-step workflow with waits, branching and error handling is reliably coordinated. What is the appropriate approach?

    • A. A single Lambda function running the whole workflow with sleep calls, since the 15-minute timeout covers most waits
    • B. A chain of Lambda functions each invoking the next synchronously, passing state along in the 6 MB response payload
    • C. An EventBridge Scheduler rule invoking a checker function every hour to advance whichever step is currently due
    • D. A managed workflow orchestration service defining states, transitions and retry behavior declaratively
    Show answer & explanation

    Answer: D
    Step Functions defines the workflow in Amazon States Language: Wait states pause without running compute, Choice states branch, and each Task carries Retry (IntervalSeconds, MaxAttempts, BackoffRate) and Catch definitions; progress is persisted between steps and a Standard workflow can run for up to a year with a visual execution history. Option A pays for compute while it sleeps, loses all progress if the invocation fails, and cannot wait longer than 15 minutes in total. Option B couples every step to the next, makes a failure in step five unwind through five callers, and is bounded by the timeouts and payload limits of synchronous invocation. Option C polls instead of reacting, adds up to an hour of latency to every transition, and forces the developer to write the state tracking that orchestration provides.

  5. 35. An application must respond to a client immediately while completing slow work afterward. What pattern applies?

    • A. Returning 503 with a Retry-After header so the client resubmits the request later, when the work may be faster
    • B. Accepting the request, enqueuing the work, and returning an identifier the client can use to poll for the result
    • C. Running the work in the same invocation with Lambda response streaming, sending the 200 status before the body
    • D. Holding the connection open until the work is done, raising the API Gateway integration timeout past 29 seconds
    Show answer & explanation

    Answer: B
    The asynchronous request-reply pattern acknowledges the request at once (202 Accepted with a job ID), puts the work on an SQS queue or starts a Step Functions execution, and lets the client poll a status endpoint or receive a callback; the client is not held waiting and the work is not bound by request timeouts. Option D still ties the client and the connection to the duration of the work; a longer integration timeout moves the limit rather than removing it and does nothing for clients that disconnect. Option A does not perform the work at all; it pushes the request back to the client and repeats the same problem on the next attempt. Option C still keeps the client connected for the whole duration, because streaming changes how the response is delivered, not whether the caller must wait for completion.

  6. 36. A developer writes unit tests for code that calls a cloud service API. What approach keeps the tests fast and deterministic?

    • A. Calling the live production service from the test suite with a dedicated IAM user whose access keys are checked in
    • B. Mocking or stubbing the service client so tests exercise the application's logic without network calls
    • C. Skipping tests for any code path that calls an AWS API and covering it with a manual checklist
    • D. Adding sleep statements before each assertion so that the service has time to respond before the test evaluates it
    Show answer & explanation

    Answer: B
    Mocking the SDK client isolates the unit under test from network latency, credentials, cost and service state, so the suite is fast and deterministic enough to run on every change; integration tests against a real or emulated service remain a separate, complementary layer. Option A makes tests slow, flaky and expensive, risks mutating production data, and commits long-term credentials to the repository. Option C leaves the code that talks to AWS, usually where the bugs are, without automated coverage. Option D makes the suite slower and still nondeterministic; a fixed sleep is either too short on a bad day or wasted time on a good one.

  7. 37. A serverless function experiences elevated latency on the first invocation after a period of inactivity. What causes this?

    • A. A cold start, where the execution environment must be initialized and the runtime and dependencies loaded before the handler runs
    • B. A throttled start, where the function waited for the account's 1,000 concurrent execution limit to free a slot before the handler could run
    • C. A frozen /tmp restore, where Lambda reloads up to 10,240 MB of ephemeral storage from S3 before the handler runs
    • D. A DNS warm-up, where the runtime's first call to a Regional endpoint waits for Route 53 resolution and caches it for 60 seconds
    Show answer & explanation

    Answer: A
    After a period without requests Lambda has no initialized execution environment, so the next invocation pays the Init phase: download the code, start the runtime and run the code outside the handler. That cold start is what makes the first invocation slower; subsequent invocations reuse the warm environment. Option B describes throttling, which produces 429 errors or queued asynchronous events rather than a slow success, and a lightly used function is nowhere near the concurrency limit. Option C invents a mechanism; /tmp is ephemeral storage that persists only while the environment lives and is never restored from S3. Option D attributes the delay to name resolution, which takes milliseconds and does not explain the hundreds of milliseconds to seconds of runtime and dependency initialization.

  8. 38. An application uploads a 5 GB file to object storage over an unreliable connection. What approach is appropriate?

    • A. A single PutObject request with a Content-MD5 checksum, since 5 GB is the largest object one PUT accepts
    • B. S3 Transfer Acceleration on the bucket, which routes the upload through a CloudFront edge and retries dropped packets
    • C. Multipart upload, which splits the object into parts that can be uploaded in parallel and retried individually
    • D. Splitting the file into separate 100 MB objects with a lifecycle rule that reassembles them after upload
    Show answer & explanation

    Answer: C
    Multipart upload splits the object into parts of 5 MiB to 5 GiB (up to 10,000 parts), uploads them in parallel and retries only the parts that fail, so a dropped connection costs one part rather than the whole transfer; AWS recommends it once objects reach about 100 MB, and a lifecycle rule should abort incomplete uploads that would otherwise keep billing. Option A sits exactly at the single-PUT limit with no retry granularity: any interruption restarts the entire 5 GB transfer, and the checksum only detects corruption after the fact. Option B reduces latency by entering the AWS network at an edge location, but the transfer is still one request and a broken connection still starts it over. Option D describes a lifecycle action that does not exist; lifecycle rules transition, expire and abort incomplete multipart uploads, they never concatenate objects.

  9. 39. A developer is building a Lambda function triggered by API Gateway that must validate that a required 'email' field is present and properly formatted in the JSON request body before the Lambda code even runs, to reduce unnecessary Lambda invocations for malformed requests. What is the best-fit API Gateway feature for this?

    • A. An API Gateway mapping template in the integration request that drops the request body whenever the 'email' field is absent
    • B. A REQUEST-type Lambda authorizer with the email field configured as an identity source and a 300-second authorization cache
    • C. An API Gateway usage plan with a request quota, so malformed callers exhaust their API key
    • D. API Gateway request validation configured with a JSON Schema model on the method request
    Show answer & explanation

    Answer: D
    A request validator attached to the method checks the body against a JSON Schema (draft 4) model, so a missing required 'email' property or one that fails a pattern is rejected with a 400 before the integration runs, and the validation result is written to CloudWatch Logs; the Lambda function is never invoked. Option A transforms the payload with VTL but cannot reject the request; the integration is still invoked, only with an altered body. Option B is an authorization mechanism whose identity sources are headers, query strings, stage variables and context, not the request body, and it invokes a Lambda function of its own on every request. Option C meters and throttles calls per API key; it has no knowledge of the request body and does nothing to stop a single malformed request.

  10. 40. A developer is building a serverless API using API Gateway and Lambda. The Lambda function needs to write logs that include the full request payload for debugging, but the team is worried about excessive CloudWatch Logs costs in production. What is the best approach?

    • A. Set the function's log format to JSON with the application log level at DEBUG in every stage, and move the log group to the Infrequent Access log class
    • B. Log the full payload at INFO level on every invocation and shorten the log group's retention period to 1 day so that the stored volume stays small
    • C. Use environment variables to set a LOG_LEVEL, and only emit verbose payload logs when the level is DEBUG, disabling that level in production
    • D. Write the payload to the function's /tmp directory and ship it to S3 with a lifecycle rule, bypassing CloudWatch Logs ingestion charges entirely
    Show answer & explanation

    Answer: C
    CloudWatch Logs bills mainly on ingested volume, so the lever is how much the function emits in production. Reading a LOG_LEVEL environment variable and emitting the payload only at DEBUG keeps the detail available in dev and test while production emits INFO and above; the same idea is what Lambda's JSON log-level filtering and Powertools loggers implement. Option A leaves DEBUG on in production, so every payload is still ingested; the Infrequent Access class only lowers the ingestion price and removes metric filters, subscription filters and Live Tail, which the team may need. Option B still ingests every payload; retention only shortens how long stored data is kept and does not reduce the ingestion charge that drives the cost. Option D puts logs in ephemeral, per-environment storage (512 MB by default) that disappears when the environment is recycled, adds a custom shipping path, and removes the payload from the centralized log stream used for debugging.

  11. 41. A development team wants to package a Lambda function along with several third-party npm libraries that total 80 MB. Which deployment approach best fits this scenario while keeping the deployment package manageable?

    • A. Store the dependencies in DynamoDB and load them at invocation time
    • B. Require every invocation to download the dependencies from the internet before running the handler
    • C. Inline the entire dependency tree directly in the Lambda console code editor
    • D. Package the dependencies as a Lambda layer and attach the layer to the function
    Show answer & explanation

    Answer: D
    Lambda layers let you separate shared dependencies from function code, keeping the deployment package smaller, enabling reuse across functions, and avoiding editing large payloads inline. The console code editor (C) only supports small inline edits and can't handle large dependency trees. DynamoDB (A) is a database, not a binary/code artifact store, and loading binaries from it at runtime is impractical. Downloading dependencies at invocation time (B) adds latency and violates Lambda's stateless, fast-start execution model.

  12. 42. An application uses DynamoDB to store user session data and must handle sudden bursts of read traffic without throttling, while keeping cost predictable for a mostly steady baseline load. Which DynamoDB capacity mode addresses this best?

    • A. Provisioned capacity mode with auto scaling configured to react to demand changes
    • B. Provisioned capacity mode with a fixed number of read/write capacity units and no auto scaling
    • C. DynamoDB Accelerator (DAX) used as a replacement for capacity planning
    • D. On-demand capacity mode for all tables regardless of traffic pattern
    Show answer & explanation

    Answer: A
    Provisioned capacity with auto scaling lets a table scale read/write throughput up during bursts and back down during steady periods, giving predictable baseline cost with burst tolerance. Pure on-demand (D) is simpler but can be less cost-predictable for steady, well-understood workloads. A fixed provisioned setting with no auto scaling (B) throttles during unexpected bursts. DAX (C) is a caching layer that reduces read latency and load on the table but does not itself manage or replace write/read capacity provisioning.

  13. 43. A developer is writing a Lambda function that processes messages from an SQS standard queue. Occasionally the same message is processed twice, causing duplicate database writes. What is the most appropriate way to address this within the application code?

    • A. Convert the queue to a FIFO queue with content-based deduplication, which suppresses duplicates that arrive within the 5-minute deduplication interval
    • B. Design the message-processing logic to be idempotent, for example by using a unique message identifier to detect and skip repeated writes
    • C. Raise the queue's visibility timeout to its 12-hour maximum so that a received message stays hidden long enough that no second consumer can receive it
    • D. Add a redrive policy with maxReceiveCount set to 1 so that any message received a second time is moved to the dead-letter queue instead of reprocessed
    Show answer & explanation

    Answer: B
    Standard queues deliver at least once, so a message that was processed but not deleted before its visibility timeout expired comes back. The fix that belongs in the application is idempotent processing: a conditional write keyed on the message ID (or an idempotency table) turns a repeated delivery into a no-op. Option A only removes duplicates the producer sends within 5 minutes; a consumer-side redelivery after a visibility timeout expiry is still delivered again, and changing the queue type is not an application-code change. Option C only delays redelivery; the message becomes visible again after 12 hours if it was not deleted, and a slow or crashed consumer still causes a second delivery. Option D sends every message that is redelivered once, including messages that failed for a transient reason, straight to the dead-letter queue, losing legitimate retries without preventing the duplicate write.

  14. 44. A team is building a microservices application where several Lambda functions need to publish domain events that multiple independent subscribers (an SQS queue, an email notification Lambda, and a third-party HTTPS endpoint) should all receive. Which AWS service is the best fit for fanning out a single event to multiple independent subscribers?

    • A. Amazon SQS
    • B. AWS Step Functions
    • C. Amazon Kinesis Data Streams
    • D. Amazon SNS
    Show answer & explanation

    Answer: D
    SNS is publish/subscribe: one Publish call delivers the message to every subscription on the topic, and SQS queues, Lambda functions and HTTPS endpoints are all supported subscription protocols, with filter policies to route subsets of events. Option A delivers each message to one consumer, which then deletes it; three subscribers would compete for messages rather than each receiving every event. Option B orchestrates the steps of one workflow with retries and history; it is not a broadcast mechanism for independent subscribers. Option C does allow multiple consumer applications to read the same records, but it requires shard management, a consumer library or enhanced fan-out and offers no native delivery to email or HTTPS endpoints; it is heavier than a simple notification fan-out.

  15. 45. A developer needs to add caching to a REST API built with Amazon API Gateway to reduce load on a backend Lambda function for frequently requested, rarely changing data. Which built-in API Gateway feature should they enable?

    • A. API Gateway stage-level caching
    • B. API Gateway request validation
    • C. API Gateway usage plan quotas
    • D. API Gateway method throttling
    Show answer & explanation

    Answer: A
    Stage-level caching stores integration responses for a TTL (300 seconds by default, 3,600 maximum) and answers repeated GET requests from the cache without invoking the Lambda integration, which is exactly the goal for frequently requested, rarely changing data. Option B checks required parameters and validates the body against a JSON Schema model before the integration, returning 400 on failure; it never stores a response. Option C sets a request quota per API key for a day, week or month and throttles above it; every allowed request still invokes the backend. Option D caps the request rate per method and returns 429 Too Many Requests above the limit; it protects the backend by rejecting calls rather than by serving cached responses.

  16. 46. A company runs a Lambda function that reads and writes items to DynamoDB. The team wants to guarantee that a specific attribute update only happens if another attribute has not changed since it was last read by the client, to avoid overwriting concurrent updates. What DynamoDB feature should the developer use in the write request?

    • A. A TransactWriteItems call, because transactions serialize all concurrent writes to the item
    • B. A conditional write expression on the UpdateItem or PutItem call
    • C. A strongly consistent read (ConsistentRead=true) of the item immediately before the write
    • D. DynamoDB Streams with the NEW_AND_OLD_IMAGES view type to detect overwrites downstream
    Show answer & explanation

    Answer: B
    A ConditionExpression on UpdateItem or PutItem implements optimistic concurrency: the write succeeds only if the condition (for example, version = :expected) still holds, otherwise DynamoDB rejects it with ConditionalCheckFailedException and the client re-reads and retries. Option A makes the writes atomic and isolated but does not compare the attribute with what the client read; without a ConditionCheck or condition expression the transaction still overwrites the concurrent update. Option C returns the latest committed value but leaves the gap between the read and the write open, so another writer can still change the item in between. Option D records the change after it has already happened; a stream lets you observe an overwrite, not prevent it.

  17. 47. A developer wants their Lambda function, written in Node.js, to reuse a database connection across multiple invocations to reduce cold-start overhead and connection churn. Where should the connection be initialized to achieve this?

    • A. Inside the handler but guarded by a check of the invocation's request ID, so a new connection opens only when the request ID changes
    • B. In a Lambda layer's initialization script, since code packaged in a layer runs once per account and is shared by every function using it
    • C. Outside the handler function, at the top level of the module, so it runs once per execution environment and is reused across warm invocations
    • D. In the function's environment variables as a serialized connection string that the SDK rehydrates into an open socket on each invocation
    Show answer & explanation

    Answer: C
    Code at module scope runs during the Init phase, once per execution environment, and objects it creates stay in memory while the environment is reused for warm invocations. Lambda's execution environment lifecycle documentation recommends exactly this for database connections, with a check that the connection is still alive. Option A opens a new connection on every invocation, because the request ID is different for every request; it adds a check without adding any reuse. Option B misunderstands layers, which only add files to /opt of the deployment package; nothing in a layer runs per account or shares live objects across functions. Option D cannot work because environment variables hold strings (4 KB in total); a TCP connection is a live object that cannot be serialized into configuration.

  18. 48. A team is designing an event-driven order processing workflow that must execute a specific sequence of steps (validate order, charge payment, reserve inventory, send confirmation), with built-in error handling, retries, and the ability to visualize execution history for each order. Which AWS service is purpose-built for this?

    • A. Amazon EventBridge
    • B. AWS Step Functions
    • C. AWS Lambda destinations
    • D. Amazon SQS
    Show answer & explanation

    Answer: B
    Step Functions is built for exactly this: a state machine runs the steps in order, each Task state has its own Retry and Catch configuration, and every execution has a visual, step-by-step history in the console; Standard workflows run up to a year with exactly-once execution. Option A routes events from sources to targets by matching patterns; a rule has no notion of a sequence of steps, per-step retries inside one workflow, or an execution history for each order. Option C only forwards the result of one asynchronous invocation (success or failure) to another target; it cannot express a multi-step sequence with branching or retries. Option D holds messages for one consumer and provides neither ordering of steps nor any view of how far a particular order has progressed.

  19. 49. A developer needs to invoke a Lambda function asynchronously and wants failed invocations, after all retries are exhausted, to be automatically captured for later inspection instead of being silently dropped. Which feature should they configure on the Lambda function?

    • A. Reserved concurrency of zero on the function, so Lambda holds rejected events in its internal queue until concurrency is restored
    • B. A maximum event age of 6 hours and maximum retry attempts of 2 in the function's asynchronous invocation settings
    • C. A function URL with AWS_IAM auth, returning failed async invocations to the caller
    • D. A dead-letter queue (DLQ) or Lambda destination for failure, targeting SQS or SNS
    Show answer & explanation

    Answer: D
    For asynchronous invocations Lambda retries a function error twice and then discards the event unless a dead-letter queue (a standard SQS queue or SNS topic) or an on-failure destination (SQS, SNS, Lambda, EventBridge or, for failures, S3) is configured; both capture the event for inspection or reprocessing. Option A stops the function from being invoked at all; with reserved concurrency set to zero Lambda sends new events to a dead-letter queue or on-failure destination if one exists and otherwise drops them. Option B describes the default retry settings, which only control how long and how often Lambda retries; when they are exhausted the event is still discarded unless a DLQ or destination exists. Option C is a dedicated HTTPS endpoint for invoking the function; it has no role in retaining events that fail asynchronous processing.

  20. 50. Of the 65 total items on the AWS Certified Developer - Associate exam, how many actually count toward the candidate's final score, and what happens to the rest?

    • A. All 65 questions are scored, but the 15 hardest items are dropped from the raw total before conversion to the 100 to 1,000 scale
    • B. 60 questions are scored, and 5 are unscored survey items about the testing experience that appear after the 130-minute section
    • C. 55 questions are scored, and 10 are unscored items that AWS flags at the end of the exam so candidates know which did not count
    • D. 50 questions are scored, and 15 are unscored items used by AWS to evaluate future questions without affecting the candidate's score
    Show answer & explanation

    Answer: D
    The DVA-C02 exam guide states that the exam includes 50 questions that affect the score and 15 unscored questions that AWS uses to evaluate items for future use as scored questions; the unscored questions are not identified on the exam, and the whole set is answered within the 130-minute session. Option C has the wrong split and invents an identification step; AWS says explicitly that the unscored questions are not identified on the exam. Option A invents a dropping rule; scaled scoring equates difficulty across exam forms, it does not discard the hardest 15 items, and only 50 items are scored to begin with. Option B has the wrong split and confuses the unscored content items with a post-exam survey; the unscored questions are regular exam questions mixed into the timed section.

  21. 51. A candidate wants to know the passing threshold for the AWS Certified Developer - Associate exam and how the score is reported. Which statement correctly reflects the official scoring scale and passing score?

    • A. Scores are reported on a scale of 0 to 100, and the minimum passing score is 70
    • B. Scores are reported on a scale of 100 to 1,000, and the minimum passing score is 500
    • C. Scores are reported on a scale of 100 to 1,000, and the minimum passing score is 720
    • D. Scores are reported as a raw percentage out of 100%, and the minimum passing score is 72%
    Show answer & explanation

    Answer: C
    AWS reports scores on a scaled range of 100 to 1,000, and the minimum passing score for this exam is 720; the scaling accounts for minor difficulty differences across exam forms, so it is not simply a raw percentage. Option D incorrectly describes the scale as a raw percentage rather than the official 100-1,000 scaled score. Option A uses the wrong scale entirely (0-100). Option B uses the correct scale but the wrong passing threshold — 500, not 720, which would misinform a candidate about how many correct answers are actually needed to pass.

  22. 52. An application calls a service API and receives a throttling error. What is the correct client behavior?

    • A. Fail the operation and return the error to the user, since throttling errors carry an HTTP 4xx status and 4xx errors are never retried by the SDK
    • B. Retry with exponential backoff and jitter, since the error indicates the request rate exceeded a limit rather than a permanent failure
    • C. Retry immediately in a tight loop, since the SDK's standard mode caps attempts at 3 and adds the backoff for you
    • D. Switch the client to another Region for all later requests, since throttling quotas are shared across Regions
    Show answer & explanation

    Answer: B
    A throttling error (ThrottlingException, TooManyRequestsException, ProvisionedThroughputExceededException and similar) means the request rate exceeded a quota, not that the request is invalid, so it is retried with exponential backoff and jitter; the SDK's standard retry mode does this by default with a longer base delay for throttling than for transient errors. Option A misreads the status code: throttling errors are classified as retryable even though they are 4xx responses, and giving up on the first one turns a transient condition into a user-visible failure. Option C hammers a service that is already rejecting requests; the standard mode's backoff applies to the SDK's own retries, and a loop written around them defeats it. Option D moves the workload to Region-scoped resources that may not exist there; quotas are per Region, and the correct response to exceeding one is to slow down or request an increase.

  23. 53. A developer must choose between a queue and a publish-subscribe topic. What distinguishes them?

    • A. A queue delivers each message to one consumer, while a topic fans a message out to all subscribers
    • B. A topic delivers each message to one subscriber, while a queue broadcasts to all of its consumers
    • C. A queue keeps messages up to 14 days, while a topic keeps them until each subscriber acknowledges
    • D. A queue accepts messages up to 256 KB, while a topic takes up to 1 MiB and orders them
    Show answer & explanation

    Answer: A
    SQS is point-to-point: a message is received and deleted by one consumer, which distributes work. SNS is publish/subscribe: a message published once is delivered to every subscription (SQS queues, Lambda functions, HTTP endpoints, email), which distributes notification. Subscribing several queues to one topic combines both. Option B inverts the two models; it is the topic that fans out and the queue that hands each message to a single consumer. Option C is wrong about SNS, which does not retain messages at all; delivery is attempted to each subscription and a failed delivery is retried or dropped according to the delivery policy. Option D reverses the limits (SQS accepts up to 1 MiB, SNS up to 256 KB) and misstates ordering, which only FIFO queues and FIFO topics provide.

  24. 54. An application writes to a NoSQL table and must not overwrite a concurrent update from another process. What mechanism prevents this?

    • A. A strongly consistent read of the item immediately before the write, which DynamoDB serializes together with the write as a single unit
    • B. A conditional write checking a version attribute or expected value, failing if the item changed since it was read
    • C. A TransactWriteItems call wrapping the single update, since a transaction locks the item until the caller commits the change
    • D. Enabling DynamoDB Streams with the OLD_IMAGE view type so a downstream function can restore any attribute that was overwritten
    Show answer & explanation

    Answer: B
    Optimistic locking uses a condition expression such as version = :expected (or attribute_not_exists for a create) so that the write is rejected with ConditionalCheckFailedException if another process changed the item after it was read; the caller then re-reads and retries with the new version. Option A is not atomic with the write: a strongly consistent read returns the latest value, but another writer can still update the item in the interval before your write lands. Option C misdescribes transactions, which do not hold locks and, without a ConditionCheck or condition expression, will happily overwrite whatever value is present. Option D acts after the damage is done; a stream lets you detect an overwrite and attempt repair, but it does not prevent the concurrent update from being lost.

  25. 55. A Lambda function is triggered by an SQS standard queue. The team raises the event source mapping batch size from 10 to 500 to cut invocation counts, and the update is rejected. What additional setting does a batch size above 10 require?

    • A. A batch window (MaximumBatchingWindowInSeconds) of at least 1 second on the event source mapping
    • B. A reserved concurrency value of at least 5 on the function so batches are not throttled
    • C. A FIFO queue, because only FIFO queues accept batch sizes larger than 10 messages
    • D. A queue message retention period of at least 4 days, the default, so a larger batch can be assembled
    Show answer & explanation

    Answer: A
    For an SQS standard queue the batch size can go up to 10,000 records, but Lambda requires MaximumBatchingWindowInSeconds of at least 1 second for any batch size over 10, because it needs a buffering window to gather that many messages. Reserved concurrency (B) caps scaling and has no bearing on batch size validation. FIFO queues (C) are the opposite case: their maximum batch size is 10. Retention (D) governs how long unread messages survive, not how many are delivered per invocation.

  26. 56. A Lambda function with a 30-second timeout reads from an SQS queue whose visibility timeout is 30 seconds. Under load, messages are picked up a second time while the first invocation is still running. What queue setting does AWS recommend?

    • A. Set the queue's receive message wait time to 30 seconds so each poll matches the function timeout
    • B. Set the queue's visibility timeout to at least six times the function timeout, here 180 seconds or more
    • C. Set the queue's message retention period to six times the function timeout, here 180 seconds
    • D. Set the queue's delivery delay to six times the function timeout so redelivery cannot overlap
    Show answer & explanation

    Answer: B
    AWS recommends a source queue visibility timeout of at least six times the function timeout, which leaves room for Lambda to retry after a throttled batch before a message becomes visible again. Retention (C) controls how long an unconsumed message survives in the queue, not how long it is hidden after a receive. A delivery delay (D) postpones first delivery of new messages and does nothing about in-flight ones. The maximum receive wait time for long polling is 20 seconds, so 30 (A) is not even a legal value.

  27. 57. A Lambda function processes batches of 10 SQS messages. When one message fails, all 10 return to the queue and the nine that succeeded are processed again. Which change limits redelivery to only the failed messages?

    • A. Set BisectBatchOnFunctionError on the mapping so Lambda splits the batch and retries only the failing half
    • B. Set the queue's redrive policy maxReceiveCount to 1 so a failed batch goes straight to the dead-letter queue
    • C. Set FunctionResponseTypes to ReportBatchItemFailures and return batchItemFailures with the failed message IDs
    • D. Set FunctionResponseTypes to ReportBatchItemFailures and throw an exception listing the failed message IDs
    Show answer & explanation

    Answer: C
    Partial batch responses require both halves: ReportBatchItemFailures in FunctionResponseTypes on the event source mapping, and a response body containing a batchItemFailures list of itemIdentifier values. Throwing an exception (D) makes Lambda treat the whole batch as a complete failure regardless of the setting. BisectBatchOnFunctionError (A) is a Kinesis and DynamoDB Streams option, not an SQS one. A maxReceiveCount of 1 (B) sends every message of a failed batch to the dead-letter queue after a single failure, discarding good work rather than retrying it.

  28. 58. A queue-driven Lambda function scales so aggressively that it exhausts the account's concurrency and starves other functions. The team wants to cap only this event source without reserving concurrency. Which setting applies?

    • A. The ParallelizationFactor on the SQS event source mapping, a value between 1 and 10
    • B. The account concurrency quota, lowered through Service Quotas for the Region in question
    • C. Provisioned concurrency on the function alias, set to the ceiling the team wants to enforce
    • D. The maximum concurrency setting on the SQS event source mapping, a value between 2 and 1,000
    Show answer & explanation

    Answer: D
    Maximum concurrency is an event source level setting, accepting values from 2 to 1,000, that caps how many concurrent function instances one SQS event source can invoke. Provisioned concurrency (C) pre-initializes environments and sets no upper bound at all. ParallelizationFactor (A) applies to Kinesis and DynamoDB Streams shards, not to SQS. Lowering the account quota (B) would cap every function in the Region, which is exactly the collateral damage the team is trying to avoid.

  29. 59. A Lambda consumer of a Kinesis data stream is falling behind, but adding shards is not an option because the producer's partition keys are fixed. Which event source mapping parameter raises per-shard throughput?

    • A. ParallelizationFactor, raised from the default of 1 toward its maximum of 10 concurrent batches
    • B. MaximumBatchingWindowInSeconds, raised toward its maximum so each batch carries more records
    • C. MaximumRetryAttempts, raised from its default of -1 to a finite value so failures stop blocking
    • D. TumblingWindowInSeconds, raised toward its maximum of 900 so more records aggregate per invocation
    Show answer & explanation

    Answer: A
    ParallelizationFactor lets Lambda process one shard with up to 10 concurrent batches while still preserving order within each partition key, which is the documented way to raise throughput without adding shards. MaximumRetryAttempts (C) governs how long a failed record is retried, not concurrency. A tumbling window (D) aggregates state across invocations for calculations and does not add parallel processing. A batching window (B) makes Lambda wait longer before invoking, which increases latency rather than reducing iterator age.

  30. 60. A new Lambda consumer is attached to an existing Kinesis data stream that already holds several hours of records. The team wants the function to process only records written after the mapping is created. Which StartingPosition applies?

    • A. TRIM_HORIZON, which starts at the oldest untrimmed record still held in each shard
    • B. LATEST, which starts after the most recent record in each shard at mapping creation
    • C. AT_TIMESTAMP, which requires no StartingPositionTimestamp and defaults to the current time
    • D. AT_SEQUENCE_NUMBER, which starts at the sequence number the consumer last checkpointed
    Show answer & explanation

    Answer: B
    A Kinesis event source mapping accepts TRIM_HORIZON, LATEST, or AT_TIMESTAMP, and LATEST begins reading after the newest record so the backlog is skipped. TRIM_HORIZON (A) does the opposite and replays everything still inside the retention period. AT_TIMESTAMP (C) is valid but requires StartingPositionTimestamp; it has no implicit default. AT_SEQUENCE_NUMBER (D) is a shard iterator type used by the Kinesis GetShardIterator API, not a value the event source mapping accepts.

  31. 61. Four applications read the same Kinesis data stream, and each one reports rising read latency and throughput exceptions as consumers are added. Which consumer model gives each application its own read capacity?

    • A. Enhanced fan-out consumers, which raise the shard's total read rate to 2 MB per second per consumer group
    • B. Shared-throughput consumers with the GetRecords limit raised through a Service Quotas increase request
    • C. Enhanced fan-out consumers, each getting up to 2 MB per second per shard over SubscribeToShard
    • D. Shared-throughput consumers calling GetRecords, which each get up to 2 MB per second per shard
    Show answer & explanation

    Answer: C
    Each registered enhanced fan-out consumer receives a dedicated pipe of up to 2 MB per second per shard, pushed over HTTP/2 through SubscribeToShard, independently of other consumers. Shared-throughput consumers (D) contend for a single 2 MB per second per shard budget, which is exactly why latency grows as readers are added. Option A misstates the mechanism: the dedicated throughput belongs to each registered consumer, not to a shared pool. The per-shard read rate (B) is a hard characteristic of the shard, not an adjustable account quota.

  32. 62. A loan approval workflow runs for several days while it waits on a human decision, and every step must run exactly once because it moves money. Which Step Functions workflow type fits, and why?

    • A. Express, because its execution history is retained for 90 days and can be replayed after a wait
    • B. Standard, because it uses an at-most-once model that guarantees non-idempotent steps never repeat
    • C. Express, because it uses an at-least-once model and can run for up to five minutes per execution
    • D. Standard, because it uses an exactly-once model and can run for up to one year per execution
    Show answer & explanation

    Answer: D
    Standard workflows run up to one year and follow an exactly-once model, which is what AWS recommends for orchestrating non-idempotent actions such as processing payments. Express workflows (C and A) cap out at five minutes, so a multi-day wait is impossible, and their history is not retained by Step Functions at all unless CloudWatch Logs is enabled. Option B names the right workflow type but the wrong semantics: at-most-once describes Synchronous Express workflows, while Standard is exactly-once.

  33. 63. A team converts a Standard state machine to an Express workflow for cost reasons. After the change, a Task state that had submitted a job and waited for a callback token no longer validates. What explains this?

    • A. Express workflows do not support the Job-run (.sync) or Callback (.waitForTaskToken) integration patterns
    • B. Express workflows support callback tokens only inside a Distributed Map state, which must wrap the Task
    • C. Express workflows require the callback token to be delivered within the five-minute state transition quota
    • D. Express workflows support callback tokens only when logging to CloudWatch Logs is enabled on the state machine
    Show answer & explanation

    Answer: A
    Express workflows support all service integrations but not the Job-run (.sync) or Callback (.waitForTaskToken) patterns, so a task waiting on a token cannot be defined. Enabling logging (D) changes only observability, since Express executions are not recorded by Step Functions otherwise. Distributed Map (B) is itself unsupported in Express workflows, so it could not be a workaround. Option C invents a quota: the five-minute figure is the maximum Express execution duration, and Express workflows have no state transition rate limit.

  34. 64. A Task state calls a Lambda function that occasionally fails with a transient error. The developer adds a Retry block with only ErrorEquals specified. How many retries occur and at what spacing?

    • A. Unlimited retries at 1-second intervals until the state's TimeoutSeconds value is reached
    • B. Three retries, the first after 1 second, with each interval multiplied by 2.0 thereafter
    • C. Three retries, the first after 2 seconds, with each interval multiplied by 1.0 thereafter
    • D. One retry after 1 second, because MaxAttempts defaults to 1 when it is left unspecified
    Show answer & explanation

    Answer: B
    In Amazon States Language a retrier defaults to IntervalSeconds of 1, MaxAttempts of 3, and BackoffRate of 2.0, so the waits are roughly 1, 2, and 4 seconds. Option C swaps the defaults, and a BackoffRate of 1.0 would mean fixed intervals, which is a value you must set explicitly. MaxAttempts defaults to 3, not 1, so option D understates it, and a value of 0 is what suppresses retries. Retries are never unbounded (A); MaxAttempts always caps them whether or not a state timeout is configured.

  35. 65. A state machine has a Catch array whose first catcher uses States.ALL and whose second catcher names a specific Lambda error. The state machine definition fails validation. What rule was broken?

    • A. States.ALL requires a matching ResultPath field in every other catcher declared on the same state
    • B. States.ALL may only be used in a Retry block, never in a Catch block of a Task state
    • C. States.ALL must appear alone in its ErrorEquals array and must be the last catcher listed
    • D. States.ALL may not be combined with any catcher that names a Lambda error in the same state machine
    Show answer & explanation

    Answer: C
    The reserved name States.ALL is a wildcard that must appear alone in its ErrorEquals array and must be the last entry in the Catch array, so any catcher placed after it is unreachable and the definition is rejected. States.ALL is valid in Retry blocks as well as Catch blocks, so option B is wrong. Naming specific Lambda errors alongside it is normal practice as long as they come first, which refutes option D. ResultPath (A) is an optional field on a catcher and has no bearing on ordering rules.

  36. 66. An existing DynamoDB Orders table uses customerId as the partition key and orderId as the sort key. A new screen must list a customer's orders by orderDate with strongly consistent reads. What should the developer do?

    • A. Enable DynamoDB Streams on the table and maintain a second sorted table from the stream records
    • B. Add a local secondary index on orderDate, which can be added to a table at any time after creation
    • C. Add a global secondary index on orderDate, which supports strongly consistent reads within one partition
    • D. Create a new table with the same partition key and a local secondary index on orderDate, then migrate
    Show answer & explanation

    Answer: D
    Only a local secondary index supports strongly consistent reads, and local secondary indexes must be created when the table is created, so the existing table has to be recreated and the data migrated. Option B states the opposite of the creation rule. Global secondary indexes (C) can be added at any time but support eventually consistent reads only, which fails the stated requirement. A stream-fed shadow table (A) is far more machinery than the problem needs and still leaves a replication lag that breaks strong consistency.

  37. 67. A query against a DynamoDB global secondary index sets ConsistentRead to true and the SDK returns a validation error. What is the correct explanation to give the team?

    • A. Global secondary indexes support only eventually consistent reads, so the parameter is not accepted
    • B. Global secondary indexes support consistent reads only when the projection type is set to ALL
    • C. Global secondary indexes support consistent reads only on tables in provisioned capacity mode
    • D. Global secondary indexes support consistent reads only when the index shares the table's partition key
    Show answer & explanation

    Answer: A
    A global secondary index is maintained asynchronously from the base table, so it supports eventually consistent reads only and rejects ConsistentRead. The projection type (B) determines which attributes are copied into the index and cannot change its consistency model. Capacity mode (C) affects how throughput is billed and provisioned, not read consistency. An index that shares the table's partition key with a different sort key (D) is a local secondary index, which is a different construct and the one that does offer strong consistency.

  38. 68. A session table should discard rows automatically about a day after they are written, without the application running a cleanup job. How must the developer store the expiration value for DynamoDB TTL to act on it?

    • A. As a String attribute holding an ISO 8601 timestamp, which DynamoDB parses on the configured TTL attribute
    • B. As a Number attribute holding Unix epoch time in seconds on the attribute named in the TTL settings
    • C. As a Number attribute holding Unix epoch time in milliseconds, matching the precision of stream records
    • D. As a String attribute holding a duration such as 86400, which DynamoDB adds to the item's write time
    Show answer & explanation

    Answer: B
    TTL reads a Number attribute containing Unix epoch time at seconds granularity; items whose TTL attribute is not a Number are simply ignored by the TTL process. An ISO 8601 string (A) is never parsed. Milliseconds (C) would place the timestamp thousands of years in the future and the item would never expire. TTL stores an absolute expiration timestamp, not a relative duration added to the write time, which rules out option D. Deletion is asynchronous, typically within a few days of expiry, so reads should filter expired items.

  39. 69. An order service must debit an account item and insert an order item in two different DynamoDB tables so that either both succeed or neither does. What limits apply to the TransactWriteItems call?

    • A. Up to 25 action requests with an aggregate size of 4 MB, and each table must be in provisioned mode
    • B. Up to 25 action requests with an aggregate size of 16 MB, all within the same Region and account
    • C. Up to 100 action requests with an aggregate size of 4 MB, all within the same Region and account
    • D. Up to 100 action requests with an aggregate size of 4 MB, spanning any Region in the same account
    Show answer & explanation

    Answer: C
    TransactWriteItems groups up to 100 action requests against up to 100 distinct items in one or more tables within the same account and Region, with an aggregate item size ceiling of 4 MB. The 25-item and 16 MB figures in options B and A belong to BatchWriteItem, which is not atomic. Transactions give ACID guarantees only inside the Region where the write API was called, so cross-Region grouping (D) is not supported. Capacity mode is irrelevant, though every item costs two underlying writes: one to prepare and one to commit.

  40. 70. A read-heavy application fronts DynamoDB with a DAX cluster. A developer notices that some GetItem calls still take single-digit milliseconds and always reflect the newest value. What accounts for this?

    • A. Those calls missed the query cache, whose default time to live is 5 minutes for every cluster
    • B. Those calls were routed to a read replica node, which never serves items from the item cache
    • C. Those calls requested attributes outside the projection, so DAX fetched them from the base table
    • D. Those calls set ConsistentRead to true, so DAX passes them through to DynamoDB without caching
    Show answer & explanation

    Answer: D
    DAX serves eventually consistent GetItem, BatchGetItem, Query, and Scan from its caches, but a request that specifies strongly consistent reads is passed straight through to DynamoDB and the result is not cached, which is exactly the behaviour described. The query cache (A) holds Query and Scan result sets, not GetItem results, which live in the item cache. Read replicas (B) are kept in sync with the primary and do serve cached items. Projections (C) are a secondary index concept and have nothing to do with DAX caching.

  41. 71. A provisioned DynamoDB table stores 3 KB items. The application performs 100 eventually consistent reads per second of single items. How much read capacity must be provisioned?

    • A. 50 read capacity units, because a 3 KB item rounds to one 4 KB unit and eventual reads cost half
    • B. 75 read capacity units, because capacity is billed on the exact 3 KB item size without rounding
    • C. 200 read capacity units, because eventually consistent reads consume twice a strongly consistent read
    • D. 100 read capacity units, because each 3 KB item consumes one unit per read operation
    Show answer & explanation

    Answer: A
    One read capacity unit covers one strongly consistent read per second of an item up to 4 KB, or two eventually consistent reads of that size. A 3 KB item rounds up to a single 4 KB unit, and 100 eventually consistent reads per second therefore need 50 units. Option D prices the reads as strongly consistent. Option B assumes fractional billing, but DynamoDB always rounds up to the next 4 KB boundary for reads. Option C inverts the relationship: eventually consistent reads are the cheaper of the two, and transactional reads are the ones costing double.

  42. 72. A nightly job loads thousands of rows into DynamoDB with BatchWriteItem. The developer wants each write to apply only when the item does not already exist. What does the API allow?

    • A. BatchWriteItem accepts a ConditionExpression on each PutRequest, and failing items return in UnprocessedItems
    • B. BatchWriteItem does not accept condition expressions, so conditional puts must use individual PutItem calls
    • C. BatchWriteItem accepts a single ConditionExpression that is applied to every request in the batch at once
    • D. BatchWriteItem accepts condition expressions only when every item in the batch targets one table
    Show answer & explanation

    Answer: B
    BatchWriteItem trades features for throughput: it cannot specify conditions on individual put and delete requests and cannot update items, so an attribute_not_exists guard requires PutItem or TransactWriteItems. UnprocessedItems (A) carries requests that failed for throughput reasons and is retried with exponential backoff; it is not a condition failure channel. There is no batch-wide condition (C), and restricting the batch to one table (D) changes nothing about which expressions are accepted.

  43. 73. A Query against a DynamoDB table matches roughly 8,000 items but returns far fewer along with a LastEvaluatedKey. What governs how much a single Query returns?

    • A. A response size cap of 16 MB per Query, which matches the aggregate size limit of BatchGetItem
    • B. A response size cap of 400 KB per Query, which matches the maximum size of a single table item
    • C. A response size cap of 1 MB per Query, after which the caller pages using LastEvaluatedKey
    • D. A response cap of 100 items per Query, raised by setting the Limit parameter up to 1,000 items
    Show answer & explanation

    Answer: C
    DynamoDB returns at most 1 MB of data per Query or Scan page and supplies LastEvaluatedKey so the caller can resume, with any FilterExpression applied after that 1 MB is read. Option D invents an item-count cap; Limit narrows a page but does not extend it. The 16 MB in option A is the BatchGetItem aggregate size, and 400 KB in option B is the maximum size of one item, neither of which governs pagination.

  44. 74. An image pipeline must run a Lambda function whenever an object is created under the uploads/ prefix, and must also deliver the same events to an existing SQS FIFO queue. What configuration works?

    • A. One S3 event notification to an SNS FIFO topic with the prefix filter, fanned out to Lambda and the FIFO queue
    • B. One S3 event notification to the FIFO queue with the prefix filter, and a queue redrive policy targeting Lambda
    • C. Two S3 event notifications with the uploads/ prefix filter, one targeting Lambda and one targeting the FIFO queue
    • D. One S3 event notification to Lambda with the prefix filter, and EventBridge to deliver events to the FIFO queue
    Show answer & explanation

    Answer: D
    S3 Event Notifications support SNS topics, SQS standard queues, Lambda functions, and EventBridge, but explicitly not SQS FIFO queues; AWS documents EventBridge as the route to a FIFO queue. Option C therefore fails on its second notification. Option A fails for the same reason one step removed, since S3 cannot publish to a FIFO destination directly. A redrive policy (B) moves messages that exceed maxReceiveCount to a dead-letter queue and cannot invoke a function.

  45. 75. A media service writes every asset to a single S3 key prefix and starts receiving 503 Slow Down responses during ingest bursts. Which change addresses the request rate directly?

    • A. Spread objects across multiple key prefixes, since each partitioned prefix supports at least 3,500 writes per second
    • B. Request an S3 request-rate quota increase for the bucket, since the per-bucket write rate is an adjustable account quota
    • C. Enable S3 Transfer Acceleration on the bucket, which raises the request rate the bucket accepts per prefix
    • D. Switch the uploads to multipart, since each part counts as a fraction of one PUT against the prefix rate
    Show answer & explanation

    Answer: A
    Amazon S3 supports at least 3,500 PUT, COPY, POST, or DELETE and 5,500 GET or HEAD requests per second per partitioned prefix, with no limit on the number of prefixes, so parallelizing across prefixes is the documented way to scale. There is no adjustable per-bucket request quota to raise (B). Transfer Acceleration (C) speeds long-distance transfers through edge locations but does not change per-prefix request rates. Multipart parts (D) are separate requests and consume the same budget rather than a fraction of it.

  46. 76. A partner-facing API must issue API keys, meter each partner against a quota, and validate request bodies against a JSON Schema before the backend runs. Which API Gateway API type supports all three?

    • A. An HTTP API, which supports API keys and usage plans but delegates schema validation to a JWT authorizer
    • B. A REST API, which supports API keys with usage plans and request validation against method models
    • C. An HTTP API, which supports request validation and per-client throttling but not edge-optimized endpoints
    • D. A REST API, which supports request validation but requires AWS WAF rules to meter each partner's quota
    Show answer & explanation

    Answer: B
    API keys with usage plans, per-client rate limiting, and request validation are all REST API features that HTTP APIs do not offer, which eliminates options A and C. Option D describes the right API type but the wrong mechanism, since usage plans meter and throttle by API key while AWS WAF inspects requests for security rules rather than enforcing per-customer quotas. HTTP APIs remain the cheaper choice when none of those REST-only features are needed.

  47. 77. A REST API integration calls a backend report service that sometimes needs 45 seconds to respond, and clients receive a 504 from API Gateway. What is true about the integration timeout?

    • A. It defaults to 29,000 milliseconds and is raised by enabling response streaming on the method
    • B. It defaults to 29,000 milliseconds and cannot be changed, so the backend work must be made asynchronous
    • C. It defaults to 29,000 milliseconds and can be raised above 29 seconds for Regional or private APIs
    • D. It defaults to 30,000 milliseconds and can be raised to 900,000 for any REST API endpoint type
    Show answer & explanation

    Answer: C
    The integration timeout is a custom value between 50 and 29,000 milliseconds, defaulting to 29,000, and AWS permits raising it beyond 29 seconds for Regional or private APIs only, so an edge-optimized API would still cut off at 29 seconds. Option B is the older blanket statement and is now too strong. Option D misstates both the default and the ceiling. Response streaming (A) changes how a response body is transferred and does not extend the integration timeout.

  48. 78. A REST API has dev, test, and prod stages that must each invoke a different Lambda alias of the same function, without duplicating the API definition. What is the intended mechanism?

    • A. Define a mapping template per stage that rewrites the integration URI before the request is signed
    • B. Define one usage plan per stage, each associated with the API key that targets the matching alias
    • C. Define a canary release on each stage, with the canary weight pointing traffic to the matching alias
    • D. Define a stage variable and reference it in the integration URI so each stage resolves its own alias
    Show answer & explanation

    Answer: D
    Stage variables act as configuration placeholders that can be substituted into the integration URI, so a single deployed API definition can invoke a different Lambda alias per stage. Mapping templates (A) transform request and response payloads and headers; they do not select the integration endpoint. Usage plans (B) associate API keys with throttling and quota settings rather than routing. Canary releases (C) split traffic between two versions of the same stage for rollout, not between environments.

  49. 79. A team wants 10 percent of production traffic on a new Lambda function version while the rest stays on the current one, controlled from a single alias. Which condition must be satisfied?

    • A. Both versions must be published and share the same execution role and dead-letter queue configuration
    • B. Both versions must be published and must each have provisioned concurrency allocated to them
    • C. One target may be $LATEST as long as the published version carries the larger traffic weight
    • D. Both versions must belong to the same CodeDeploy deployment group and use a linear traffic-shifting configuration
    Show answer & explanation

    Answer: A
    An alias can point at a maximum of two versions, both of which must be published, must share an execution role, and must have the same dead-letter queue configuration or none. Provisioned concurrency (B) is optional; it only reduces cold starts and can even help avoid spillover during a shift. The alias cannot point to $LATEST at all, so option C is invalid regardless of weighting. CodeDeploy (D) automates weight changes on top of this feature but is not a precondition for configuring one.

  50. 80. An EventBridge rule must deliver each matching order event to six different targets. The rule is rejected when the sixth target is added. What is the constraint and the usual workaround?

    • A. Five targets per account, so the team replaces the extra targets with an SNS topic subscribed per consumer
    • B. Five targets per rule, so the team creates a second rule with the same event pattern for the remaining target
    • C. Five targets per rule, so the team requests a Service Quotas increase for targets per rule in that Region
    • D. Five targets per event bus, so the team creates a second custom event bus and mirrors the rule onto it
    Show answer & explanation

    Answer: B
    EventBridge allows a maximum of five targets per rule and that quota is not adjustable, so the standard approach is to add another rule carrying the same event pattern. Option C fails because the quota cannot be raised. The limit applies per rule, not per event bus or per account, so options D and A misstate its scope; the default is 300 rules per event bus, leaving plenty of room for the extra rule.

  51. 81. A product catalog is fronted by ElastiCache. The team is choosing between lazy loading and write-through and is worried about cache nodes coming up empty after a failure. What is the trade-off?

    • A. Write-through avoids the miss penalty because reads and writes both go to the cache before the database
    • B. Lazy loading keeps data fresh but a new empty node returns stale values until the next database write
    • C. Lazy loading survives an empty node at the cost of a miss penalty and possibly stale data, which a TTL bounds
    • D. Write-through survives an empty node because every read that misses repopulates the cache from the database behind it
    Show answer & explanation

    Answer: C
    Lazy loading writes to the cache only on a miss, so a replacement node keeps working with higher latency while it refills, but data can go stale because the cache is not updated when the database changes; adding a TTL bounds that staleness. Option B assigns lazy loading's weakness to the wrong strategy. Write-through is the one that leaves a new node with missing data (D) and it adds a write penalty of two trips rather than removing the miss penalty (A).

Security

19 questions
  1. 82. A serverless function must retrieve a database password at runtime. What is the appropriate mechanism?

    • A. Retrieving it from a managed secrets service using the function's execution role, caching it across warm invocations
    • B. Storing it as a plaintext environment variable, since Lambda encrypts environment variables at rest with an AWS managed key
    • C. Embedding it in the deployment package as a constant, since the package is encrypted at rest in Lambda's managed code storage
    • D. Passing it in the event payload on every call, since payloads are never logged and vanish when the invocation ends
    Show answer & explanation

    Answer: A
    Fetching the password from Secrets Manager (or a SecureString parameter) with the execution role gives centralized rotation, access logging and revocation, and caching the value outside the handler, or using the Parameters and Secrets Lambda extension with its 300-second default TTL, avoids a lookup on every invocation. Option B exposes the value to anyone with lambda:GetFunctionConfiguration, in the console and in deployment templates; encryption at rest does not hide it from those readers, and it cannot be rotated without redeploying. Option C bakes the secret into an artifact that is copied into every build, repository and version; encryption of code storage does nothing for the developers and pipelines that handle the package. Option D hands the secret to every caller and puts it in a payload that can appear in logs, traces and dead-letter queues; the caller should never possess it at all.

  2. 83. A browser must upload directly to object storage without the application proxying the bytes, while the application controls who may upload. What mechanism achieves this?

    • A. A bucket policy granting s3:PutObject to the anonymous principal on the upload prefix, with Block Public Access enabled
    • B. Cognito unauthenticated identities with an IAM role allowing s3:PutObject on the whole bucket via the identity pool ID
    • C. The application's own access key pair delivered to the browser over TLS and rotated every 90 days by IAM key rotation
    • D. A pre-signed URL generated by the application, granting time-limited permission for a specific operation on a specific object
    Show answer & explanation

    Answer: D
    A presigned URL (or presigned POST) is generated with the application's credentials for one HTTP method, one object key and an expiration (up to 7 days with IAM user credentials, no longer than the session for role credentials); the browser uploads directly to S3 while the server decides who gets a URL and for what. Option A is self-contradicting: Block Public Access rejects a bucket policy that grants access to the anonymous principal, and if it were disabled anyone on the internet could write anything to the prefix. Option B hands every visitor the same guest role with write access to the entire bucket, so the application no longer controls who may upload or where. Option C puts long-term credentials in client-side code where every user can read them; rotation shortens the exposure but does not make the design acceptable.

  3. 84. An API must reject requests exceeding a defined rate per client. Where is this best enforced?

    • A. In the client SDK by asking each caller to set AWS_MAX_ATTEMPTS to 1 so it stops retrying when throttled
    • B. At the API gateway layer through usage plans or throttling, before the request reaches backend compute
    • C. At the database with RDS Proxy's MaxConnectionsPercent setting, rejecting clients over their share
    • D. Inside the Lambda handler with a DynamoDB counter per client, returning 429 after the request has already been processed
    Show answer & explanation

    Answer: B
    API Gateway enforces rate and burst limits with a token bucket at the account, stage, method and, through usage plans with API keys, per-client level, returning 429 Too Many Requests before the integration runs; an abusive client therefore consumes no Lambda or database capacity. Option D pays the full backend cost before saying no, so the limit protects nothing, and it adds a DynamoDB write to every request. Option C sizes the database connection pool for the proxy as a whole; it has no notion of an API client and rejects connections, not requests. Option A depends on the client's goodwill; a client that ignores the setting, or is malicious, is not limited at all, and retries are not the same thing as request rate.

  4. 85. A company's application stores customer records in Amazon S3 and needs to ensure that data is encrypted at rest, with AWS managing the encryption keys automatically without any additional developer configuration on each PutObject call. Which S3 encryption option satisfies this with the least operational overhead?

    • A. Client-side encryption where the application encrypts data before uploading
    • B. Server-side encryption with Amazon S3 managed keys (SSE-S3)
    • C. Server-side encryption with customer-provided keys (SSE-C), supplying a new key on every request
    • D. No encryption, relying solely on bucket policies to restrict access
    Show answer & explanation

    Answer: B
    SSE-S3 has AWS manage the encryption keys entirely, encrypting objects automatically at rest with no extra per-request key management from the developer, matching the 'least operational overhead' requirement. Client-side encryption (A) requires the application itself to manage encryption and keys, adding developer overhead. SSE-C (C) requires the caller to supply and manage the encryption key on every request, which is more operational burden, not less. Relying only on bucket policies (D) controls access but does not encrypt data at rest, and does not meet the stated encryption requirement.

  5. 86. A Lambda function needs to read objects from an S3 bucket and write items to a DynamoDB table, but should not have any broader account permissions. What is the most secure way to grant it exactly the permissions it needs?

    • A. Grant the Lambda function's execution role full access to all S3 buckets and DynamoDB tables in the account to avoid future permission errors
    • B. Attach the AdministratorAccess managed policy to the function's execution role for simplicity
    • C. Create an IAM execution role with a custom policy granting only the specific S3 and DynamoDB actions and resources required
    • D. Embed an IAM user's long-term access key and secret directly in the function's environment variables
    Show answer & explanation

    Answer: C
    Following least privilege, a custom IAM policy attached to the function's execution role that scopes exactly the needed S3 and DynamoDB actions/resources is the secure, correct pattern for Lambda permissions. AdministratorAccess (B) grants far more permission than needed, violating least privilege and increasing blast radius if compromised. Embedding long-term IAM user credentials in environment variables (D) is an anti-pattern; Lambda execution roles already provide temporary, automatically rotated credentials, so static keys are unnecessary and risky. Granting full access to all S3 buckets and DynamoDB tables (A) is also overly broad and violates least privilege.

  6. 87. A mobile application needs to let users sign in with Google or Facebook and then obtain temporary AWS credentials to directly access an S3 bucket and DynamoDB table, without the app managing any long-term AWS credentials. Which AWS service combination is designed for this?

    • A. Amazon Cognito User Pools alone, whose ID and access JWTs are accepted by Amazon S3 and DynamoDB as AWS credentials
    • B. AWS IAM Identity Center permission sets assigned to each Google or Facebook user, issuing 12-hour console session credentials
    • C. AWS STS GetSessionToken called by the app with an IAM user's access keys embedded in the mobile binary, refreshed every hour
    • D. Amazon Cognito Identity Pools (Federated Identities) exchanging federated tokens for temporary IAM credentials via STS
    Show answer & explanation

    Answer: D
    An identity pool is a directory of federated identities that exchanges a Google or Facebook token (or a user pool token) for temporary AWS credentials through AssumeRoleWithWebIdentity, with an authenticated IAM role that scopes what the app may do against S3 and DynamoDB; no long-term keys ever reach the device. Option A issues OIDC JSON Web Tokens for authentication; S3 and DynamoDB require SigV4-signed requests with IAM credentials, which a user pool by itself does not vend. Option B is the workforce single sign-on service for employees using the console and CLI; it does not federate consumer identities from social providers for a mobile app. Option C embeds long-term IAM user keys in the app, which is exactly what the requirement forbids and which anyone who unpacks the binary can extract.

  7. 88. An application running on an EC2 instance needs to call the S3 API. The security team requires that no long-term access keys ever be stored on the instance. What is the recommended way to grant the application AWS API permissions?

    • A. Store an IAM user's access key pair in an encrypted file on the instance's EBS volume and decrypt it at startup with a KMS key
    • B. Call sts:GetSessionToken with an IAM user's credentials to obtain a 12-hour session token at startup
    • C. Create an IAM user for each instance and rotate its access keys every 90 days with a scheduled Lambda function
    • D. Attach an IAM role to the EC2 instance profile, so the instance retrieves temporary credentials automatically
    Show answer & explanation

    Answer: D
    An IAM role attached through the instance profile makes the instance metadata service supply temporary credentials that are rotated automatically before they expire, and the SDK credential provider chain picks them up with no keys on disk, which satisfies the security team's requirement. Option A still places a long-term access key pair on the instance; encrypting the file changes where the key is exposed, not the fact that it is stored there. Option C still stores long-term keys on every instance and multiplies the credentials to manage; rotation shortens the exposure window but does not remove the stored key. Option B needs the IAM user's long-term access keys on the instance to sign the GetSessionToken call in the first place, so the requirement is violated before the session token exists.

  8. 89. A company stores application secrets, such as database passwords, and wants them automatically rotated on a schedule without custom rotation code being written for supported database engines, while also being retrievable by Lambda functions at runtime. Which AWS service best fits this requirement?

    • A. AWS Systems Manager Parameter Store
    • B. AWS Key Management Service
    • C. AWS Secrets Manager
    • D. AWS CloudHSM
    Show answer & explanation

    Answer: C
    Secrets Manager offers managed rotation for Amazon RDS, Aurora, DocumentDB and Redshift credentials with no rotation code, Lambda-based rotation for anything else, versions with AWSCURRENT and AWSPREVIOUS staging labels, and a GetSecretValue API the function calls with its execution role (optionally cached through the Parameters and Secrets Lambda extension). Option A stores SecureString values encrypted with KMS (4 KB standard, 8 KB advanced) but has no built-in rotation; you would have to write and schedule the rotation yourself. Option B manages encryption keys and performs cryptographic operations; it does not store or rotate application passwords. Option D provides dedicated hardware security modules for key material; it is not a secrets store and has no rotation workflow for database credentials.

  9. 90. A developer's Lambda function needs to decrypt a value that was encrypted using an AWS KMS customer managed key. The function's execution role currently has no KMS permissions. Which IAM permission model change is required for the decryption call to succeed?

    • A. The execution role needs kms:Decrypt permission on the specific key, and the key's key policy must also allow that role to use the key
    • B. Grant kms:Decrypt to the execution role in an IAM policy only, since a key policy cannot restrict principals in the key's account
    • C. Add kms:Decrypt to the Lambda function's resource-based policy, since KMS evaluates the policy on the calling resource, not the role
    • D. Attach the AWSLambdaBasicExecutionRole managed policy, which already includes kms:Decrypt on every customer managed key
    Show answer & explanation

    Answer: A
    KMS is unusual among AWS services: a key policy does not automatically trust the account, so an IAM policy can grant kms:Decrypt only if the key policy allows it (the default 'Enable IAM User Permissions' statement) or names the role directly. The execution role therefore needs kms:Decrypt on the key, and the key policy must permit that role to use the key. Option B gets the model backwards; without a key policy statement that enables IAM policies or names the role, IAM allow statements for the key are ineffective even inside the same account. Option C confuses two resource policies; the function's resource-based policy controls who may invoke the function, while access to the key is decided by the key policy together with the caller's IAM policy. Option D is wrong about the managed policy, which grants only the CloudWatch Logs permissions (CreateLogGroup, CreateLogStream, PutLogEvents) and nothing in KMS.

  10. 91. A company wants developers calling their internal APIs hosted on API Gateway to authenticate using short-lived AWS Signature Version 4 signed requests derived from IAM credentials, rather than managing separate API keys. Which API Gateway authorization option supports this?

    • A. API key authorization with usage plans as the sole mechanism
    • B. No authorization, relying only on network-level security groups
    • C. Resource policies attached to an unrelated S3 bucket
    • D. IAM authorization on the API Gateway method
    Show answer & explanation

    Answer: D
    IAM authorization on an API Gateway method requires callers to sign requests with SigV4 using valid IAM credentials, letting API Gateway verify the caller's identity and permissions without separate API keys. API keys with usage plans (A) are meant primarily for throttling/quota tracking of API consumers and are not tied to IAM credential based SigV4 signing. Relying only on security groups (B) does not apply to API Gateway's HTTP-level access (API Gateway does not sit behind customer-managed security groups the way EC2 does for regional REST APIs invoked over the internet), and provides no request-level identity authorization. An S3 bucket resource policy (C) governs access to S3 objects, not to API Gateway API methods.

  11. 92. A developer caches API responses at the gateway. What must be considered about the cache key?

    • A. Whether it fits in the 1,048,576-byte maximum cacheable response size, since larger keys are truncated
    • B. Whether it includes the parameters that vary the response, since omitting one returns another caller's result
    • C. Whether the TTL is below the 300-second default, since API Gateway evicts entries by time, never by key
    • D. Whether the cache capacity is at least 0.5 GB, since smaller caches hash every request to a single key
    Show answer & explanation

    Answer: B
    API Gateway caches per stage and forms the cache key from the method and path plus the query strings, headers or path parameters you explicitly mark as cache key parameters. If a parameter that changes the response, most dangerously a user identifier or Authorization header, is not part of the key, one caller's cached response is served to another; this defect appears only under concurrent use by different callers. Option A mixes up two limits: 1,048,576 bytes is the largest response API Gateway will cache, and keys are not truncated; a request whose response is too large is simply not cached. Option C is not the correctness issue; entries can also be invalidated per request with Cache-Control: max-age=0 by an authorized caller, and a short TTL merely shortens how long a cross-caller leak lasts. Option D invents a behavior; 0.5 GB is simply the smallest cache size available, and capacity affects hit rate and throughput, not how keys are formed.

  12. 93. An application must authenticate end users and obtain scoped, temporary credentials for them to access resources directly. Which approach fits?

    • A. An IAM user created per end user by the application at sign-up, with an access key pair returned after sign-in
    • B. A single IAM user whose access keys are shared by every end user and rotated every 90 days by a scheduled function
    • C. A user identity service issuing tokens exchanged for temporary credentials through role assumption, scoped per user
    • D. The application's own execution role assumed directly by the browser, using the instance metadata credentials
    Show answer & explanation

    Answer: C
    Federation through Cognito (a user pool for authentication, an identity pool to exchange the token for STS credentials) gives each user short-lived credentials from a role whose policy can be scoped with the user's identity, so users reach only their own resources and nothing durable has to be issued or revoked per person. Option A creates a durable IAM principal per person, which does not scale, hands long-term keys to devices and leaves every credential to be rotated and revoked individually. Option B cannot distinguish one user from another, so nothing prevents an authenticated user from reading another user's data, and one leaked key exposes everyone. Option D exposes the server's own permissions to every client and, because the metadata credentials belong to the host, gives users far more than their own resources.

  13. 94. A developer must grant a function permission to read from one specific storage prefix and nothing else. What does the policy require?

    • A. An action limited to read operations and a resource ARN scoped to that prefix, rather than a wildcard over the whole bucket
    • B. The AmazonS3ReadOnlyAccess managed policy on the execution role, since managed policies can be narrowed later with a permissions boundary
    • C. s3:* on the bucket ARN with a Deny statement for every other prefix, since explicit denies are evaluated before any allow
    • D. No IAM policy at all, since a Lambda function inherits the S3 permissions of the account's root user unless it is restricted
    Show answer & explanation

    Answer: A
    Least privilege is expressed in both dimensions of a statement: the Action list (s3:GetObject, and s3:ListBucket with a prefix condition if listing is needed) and the Resource ARN arn:aws:s3:::bucket/prefix/*; a wildcard over the bucket or over all actions grants far more than the function needs. Option B grants read access to every bucket in the account, and a permissions boundary is a separate guardrail that has to be designed and attached; convenience grants are rarely narrowed later. Option C allows every S3 action, including delete and write, on the one prefix and relies on a growing deny list that must be maintained as prefixes are added; it is the opposite of a minimal allow. Option D is false: a function has exactly the permissions of its execution role and inherits nothing from the account; with no policy it cannot read the bucket at all.

  14. 95. A configuration value of about 6 KB must be stored in Systems Manager Parameter Store. The developer's PutParameter call fails on size. What explains the failure and the fix?

    • A. Standard parameters cap the value at 4 KB; creating it as an advanced parameter raises the cap to 8 KB
    • B. Standard parameters cap the value at 4 KB; enabling higher throughput on the account raises the cap to 8 KB
    • C. Standard parameters cap the value at 4 KB; storing it as a SecureString raises the cap to 8 KB per value
    • D. Standard parameters cap the value at 8 KB; only advanced parameters may exceed that, up to 64 KB
    Show answer & explanation

    Answer: A
    The standard tier allows a 4 KB maximum value and 10,000 parameters per account and Region, while the advanced tier allows 8 KB, 100,000 parameters, and parameter policies, at a cost. Higher throughput (B) is a separate setting that raises transactions per second and changes no size limit. SecureString (C) describes encryption with KMS, not capacity. Option D inflates both numbers; 8 KB is the advanced ceiling, and a parameter cannot be downgraded from advanced back to standard.

  15. 96. A Lambda function reads a SecureString parameter with GetParameter and WithDecryption set to true. The call returns an access denied error even though the role allows ssm:GetParameter. What is missing?

    • A. The ssm:DescribeParameters permission on the parameter path, required whenever decryption is requested
    • B. The kms:Decrypt permission on the KMS key that encrypted the parameter value
    • C. The kms:GenerateDataKey permission on the KMS key, which decryption of a SecureString requires
    • D. The ssm:GetParametersByPath permission, which WithDecryption requests are evaluated against
    Show answer & explanation

    Answer: B
    A SecureString value is encrypted with a KMS key, so retrieving it with decryption needs kms:Decrypt on that key in addition to the Systems Manager read permission. DescribeParameters (A) lists parameter metadata and is not consulted for a value read. GenerateDataKey (C) is the permission needed to create a data key when writing encrypted data, not to reverse it. GetParametersByPath (D) is a separate API for hierarchy reads and is not implied by a GetParameter call.

  16. 97. A fleet of Lambda functions reads the same Parameter Store values on every invocation. During traffic spikes the functions log ThrottlingException from GetParameter. What is the most direct remedy pair?

    • A. Replace GetParameter with GetParametersByPath on every invocation and raise the function's reserved concurrency
    • B. Replace GetParameter with DescribeParameters, which is evaluated against a separate and much larger quota
    • C. Cache values across warm invocations and enable higher Parameter Store throughput for the account and Region
    • D. Cache values across warm invocations and convert every parameter from the standard tier to the advanced tier
    Show answer & explanation

    Answer: C
    Parameter Store's default throughput is 40 transactions per second shared across GetParameter, GetParameters, and GetParametersByPath; AWS recommends caching values for reuse and, for sustained volume, enabling higher throughput, which raises GetParameter to 10,000 TPS at additional cost. Tiers (D) control size and features, not request rate. GetParametersByPath (A) has the lowest ceiling of the three read APIs under higher throughput, at 100 TPS, so calling it more often makes matters worse. DescribeParameters (B) returns metadata, not values.

  17. 98. A database credential in Secrets Manager must rotate without any window in which running applications are rejected by the database. Which rotation strategy meets that requirement?

    • A. The single user strategy combined with a longer rotation schedule to shrink the affected window
    • B. The alternating users strategy, which avoids needing a separate superuser secret to clone the user
    • C. The single user strategy, which updates the password in place and is the simpler option to operate
    • D. The alternating users strategy, which keeps one credential usable while the other is being rotated
    Show answer & explanation

    Answer: D
    The alternating users strategy maintains two credentials that swap roles, so one stays valid while the other rotates, which is why AWS recommends it for production availability. The single user strategy (C and A) changes the password of one user and leaves a brief period in which the old password is rejected, and lengthening the schedule reduces how often that happens without removing it. Option B names the right strategy but the wrong detail: alternating users requires a superuser secret to manage the second account.

  18. 99. During a Secrets Manager rotation, an application calling GetSecretValue with no version specified keeps receiving the old credential even though a new one has been created. Which staging label explains this?

    • A. The new version carries AWSPENDING, and GetSecretValue returns AWSCURRENT unless a version is named
    • B. The new version carries AWSCURRENT immediately, but clients cache the old value for up to 10 minutes
    • C. The new version carries AWSPREVIOUS until testSecret passes, and GetSecretValue always returns AWSCURRENT
    • D. The new version carries no label until finishSecret runs, and unlabeled versions are returned last
    Show answer & explanation

    Answer: A
    Rotation runs createSecret, setSecret, testSecret, and finishSecret; the new version is labeled AWSPENDING at creation and only becomes AWSCURRENT when finishSecret moves the label, at which point the old version becomes AWSPREVIOUS. GetSecretValue returns AWSCURRENT by default, so the old value is correct until the swap. Option C reverses the labels, option B asserts a swap that has not happened yet and a cache Secrets Manager does not impose, and option D misdescribes the labeling, since the pending version is labeled from the moment it is created.

  19. 100. An application must encrypt files of several hundred megabytes with a customer managed KMS key. Sending the file to KMS is not possible. Which sequence implements envelope encryption correctly?

    • A. Call GenerateDataKeyWithoutPlaintext, encrypt the file with the returned blob, and call Decrypt on each read
    • B. Call GenerateDataKey, encrypt the file with the plaintext key, store the encrypted key, then discard the plaintext
    • C. Call GenerateDataKey, encrypt the file with the encrypted key blob, then store the plaintext key beside the file
    • D. Call Encrypt with the file contents, store the returned ciphertext, then call Decrypt to recover it later
    Show answer & explanation

    Answer: B
    GenerateDataKey returns both a Plaintext data key and a CiphertextBlob; the documented pattern is to encrypt locally with the plaintext key, store the encrypted copy alongside the data, erase the plaintext from memory, and call Decrypt to recover the key later. Option C stores the wrong half and encrypts with the wrong one. The Encrypt API (D) is designed for small values and cannot take a large file. GenerateDataKeyWithoutPlaintext (A) deliberately withholds the usable key, so it must be decrypted before any encryption can happen.

2026 statistics

Key facts: AWS Developer Associate (DVA-C02) exam

Questions
65
Time limit
2h 10m
Passing score
720/1000
Exam fee
$150

This free AWS Developer Associate (DVA-C02) practice test has 160 original questions written to Amazon Web Services (AWS)'s official content outline, last checked against it on July 18, 2026, 100 of them listed on this page and the rest loaded by the drill. Every question shows a worked explanation, and nothing here requires a signup.

The questions are grouped under four outline areas: Deployment, Troubleshooting and Optimization, Development with AWS Services and Security.

As of 2026, the AWS Developer Associate (DVA-C02) exam fee is $150.

How the AWS Developer Associate (DVA-C02) practice bank covers the outline

160 questions across 4 outline areas — the same areas the page's sections use.

Counts are the live question bank, grouped by the outline area each question was written to.

160 questions across four outline areas. The largest, Development with AWS Services, holds 51 questions (32%); the page's sections follow the same split.
Exam format and study resources

Get a free AWS Developer Associate (DVA-C02) study plan

A week-by-week plan plus new practice questions, straight to your inbox.

Official sources

Primary documents used to verify the exam details shown on this page.

Last verified against the official exam content outline:

Frequently asked questions

How many questions are on the AWS Certified Developer - Associate exam, and how much time do I get?

The exam contains 65 questions, which are either multiple choice or multiple response, and you are given 130 minutes to complete it. Of those 65 questions, only 50 affect your score — the other 15 are unscored questions that do not count toward your result. Since unscored questions are not identified during the exam, treat every question as if it counts. The timing works out to exactly two minutes per question, so full-length timed practice sets are the most realistic way to build the pacing you'll need on test day.

What score do I need to pass the AWS Developer - Associate exam?

You need a minimum passing score of 720, reported on a scaled score range of 100 to 1,000. Your scaled score is derived from your performance on the 50 scored questions; the 15 unscored questions have no effect on your result. Because scoring is scaled rather than a simple percentage, there is no fixed number of correct answers that guarantees a pass — so don't waste exam time trying to guess which questions 'don't count.' Instead, use timed practice exams beforehand to confirm you're consistently performing well above the passing threshold.

Which exam domains should I spend the most practice time on?

The official exam guide defines 4 content domains: Development with AWS Services (32% of scored content), Security (26%), Deployment (24%), and Troubleshooting and Optimization (18%). Development and Security together make up 58% of your scored content, so hands-on fluency with core AWS services and security patterns should anchor your preparation. That said, don't neglect the smallest domain — at 18%, Troubleshooting and Optimization still represents roughly 9 of the 50 scored questions, which is more than enough to swing a borderline result.

How much does the exam cost, and how does scheduling work?

The exam costs 150 USD to register. You schedule it with Pearson VUE from your AWS Certification account, which routes you to Pearson VUE's scheduling system. You can take the exam either at a physical Pearson VUE test center or as an OnVUE online proctored exam, and most online-proctored appointments are available 24 hours a day, 7 days a week — useful if you want an early-morning or late-night slot. If plans change, you can reschedule up to 24 hours before your scheduled exam time, but each appointment can only be rescheduled twice, so it's wise to book once your practice scores are consistently strong. After you pass, the credential is valid for 3 years.