AWS Certified Developer - Associate (DVA-C03) Exam-style mock test
AWS Certified Developer Associate (DVA-C03) Practice Exams|Practice test
Full explanations
Exam format
Pass line 72%
33 USD One-time · lifetime access
Enroll →
Sample questions
Example1 · Development with AWS Services
A payments team runs a REST endpoint on Lambda behind API Gateway. A downstream ledger service occasionally returns HTTP 500 for a few seconds during redeploys. The team wants the function to retry transient failures without hammering the ledger. Which retry code best fits?
・ while True:
r = call_ledger()
if r.ok: break
# no delay
Incorrect. A tight loop with no delay amplifies load and can worsen the outage.
✓ for i in range(5):
r = call_ledger()
if r.ok: break
sleep(2**i + random())
Correct. Exponential backoff with jitter spaces out retries so transient 500s recover without a thundering herd.
・ r = call_ledger(
timeout=900)
return r # just wait longer on a 500
Incorrect. A longer timeout does not recover from a 500; it just waits longer.
・ r = cache.get("ledger")
return r # return the last stale response always
Incorrect. Serving a stale balance for every request returns wrong financial data.
Explanation
Resilient integrations with third parties and downstream services use bounded retries with exponential backoff and jitter so transient errors recover without overloading the dependency.
Example2 · Security
A bank lets customers download their monthly statement PDF from a private S3 bucket. The app must grant each customer temporary direct access to only their own object without making the bucket public. Which SDK call fits best?
✓ url = s3.generate_presigned_url(
"get_object", ExpiresIn=300,
Params={"Bucket": b, "Key": k})
Correct. A presigned URL grants time-limited access to a single object without exposing the bucket or sharing keys.
・ s3.put_bucket_acl(
Bucket=b, ACL="public-read")
# make all statements public to anyone
Incorrect. A public-read ACL would expose every customer's statements to anyone.
・ iam.create_access_key(
UserName=customer)
# issue long-lived keys per customer here
Incorrect. Handing out long-lived access keys is a severe credential-leak risk.
・ s3.put_bucket_website(
Bucket=b, WebsiteConfiguration=cfg)
# host the bucket publicly as a site
Incorrect. Static website hosting makes objects publicly reachable.
Explanation
Presigned URLs give secure, time-limited access to a specific S3 object without changing bucket permissions or sharing credentials.
Example3 · Testing and Deployment
A payments team packages its API as a Docker image and wants to deploy it on AWS Fargate with no servers to manage, updated through a rolling update. Which first step prepares the image for the task definition?
・ aws s3 cp Dockerfile s3://build/ \
&& aws lambda publish-layer-version \
--layer-name api --zip-file fileb://d.zip
Incorrect. A Dockerfile in S3 is not an executable image and Lambda layers are not containers for this.
・ aws ec2 create-launch-template \
--launch-template-name api \
--launch-template-data '{"UserData":"image"}'
Incorrect. Launch-template user data runs on EC2 and is not how Fargate pulls an image.
✓ docker push \
123.dkr.ecr.us-east-1.amazonaws.com/api:1
# then reference this image in the ECS task def
Correct. The image is pushed to ECR and the ECS task definition references that image for Fargate to run.
・ aws dynamodb put-item \
--table-name images \
--item '{"img":{"S":"api:1"},"id":{"S":"1"}}'
Incorrect. DynamoDB stores items, not runnable container images.
Explanation
Containerized deployment on Fargate pushes the image to Amazon ECR and references it from the ECS task definition, which the service runs and updates with rolling updates.
Example4 · Troubleshooting and Optimization
A request to the hospital API spans API Gateway, two Lambda functions, and DynamoDB, and latency spikes are hard to localize. The team wants an end-to-end trace that shows time spent in each hop. Which AWS service provides distributed tracing?
・Amazon S3 server access logs, which record bucket requests
Incorrect. S3 access logs record bucket requests, not cross-service request traces.
・AWS Config recorder, which tracks resource configuration state
Incorrect. AWS Config tracks configuration state, not request latency traces.
✓AWS X-Ray, with tracing enabled across each of the services
Correct. X-Ray traces requests across services and shows latency contributed by each segment.
・Amazon Athena federated queries, which query data stored in S3
Incorrect. Athena queries data in S3 but does not perform distributed tracing.
Explanation
X-Ray provides distributed tracing across service hops.
Example5 · Development with AWS Services
A hospital admissions service calls a third-party eligibility API that returns HTTP 503 during peak load. The developer wants transient failures to be retried without hammering the API or stalling callers. Which approach best fits a resilient integration?
・Retry immediately in a tight loop until the eligibility call finally succeeds
Incorrect. A tight retry loop amplifies load on a struggling dependency and can exhaust the caller.
・Return a cached placeholder record and never call the eligibility API again
Incorrect. Permanently serving stale placeholders abandons the real integration and hides outages.
✓Retry with exponential backoff and jitter, and open a circuit breaker after failures
Correct. Backoff with jitter spaces out retries, and a circuit breaker stops calls while the dependency is unhealthy.
・Raise the function timeout so the single blocking call gets more time
Incorrect. A longer timeout only delays failure and does not address the transient error pattern.
Explanation
Longer timeouts do not reduce the failure rate or protect the dependency.
Example6 · Development with AWS Services
A claims-processing pipeline must accept bursts of insurance submissions, acknowledge each one quickly, and let a worker tier process them later at its own pace. Which pattern decouples intake from processing most directly?
・Have the intake API invoke the processor synchronously and block until the result returns
Incorrect. A synchronous call couples intake latency to processing time and fails under bursts.
・Store each submission in a relational table and have the client poll that table repeatedly
Incorrect. Client polling of a table adds load and still couples the client to processing progress.
・Fan each submission out to every worker so that all of them process the same item
Incorrect. Fanning every message to every worker duplicates work rather than distributing it.
✓Put each submission on an Amazon SQS queue that worker consumers poll asynchronously
Correct. An SQS queue buffers bursts, acknowledges intake fast, and lets consumers pull work at their own rate.
Explanation
SQS buffers producers from consumers so each side scales independently.
Example7 · Development with AWS Services
During checkout on a retail site, the browser sometimes retries the create-order call after a network timeout, and shoppers end up with duplicate orders. Orders live in DynamoDB with order_id as the partition key, and the client sends the same order_id on each retry. Which SDK call makes order creation idempotent?
・ table.put_item(Item=order)
time.sleep(1)
table.put_item(Item=order) # write twice
Incorrect. Writing the item twice guarantees an overwrite and does nothing to stop duplicates.
・ dups = table.scan()["Items"]
if order not in dups:
table.put_item(Item=order)
Incorrect. A scan-then-write check is not atomic, so two concurrent retries can both pass the check and write.
✓ table.put_item(
Item=order,
ConditionExpression=
"attribute_not_exists(order_id)")
Correct. The condition rejects the write when the order_id already exists, so a retried request cannot create a second order.
・ table.put_item(
Item=order,
ReturnValues="ALL_OLD") # keep old item
Incorrect. ReturnValues only reports what was replaced; the overwrite still happens silently.
Explanation
A conditional write with attribute_not_exists makes the insert atomic and idempotent: the first request wins and every retry with the same key is rejected by DynamoDB itself.
Example8 · Development with AWS Services
A flash sale multiplies order traffic by twenty for a few minutes. The storefront must accept and acknowledge every order right away, while the warehouse fulfillment tier keeps working at its own steady rate. Which pattern fits?
✓Queue accepted orders in Amazon SQS and let fulfillment workers consume at their own pace
Correct. An SQS buffer decouples intake from fulfillment: the API acknowledges immediately and workers drain the queue at a sustainable rate.
・Scale the fulfillment database so every order is processed synchronously during the spike
Incorrect. Synchronous processing ties acknowledgment latency to fulfillment capacity, exactly what the spike breaks.
・Return HTTP 429 for any order arriving faster than the warehouse fulfillment rate
Incorrect. Rejecting orders during the sale throws away revenue instead of absorbing the burst.
・Append orders to a file on one EC2 instance and run fulfillment as a nightly batch
Incorrect. A single-instance file is a durability risk and nightly batching violates the immediate-acknowledgment need.
Explanation
Asynchronous queue-based decoupling lets the intake tier acknowledge instantly while a slower consumer tier processes the backlog, which is the standard answer to bursty order traffic.
Example9 · Development with AWS Services
A marketplace publishes OrderPlaced events to an EventBridge bus. Orders whose detail.total exceeds 5000 must additionally invoke a fraud-review Lambda, while smaller orders must not trigger it. Which event pattern on the fraud rule is correct?
・ {"detail": {"total":
["5000+", "high"]}}
Incorrect. These are literal string matches; a numeric total of 7200 would never equal the string "5000+".
・ {"source": ["orders.large"],
"detail": {}}
Incorrect. Matching on source would force the producer to classify orders itself, defeating rule-side filtering.
✓ {"detail": {"total":
[{"numeric": [">", 5000]}]}}
Correct. EventBridge numeric matching compares the total field against the threshold so only qualifying events reach the rule's target.
・ {"detail-type":
[{"prefix": "Order"}]}
Incorrect. A prefix match on detail-type selects every order event regardless of amount.
Explanation
EventBridge rules support numeric comparison operators inside event patterns, letting the consumer-side rule select only events above a monetary threshold.
Example10 · Development with AWS Services
A plant-monitoring platform ingests vibration readings from 5,000 CNC machines. Readings from the same machine must be processed in arrival order, and two separate consumer applications — anomaly detection and long-term archival — must each read the full stream independently. Which approach meets both needs?
✓Publish readings to a Kinesis data stream using the machine ID as the partition key, with each application consuming separately
Correct. A partition key of machine ID keeps per-machine order within a shard, and multiple consumers can each read the whole stream.
・Send readings to one standard SQS queue and let both consumer applications poll their messages from that same queue
Incorrect. Two consumers on one SQS queue split the messages between them; neither sees the full feed.
・Publish readings to an SNS topic and rely on the topic itself to preserve strict ordering for every subscriber
Incorrect. SNS does not guarantee ordered delivery to subscribers in a standard topic.
・Write each reading to an S3 bucket and have both consumers list the bucket for new objects on a fixed schedule
Incorrect. Periodic bucket listing adds latency and gives no per-machine ordering guarantee.
Explanation
Kinesis Data Streams preserves ordering per partition key and supports multiple independent consumers, which is exactly the ordered, fan-out streaming pattern this telemetry workload needs.
Example11 · Development with AWS Services
A supplier portal lets plant managers request a production-history export that takes several minutes to assemble. The web request must come back quickly with a tracking ID while the export is generated in the background. Which pattern fits?
・Keep the HTTP connection open on the web tier and stream progress bytes until the export file is fully built
Incorrect. Holding connections open for minutes ties up the web tier and breaks on client disconnects.
・Raise the API Gateway integration timeout so the synchronous request can wait for the full export to complete
Incorrect. API Gateway's integration timeout cannot be raised to multi-minute synchronous waits for this pattern.
・Have the browser retry the same synchronous export request in a loop until one of the attempts finally succeeds
Incorrect. Retrying a synchronous long request repeats the expensive work and still blocks each attempt.
✓Return HTTP 202 with a job ID, queue the request in SQS, and let a worker build the export
Correct. Accepting the job, returning a tracking ID, and processing asynchronously from a queue is the standard async pattern for long work.
Explanation
Long-running work belongs behind an asynchronous boundary: acknowledge fast with an identifier, process from a queue, and let clients poll or get notified.
Example12 · Development with AWS Services
A city's building-permit portal calls its document-validation service synchronously, so resident submissions fail whenever validation slows down during month-end peaks. The team wants submissions accepted even while validation lags. What should they change?
・Raise the synchronous HTTP timeout so the web tier waits out slow validation
Incorrect. A longer wait still ties each submission to validation availability and worsens the user experience.
・Move the validation service onto a much larger instance so it never slows
Incorrect. Vertical scaling postpones the problem; the tiers remain tightly coupled through a synchronous call.
・Have residents' browsers resubmit the whole application until validation answers
Incorrect. Client-side resubmission multiplies load during peaks and can create duplicate applications.
✓Place an SQS queue between the submission API and the validation workers
Correct. A queue decouples intake from validation, so submissions are stored durably and processed when workers catch up.
Explanation
Loose coupling through a queue lets the intake tier accept work independently of the processing tier's speed, which is the core SQS-based asynchronous pattern.
Example13 · Development with AWS Services
A transit authority's arrival-board API depends on a third-party geocoding provider that suffers multi-minute outages. During outages the API must keep serving cached stop coordinates instead of stalling. Which code pattern achieves this?
・ while not geocode_ok:
r = geocode(addr) # keep calling until the provider finally answers
Incorrect. A blocking retry loop hammers the broken provider and freezes every arrival-board request.
・ r = geocode(addr, timeout=300)
return r # one very long wait instead of any failure handling
Incorrect. Stretching the timeout makes each request hang for minutes; it handles nothing.
✓ if breaker.is_open():
return cached_stop_location()
try:
r = geocode(addr)
breaker.record_success()
except Timeout:
breaker.record_failure()
return cached_stop_location()
Correct. A circuit breaker stops calling the failing provider and degrades gracefully to cached coordinates.
・ r = geocode(addr)
return r # let provider errors propagate straight to every caller
Incorrect. Propagating raw provider errors turns a dependency outage into a full API outage.
Explanation
Circuit breakers with a fallback path keep an application responsive during third-party outages: trip after repeated failures, serve degraded data, and probe for recovery.
Example14 · Development with AWS Services
A multi-tenant project-management SaaS signs up new workspaces in one monolithic request handler that also sends a welcome email and provisions sample data inline. When the email provider slows down, signups time out. Which change decouples these steps?
✓Publish a workspace-created message to an SQS queue and move email sending and sample-data provisioning into separate consumers
Correct. A queue lets the signup handler return immediately while independent consumers process email and provisioning at their own pace.
・Raise the HTTP timeout of the signup endpoint so the request handler can keep waiting for the email provider to finish
Incorrect. A longer timeout still couples signup latency to the email provider and just makes users wait longer.
・Call the email provider from a second synchronous REST hop so the monolith no longer contains that code
Incorrect. A synchronous hop moves the code but keeps the tight runtime coupling and the timeout problem.
・Run email sending in a thread of the same process and block the response until every thread completes
Incorrect. In-process threads still tie the response to the slow dependency and die with the process.
Explanation
Loosely coupled designs put a durable message channel such as SQS between the user-facing request and slow side effects, so each component fails and scales independently.
Example15 · Development with AWS Services
A video platform lets creators submit uploads for transcoding, which takes 5 to 40 minutes per file. The upload API must respond within seconds, and creators poll a status endpoint later. Which pattern fits?
・Hold the HTTP connection open from the upload API until the transcode job finishes and return the final result
Incorrect. Holding connections open for up to 40 minutes exhausts resources and breaks client and gateway timeouts.
・Have API Gateway invoke the transcoder synchronously with a longer integration timeout so the caller receives the finished file
Incorrect. API Gateway integration timeouts are far shorter than a transcode, so synchronous invocation cannot work.
✓Return a job identifier immediately, queue the transcode request in SQS, and let workers update job status asynchronously
Correct. Accepting the job, queuing it, and reporting status later is the standard asynchronous pattern for long-running work.
・Schedule a batch job that transcodes all pending uploads once per hour and notifies creators by email afterwards
Incorrect. Hourly batching adds up to an hour of needless delay and does not match the polling design.
Explanation
Long-running work belongs behind an asynchronous pattern: accept the request, return a job ID, process from a queue, and expose status separately.
▶ Try 10 free questions (graded)