Course menuDVA-C03

Exams / DVA-C03 / Sample questions

DVA-C03 sample questions from the practice sets

10 questions taken from across the 5 paid practice sets, covering every domain of the exam guide. None of them are in the free exam. Try each one, then open the answer to see why every option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

  1. Question 1 Development with AWS Services From Practice set 1

    A property-management company offers a POST /statements endpoint in Amazon API Gateway that invokes a Lambda function. The function renders each owner statement as a PDF, which takes three to six minutes.

    Many requests fail with 504 errors at the integration timeout, and when owners retry, a second render starts and both are billed. The company needs callers to get an immediate answer, no duplicate renders, and a way to download the finished PDF later.

    Which design should the developer use?

    Choose one answer.

    1. A. Raise the rendering function's memory setting so that every statement finishes before the API's default 29-second integration timeout.
    2. B. Keep the synchronous call, and have API Gateway retry the render automatically each time the integration times out, so the owner eventually receives the PDF.
    3. C. Accept each request, queue a render job in Amazon SQS, return 202 Accepted with a job ID, and let the owner poll a status endpoint for the PDF.
    4. D. Keep the synchronous call and ask owners to raise the HTTP timeout in their browsers, so that the request stays open for the full render.
    Show the answer and explanation

    Answer: C

    • A. Wrong: Extra memory can speed up rendering, but a job that takes several minutes still outlasts the default 29-second integration timeout, and raising that quota would not give callers an immediate answer. Retries would still start duplicate renders.
    • B. Wrong: Each automatic retry of a slow synchronous call starts another full render and holds the client connection open. This adds duplicate work and still cannot finish within the integration timeout.
    • C. Right: Correct. The API answers at once, so no request waits for the render. A worker takes jobs from the queue at its own pace, and the status endpoint tells the owner when the PDF is ready.
    • D. Wrong: A browser timeout does not change the API Gateway integration timeout, so the gateway still returns a 504 at its limit. Owners who retry would still start duplicate renders.

    Explanation

    Long work belongs behind a queue, not inside a synchronous API call. Accepting the request, returning a job ID and rendering in a worker removes the integration timeout from the path, and the status endpoint keeps retries from starting duplicate renders. Bigger memory and longer client timeouts leave the synchronous limit in place.

    Study

  2. Question 2 Development with AWS Services From Practice set 1

    A claims-intake team runs Amazon EC2 workers that poll an Amazon SQS standard queue with the default visibility timeout. Each message starts an OCR job that usually takes 20 seconds, but a scanned multi-page file can take up to 4 minutes.

    Support staff report that some claims are imported twice into the claims database. The producer and the queue type cannot change.

    Which TWO changes should the developer make? (Choose two.)

    Choose two answers.

    1. A. Raise the queue's visibility timeout above 4 minutes, or call ChangeMessageVisibility to extend the timeout while each OCR job is still running.
    2. B. Turn on long polling for the queue by setting ReceiveMessageWaitTimeSeconds, so that workers make fewer empty receive calls and the cost of polling falls.
    3. C. Add a delivery delay of 4 minutes to the queue, so that every message stays hidden for four minutes after it has been sent.
    4. D. Make the import idempotent and keyed on the claim ID, so that a second import of the same message finds the existing record and writes nothing new.
    5. E. Convert the queue to a FIFO queue, which delivers each message exactly once, so duplicate imports can no longer happen.
    Show the answer and explanation

    Answers: A, D

    • A. Right: Correct. A message that is still being processed must stay hidden, so the timeout has to cover the longest job. ChangeMessageVisibility lets a worker extend the timeout for the job it is running. Learn more: Amazon SQS visibility timeout (opens in a new tab)
    • B. Wrong: Long polling reduces empty responses and cost, but a message is still redelivered if its visibility timeout expires during processing. It does not stop the duplicate import.
    • C. Wrong: A delay queue hides new messages only for a period after they are sent. It does not hold a message that a worker is already processing, so the redelivery still happens.
    • D. Right: Correct. Standard queues deliver at least once, so a duplicate can still arrive, and the consumer must tolerate it. Keying the write on the claim ID turns a repeat into a no-op.
    • E. Wrong: The queue type is fixed by the requirements. FIFO deduplication applies to sends, and a visibility timeout still redelivers a message that a worker has not deleted.

    Explanation

    Two problems cause the duplicates: the visibility timeout expires while long jobs still run, and standard queues can deliver a message more than once. Extending the timeout to cover the longest job stops most redeliveries, and an idempotent import makes any remaining duplicate harmless. Long polling, delay queues and FIFO conversion do not fix either cause.

    Study

  3. Question 3 Development with AWS Services From Practice set 2

    A thumbnail service runs as an AWS Lambda function behind a REST API in Amazon API Gateway, using a Lambda proxy integration.

    The function reads a JPEG thumbnail from Amazon S3 and returns the image bytes to the caller. Browsers receive corrupted data instead of a valid image, even though the function returns the correct bytes. The team wants browsers to display the image directly, with no change to the client code.

    Which TWO changes are needed? (Choose two.)

    Choose two answers.

    1. A. Set the response Content-Type header to application/json, so that API Gateway passes the bytes through unchanged.
    2. B. Add image/jpeg, or */* for browser clients, to the API's binary media types.
    3. C. Enable API caching on the stage, so that image responses are stored and served to browsers as binary data.
    4. D. Add a request validator with a model that describes the JPEG, so that each response is checked before it is sent.
    5. E. Return the image base64-encoded in the body, with isBase64Encoded set to true and Content-Type set to image/jpeg.
    Show the answer and explanation

    Answers: B, E

    • A. Wrong: JSON is a text type, so API Gateway would still treat the bytes as a text payload and corrupt them. The Content-Type has to describe the image.
    • B. Right: Correct. Without a matching binary media type, API Gateway does not treat the payload as binary. Adding one tells the API to pass that content type through as binary data.
    • C. Wrong: Caching stores whatever response the function produced. It does not change how the payload is encoded in transit.
    • D. Wrong: Request validators check incoming requests, not outgoing responses. They do not change how the payload is encoded.
    • E. Right: Correct. A Lambda proxy integration needs a binary body base64-encoded, and the isBase64Encoded flag tells API Gateway to decode it before sending.

    Explanation

    By default API Gateway handles payloads as UTF-8 text. For a binary response from a Lambda proxy integration, the API's binary media types must include the image's content type, and the function must base64-encode the body and set isBase64Encoded to true. API Gateway uses the first Accept header value to decide whether to return binary, which is why */* is used when browsers send several types.

    Study

  4. Question 4 Security From Practice set 2

    A web app uses an Amazon Cognito user pool for sign-in.

    The security team now requires every user to enter a code from an authenticator app, in addition to their password, each time they sign in. This applies to users who signed up before the change as well. The developer wants to use the built-in Cognito setting rather than custom code.

    What should the developer configure?

    Choose one answer.

    1. A. Create an identity pool, and attach a policy to its authenticated role that requires MFA for each sign-in.
    2. B. Add a pre sign-up Lambda trigger that sends a one-time code to each new user before the account is created.
    3. C. Set a stronger password policy that requires longer passwords with symbols and numbers for every user.
    4. D. Set MFA to required on the user pool, and enable TOTP authenticator apps as an allowed second-factor method.
    Show the answer and explanation

    Answer: D

    • A. Wrong: Identity pools issue AWS credentials after a user has signed in. They do not add a second factor to user pool sign-in.
    • B. Wrong: A pre sign-up trigger runs once, when an account is created. It does not run each time a user signs in.
    • C. Wrong: A stronger password is still a single factor. It does not add an authenticator app code to sign-in.
    • D. Right: Correct. With MFA required, every user must present a second factor at sign-in, and TOTP is the authenticator app method.

    Explanation

    Cognito user pools set MFA to required, optional or off. With required, every user must present a second factor, such as a TOTP code from an authenticator app, an SMS code or an email code, each time they sign in. Federated users are authenticated by their identity provider instead, so this setting does not apply to them.

    Study

  5. Question 5 Security From Practice set 2

    A deployment pipeline creates a Lambda function with the AWS CLI, using a developer's IAM user.

    The user's policy allows lambda:CreateFunction, and the function reuses an existing execution role named orders-exec. The call fails with an error saying the user is not authorized to perform iam:PassRole on orders-exec. The team does not want to create new roles or give the user any other access.

    Which TWO conditions must be met for the function to be created with that role? (Choose two.)

    Choose two answers.

    1. A. The user's identity policy allows iam:PassRole on the ARN of the orders-exec role.
    2. B. The trust policy of orders-exec allows the lambda.amazonaws.com service principal to assume the role.
    3. C. The permissions policy attached to orders-exec allows iam:PassRole on its own ARN.
    4. D. The user's identity policy allows iam:CreateRole, so that Lambda can create a copy of the role.
    5. E. The user's identity policy allows sts:AssumeRole on the orders-exec role's ARN.
    Show the answer and explanation

    Answers: A, B

    • A. Right: Correct. Passing a role to a service is checked against the caller's permissions, so the user needs iam:PassRole on that role. The permission can be narrowed with the iam:PassedToService condition. Learn more: Grant a user permissions to pass a role to an AWS service (opens in a new tab)
    • B. Right: Correct. The role must trust the service, so Lambda is named as the principal in the trust policy. Lambda assumes the role itself when the function runs. Learn more: Defining Lambda function permissions with an execution role (opens in a new tab)
    • C. Wrong: PassRole is checked on the identity that configures the service, not on the role being passed. A permissions policy on the role cannot give the user the right to pass it.
    • D. Wrong: The pipeline uses an existing role, so creating roles is not needed. The request fails on PassRole, not on role creation.
    • E. Wrong: The user never assumes the role. Lambda assumes it when the function runs, so the user needs no AssumeRole permission.

    Explanation

    Giving a service a role counts as passing it, so the identity that configures the function needs iam:PassRole on that role. The role's trust policy must also name lambda.amazonaws.com, because Lambda assumes the role when the function runs. Permissions on the role itself and AssumeRole rights for the user are not checked when the function is created.

    Study

  6. Question 6 Security From Practice set 2

    A ticketing API in Amazon API Gateway must allow a request only when a custom permissions service approves it.

    The decision depends on three inputs: an X-Tenant-Id header, an apiVersion query string parameter and the HTTP method. The API issues no tokens. Responses are cached for five minutes, and a cached decision must never be reused across different tenants or API versions.

    Which authorizer should the developer use?

    Choose one answer.

    1. A. A TOKEN Lambda authorizer that reads the X-Tenant-Id header as its single token source, with caching on.
    2. B. A Cognito user pool authorizer, with the tenant held in a custom attribute that the pool checks on each request.
    3. C. A REQUEST Lambda authorizer with the X-Tenant-Id header and the apiVersion query string as identity sources.
    4. D. IAM authorization with a resource policy condition that matches the X-Tenant-Id header value.
    Show the answer and explanation

    Answer: C

    • A. Wrong: A TOKEN authorizer receives one bearer token value, so it cannot see the query string. Its cache key is only that one value, so it cannot separate decisions by version.
    • B. Wrong: A Cognito authorizer validates Cognito tokens and cannot call a custom permissions service. It also needs tokens, which this API does not issue.
    • C. Right: Correct. A REQUEST authorizer receives headers, query string parameters and context, and it can call the permissions service with all three inputs. When caching is on, every identity source forms the cache key, so tenants and versions stay apart. Learn more: Use API Gateway Lambda authorizers (opens in a new tab)
    • D. Wrong: IAM authorization checks signed AWS identities against IAM policies. It cannot call a custom permissions service to decide whether a request is approved.

    Explanation

    API Gateway offers two kinds of Lambda authorizer. A TOKEN authorizer receives one bearer token, while a REQUEST authorizer receives a combination of headers, query string parameters and context. With caching on, all identity sources of a REQUEST authorizer form the cache key, which keeps decisions separate for each tenant and version. The Lambda function can then pass all three inputs to the permissions service.

    Study

  7. Question 7 Testing and Deployment From Practice set 3

    A developer packages a Python Lambda function as a container image built from the AWS Lambda Python base image.

    The code is in app.py, which is copied to ${LAMBDA_TASK_ROOT}, and the entry point is the function process(event, context) defined in that file.

    The team wants the container to start the Lambda runtime with the correct handler, and it wants no changes to app.py.

    Which Dockerfile instruction sets the handler correctly?

    Choose one answer.

    1. A. Set ENTRYPOINT [ "python", "app.py" ], so that the container runs the script directly as its main program.
    2. B. Set CMD [ "app.process" ], using the file name and the function name separated by a dot.
    3. C. Set ENV HANDLER=app.process, because the base image reads the handler from an environment variable at startup.
    4. D. Set CMD [ "process.app" ], which reverses the order so that the function name comes first in the handler string.
    Show the answer and explanation

    Answer: B

    • A. Wrong: Wrong. Running the script directly starts app.py as a program, so the Lambda runtime never calls process with the event and context. The handler must be passed to the runtime through CMD.
    • B. Right: Correct. The AWS Python base images pass the CMD value to the Lambda runtime as the handler, written as the file name and function name separated by a dot. app.process points at the process function in app.py. Learn more: Deploy Python Lambda functions with container images (opens in a new tab)
    • C. Wrong: Wrong. The Python base image takes the handler from CMD, not from an environment variable, so HANDLER has no effect. An environment setting does not change the entry point.
    • D. Wrong: Wrong. The handler format is the file name followed by the function name, so process.app points at a file named process with a function named app. That file does not exist in this image.

    Explanation

    For the AWS Python base images, the CMD instruction names the Lambda handler. The handler is written as the file name, a dot, and the function name, so app.process runs process from app.py. Changing the entry point or using an environment variable would not give the runtime the correct handler.

    Study

  8. Question 8 Testing and Deployment From Practice set 3

    A developer deploys this AWS SAM template, and the deployment fails with the error "Must specify valid parameter values for policy template".

    The OrdersTable resource is defined elsewhere in the same template. The team wants the function to read and write the table and to publish CloudWatch metrics.

    What should the developer change?

    OrdersFunction: Type: AWS::Serverless::Function Properties: Handler: app.handler Policies: - DynamoDBCrudPolicy: TableName: !Ref OrdersTable - CloudWatchPutMetricPolicy

    Choose one answer.

    1. A. Replace TableName: !Ref OrdersTable with the table's full ARN, because the DynamoDB policy needs the ARN rather than the table name.
    2. B. Add Transform: AWS::Serverless-2016-10-31 under the function's Properties section, since SAM reads policy templates from there.
    3. C. Write the second entry as CloudWatchPutMetricPolicy: {}, because a policy template with no placeholder values still needs the empty object.
    4. D. Remove the CloudWatchPutMetricPolicy entry, because SAM only accepts policy templates that take a parameter such as a table name.
    Show the answer and explanation

    Answer: C

    • A. Wrong: Wrong. DynamoDBCrudPolicy takes the table name, and the policy template builds the full ARN from it. Passing an ARN would not fix the entry that fails, which is the one without parameters.
    • B. Wrong: Wrong. The function is an AWS::Serverless resource, so the template already depends on the transform declared at its top level. Moving a transform into Properties is not valid, and the error points at the policy entry.
    • C. Right: Correct. Every SAM policy template in the Policies list must be an object. A template with no placeholder values is written with an empty object, so CloudWatchPutMetricPolicy: {} fixes the error and keeps the metrics permission. Learn more: AWS SAM policy templates (opens in a new tab)
    • D. Wrong: Wrong. SAM accepts policy templates that take no parameters, so this is not a rule. Removing the entry drops the metrics permission that the team needs, and the fix is to add the empty object.

    Explanation

    SAM policy templates in the Policies list take an object of placeholder values. CloudWatchPutMetricPolicy has no placeholder values, so it must still be written as an empty object, and the bare name causes the error. The DynamoDBCrudPolicy entry is valid as written because it takes a table name.

    Study

  9. Question 9 Troubleshooting and Optimization From Practice set 4

    A Lambda function writes its logs as JSON, for example {"level":"ERROR","orderId":"8841","message":"Payment declined"}. The team wants a CloudWatch Logs Insights query that counts ERROR entries in each 5-minute interval, based only on the level field.

    Messages that contain the word ERROR inside other text must not be counted.

    Which query should the developer run?

    Choose one answer.

    1. A. fields @message | filter @message like /ERROR/ | stats count(*) by bin(5m)
    2. B. fields @timestamp, level | filter level = "ERROR" | stats count(*) by bin(5m)
    3. C. fields @message | stats count(*) by level
    4. D. Export the log group to S3 with CreateExportTask, then count the ERROR lines with a script after each export.
    Show the answer and explanation

    Answer: B

    • A. Wrong: This matches the word ERROR anywhere in the event text, including inside other fields. The team wants only the level field to count, so this can over-count.
    • B. Right: Correct. Logs Insights automatically discovers fields in JSON log events, so the level field can be filtered on directly. The stats command then counts the matching entries in 5-minute buckets. Learn more: Analyzing log data with CloudWatch Logs Insights (opens in a new tab)
    • C. Wrong: This groups by the level field but gives no 5-minute intervals. The team needs a count for each interval, so this does not meet the requirement.
    • D. Wrong: This works, but the export is a batch job and a script must do the counting. The team wants an interactive query in Logs Insights.

    Explanation

    Logs Insights discovers fields in JSON log events, so a query can filter on the level key directly and count the matches in 5-minute buckets. Matching the raw message text would also count ERROR inside other fields. The other options either do not give time buckets or move the work out of Logs Insights.

    Study

  10. Question 10 Troubleshooting and Optimization From Practice set 2

    A developer sees a permissions error in the AWS Lambda console while configuring a function, and is not sure what is wrong.

    The error message does not explain the cause or the fix. The developer wants an AI-generated explanation and suggested steps to resolve the error, without leaving the console or opening a support case.

    Which feature should the developer use?

    Choose one answer.

    1. A. The AWS X-Ray trace map for the function, filtered to the failed request so that the cause of the error appears.
    2. B. An AWS Trusted Advisor check for the account, refreshed from the console to list the permission that failed.
    3. C. The Diagnose with Amazon Q button in the error message, which explains the error and lists steps to resolve it, including IAM errors.
    4. D. A CloudTrail Lake query that lists every API call made by the developer's role, so that the failed call can be found.
    Show the answer and explanation

    Answer: C

    • A. Wrong: X-Ray traces requests through a running application. It does not explain a console configuration error.
    • B. Wrong: Trusted Advisor reviews the account against best practice checks. It does not diagnose a specific console error.
    • C. Right: Correct. When Amazon Q can help with an error, the button appears in the message, and Amazon Q explains the error and suggests steps to resolve it, including for IAM permission errors.
    • D. Wrong: This could show the failed call, but it gives no explanation of the cause and no steps to fix it.

    Explanation

    Amazon Q Developer can troubleshoot errors in the AWS Management Console. When it can help, a Diagnose with Amazon Q button appears in the error message. Amazon Q explains the error and provides a series of steps to resolve it, and it covers IAM permission errors on all console pages.

    Study

Like these? There are 390 more.

The DVA-C03 practice sets: 5 sets, 390 questions in the same style, none of them in the free exam. One payment of$14.99, no subscription, with access for at least 12 months.

Questions about a question or your purchase? Email support@exampark.app and we'll sort it out.

Every exam starts with free questions. No account needed.