Skip to content
BytePatterns

AIP-C01 · Domain 2: Implementation and Integration · 26% of the exam

Task 2.5: Implement application integration patterns and development tools.

Shipping GenAI features: API design for streaming and long responses, document processing with Bedrock Data Automation, prompt chaining, developer tooling and troubleshooting aids.

Study it

Sample questions

Try each one before opening the answer. Every option is explained, with the AWS documentation page that proves it.

Question 1 · choose 1

An accounts payable team receives invoices from 4,000 suppliers as scanned PDFs and phone photos with very different layouts. It needs 14 fields per invoice, several of which must be normalized (dates in ISO format, amounts in a single currency format) or derived (for example, whether a late fee applies), and the business team wants to describe new fields in natural language instead of writing code. Which solution meets these requirements?

  1. AA knowledge base that ingests the invoices so that users can ask questions about each one
  2. BAn Amazon Bedrock Data Automation project with a custom blueprint for the invoice fields and rules
  3. CAmazon Comprehend custom entity recognition trained on labeled invoices from each supplier
  4. DAmazon Textract AnalyzeExpense with a Lambda function that maps its output and computes the derived fields
Show the answer and why
  • AA knowledge base that ingests the invoices so that users can ask questions about each one

    Incorrect

    A knowledge base answers questions over documents. It does not produce a structured record of 14 normalized fields per invoice.

  • BAn Amazon Bedrock Data Automation project with a custom blueprint for the invoice fields and rules

    Correct

    Blueprints list the fields to extract with their data types and natural-language context that specifies normalization and validation, across documents and images of varying layouts.

  • CAmazon Comprehend custom entity recognition trained on labeled invoices from each supplier

    Incorrect

    Custom entity recognition finds entities in text but needs labeled training data and does not derive values such as whether a late fee applies.

  • DAmazon Textract AnalyzeExpense with a Lambda function that maps its output and computes the derived fields

    Incorrect

    AnalyzeExpense extracts standard invoice fields well, but the normalization and derived fields would be custom code, which the business team wants to avoid.

Intelligent document processing with custom, normalized and derived fields is what Bedrock Data Automation blueprints are designed for: fields, types and natural-language instructions in one artifact, applied to many layouts.

Question 2 · choose 1

A bank must summarize 250,000 archived loan files stored as individual objects in Amazon S3. Each file goes through extraction, a model call on Amazon Bedrock and a validation step. The model quota allows about 100 concurrent requests, the run must survive individual failures without restarting, and the team wants a visual workflow with per-item status. Which orchestration meets these requirements?

  1. AAn S3 event notification on each object that invokes a Lambda function to process the file
  2. BAn AWS Step Functions Map state in Inline mode that processes all objects in a single execution
  3. CAn AWS Step Functions Distributed Map state over the S3 objects with MaxConcurrency set to 100
  4. DAn AWS Step Functions Distributed Map state without a concurrency limit so that the run finishes fastest
Show the answer and why
  • AAn S3 event notification on each object that invokes a Lambda function to process the file

    Incorrect

    Events fire only when objects are written, not for an existing archive, and there is no concurrency cap or visual per-item tracking.

  • BAn AWS Step Functions Map state in Inline mode that processes all objects in a single execution

    Incorrect

    Inline mode runs inside one execution with limits on concurrency and history size that do not suit hundreds of thousands of items.

  • CAn AWS Step Functions Distributed Map state over the S3 objects with MaxConcurrency set to 100

    Correct

    A Distributed Map processes large sets of S3 objects as child workflow executions, MaxConcurrency limits how many run in parallel, and each item's success or failure is tracked separately.

  • DAn AWS Step Functions Distributed Map state without a concurrency limit so that the run finishes fastest

    Incorrect

    Without a limit the map can run up to 10,000 child executions at once, far above the model quota, which leads to throttling.

Document processing at archive scale is a Distributed Map job. Its MaxConcurrency setting is how you respect a downstream quota such as model concurrency, and child executions give per-item status and retries.

Question 3 · choose 1

Model invocation logging for an application is delivered to Amazon CloudWatch Logs. Each request includes requestMetadata with the prompt template version and the tenant ID. Support engineers need to find which template version produces the most responses that stop because of the token limit, without building a new pipeline. What should they do?

  1. AExport the logs to Amazon S3 every night and build an AWS Glue job and an Amazon Athena table for the analysis
  2. BCreate a CloudTrail trail with data events for Amazon Bedrock and search it for InvokeModel calls
  3. CQuery the invocation log group with CloudWatch Logs Insights, grouping max_tokens stops by template version
  4. DTurn on AWS X-Ray active tracing for the Lambda function and inspect the trace map for slow segments
Show the answer and why
  • AExport the logs to Amazon S3 every night and build an AWS Glue job and an Amazon Athena table for the analysis

    Incorrect

    This works, but it is a new pipeline with a day of delay, when Logs Insights can answer the question directly.

  • BCreate a CloudTrail trail with data events for Amazon Bedrock and search it for InvokeModel calls

    Incorrect

    CloudTrail records API calls for auditing, not the model's responses and stop reasons.

  • CQuery the invocation log group with CloudWatch Logs Insights, grouping max_tokens stops by template version

    Correct

    Invocation logs carry the request metadata and the response, and Logs Insights can filter and aggregate those fields in place without a new pipeline.

  • DTurn on AWS X-Ray active tracing for the Lambda function and inspect the trace map for slow segments

    Incorrect

    X-Ray shows where time is spent across services, but it does not aggregate model stop reasons by prompt template version.

Prompt troubleshooting starts with the invocation logs. Tagging requests with requestMetadata, such as template version, makes them filterable, and CloudWatch Logs Insights turns the logs into answers without moving data.

Question 4 · choose 1

A support chat API built on Amazon API Gateway and Lambda sends each user's conversation to a model through the Converse API. Long conversations sometimes fail with a validation error because the input exceeds the model's context window, and finance wants each request's exact token count recorded before it is sent. The team wants the API to check the size of each request and, when it is too large, summarize older turns first, without paying for the check itself. What should the Lambda function do?

  1. ACall CountTokens with the Converse-format messages and summarize the oldest turns when the count passes a threshold
  2. BSet maxTokens to the size of the model's context window so that every request is guaranteed to fit
  3. CAdd an API Gateway request validator with a JSON schema that rejects bodies above a fixed size in bytes
  4. DEstimate the size as characters divided by four and drop the newest messages until the estimate fits the window
Show the answer and why
  • ACall CountTokens with the Converse-format messages and summarize the oldest turns when the count passes a threshold

    Correct

    CountTokens returns the token count the model would use for the same input, at no charge, so the function can record it and shrink the conversation before it is too large.

  • BSet maxTokens to the size of the model's context window so that every request is guaranteed to fit

    Incorrect

    maxTokens limits the generated output, not the input, and a very large value reserves more quota at the start of each request.

  • CAdd an API Gateway request validator with a JSON schema that rejects bodies above a fixed size in bytes

    Incorrect

    Request validation checks the request against a schema, which is useful, but bytes do not map to tokens, and rejecting the request does not summarize the conversation.

  • DEstimate the size as characters divided by four and drop the newest messages until the estimate fits the window

    Incorrect

    Tokenization is model-specific, so a character ratio is only a rough guess, and dropping the newest messages removes the user's current question.

Token limits are managed in the API layer. CountTokens gives the model-specific input count for free, which supports both cost records and context management such as summarizing older turns before the request is sent.

Question 5 · choose 1

An AWS Step Functions workflow summarizes each closed support case with Amazon Bedrock and must then write the summary to the company's SaaS CRM through its REST API, which uses OAuth client credentials. The next state needs the note ID that the CRM returns. The team wants no Lambda functions to maintain, no secrets in the state machine definition, and automatic retries when the CRM answers with HTTP 429. Which approach meets these requirements?

  1. AA Lambda function that reads the OAuth secret from Secrets Manager and calls the CRM
  2. BAn EventBridge rule with an API destination, triggered by an event from the workflow
  3. CAn HTTP Task with an EventBridge connection for OAuth and a Retry on the 429 status
  4. DAn Amazon SQS queue that the CRM reads new summaries from
Show the answer and why
  • AA Lambda function that reads the OAuth secret from Secrets Manager and calls the CRM

    Incorrect

    A function fits calls that need custom logic. It is the code the team does not want to maintain.

  • BAn EventBridge rule with an API destination, triggered by an event from the workflow

    Incorrect

    API destinations call HTTPS endpoints as targets of rules, which suits event delivery. The CRM's response does not come back to the workflow, so the note ID is lost.

  • CAn HTTP Task with an EventBridge connection for OAuth and a Retry on the 429 status

    Correct

    An HTTP Task calls third-party HTTPS APIs from the workflow, and the API response becomes the state output for the next state. Its EventBridge connection holds the OAuth credentials, and a Retry can match States.Http.StatusCode.429.

  • DAn Amazon SQS queue that the CRM reads new summaries from

    Incorrect

    A queue decouples a producer from a consumer that can poll it. The SaaS CRM only offers its REST API.

Workflows can call SaaS APIs directly: HTTP Tasks with connections remove glue code and keep credentials out of the definition.

Question 6 · choose 1

A procurement team uses one prompt that reads a supplier contract, extracts the payment terms, compares them with company policy and drafts an email to the supplier. When an email is wrong, nobody can tell whether extraction or comparison failed, and fixing one instruction often breaks another. The team wants each stage's output checked and stored for audit and a failed stage retried without repeating earlier ones, and it already runs AWS Step Functions. What should the developer do?

  1. AChain extract, compare and draft prompts as separate Step Functions tasks
  2. BAdd five complete contract and email examples to the single prompt
  3. CFine-tune the model on 3,000 past contracts paired with the emails sent
  4. DAsk the model to reason step by step and then write the email in one response
Show the answer and why
  • AChain extract, compare and draft prompts as separate Step Functions tasks

    Correct

    Prompt chaining splits a task into linked LLM calls that pass intermediate results, and Step Functions can orchestrate them. Each task's output can be checked and saved, and Retry applies to the failed state only.

  • BAdd five complete contract and email examples to the single prompt

    Incorrect

    Few-shot examples help a model calibrate its output. It is still one call, with no stage outputs to inspect and no stage-level retry.

  • CFine-tune the model on 3,000 past contracts paired with the emails sent

    Incorrect

    Fine-tuning learns a task from labeled examples. It changes the model, not the single opaque call.

  • DAsk the model to reason step by step and then write the email in one response

    Incorrect

    Step-by-step reasoning helps multi-step deductions within one response. A failure still means repeating the whole call.

Prompt chaining turns one opaque call into steps you can test, audit and retry separately.

Question 7 · choose 1

A GenAI API runs on an Amazon API Gateway REST API and a Lambda function that reads a DynamoDB table, calls a knowledge base Retrieve and then calls Converse. The p99 latency doubled last week. CloudWatch shows that the function's Duration rose, but not which downstream call slowed. The team wants a per-request breakdown across the service boundaries and a service map, with minimal code changes. What should the developer do?

  1. AEnable Amazon Bedrock model invocation logging for the account
  2. BTurn on X-Ray tracing for the API stage, function and SDK clients
  3. CTurn on CloudWatch Lambda Insights for the Lambda function
  4. DCreate a CloudTrail trail that records the Bedrock API calls
Show the answer and why
  • AEnable Amazon Bedrock model invocation logging for the account

    Incorrect

    Invocation logging collects the full request and response data of model calls, which suits reviewing prompts and outputs. It does not time the other calls in the request.

  • BTurn on X-Ray tracing for the API stage, function and SDK clients

    Correct

    X-Ray traces each request through API Gateway and Lambda and shows the calls the application makes to downstream AWS resources, building a service map and per-request segments.

  • CTurn on CloudWatch Lambda Insights for the Lambda function

    Incorrect

    Lambda Insights collects system-level metrics such as CPU time, memory and cold starts, which suits resource problems inside the function. It does not break down downstream calls.

  • DCreate a CloudTrail trail that records the Bedrock API calls

    Incorrect

    CloudTrail records API activity, such as who called which operation and when, for auditing. It does not show where the time of each request went.

Latency questions across service boundaries need distributed tracing. Logs and metrics tell you that something is slow; traces tell you where.

Question 8 · choose 1

A B2B contract analysis API runs on an edge-optimized Amazon API Gateway REST API with a Lambda proxy integration that calls a model. Analyses take 35 to 80 seconds and fail at 29 seconds. Partner contracts require one synchronous request and response, so partners will not poll or read a stream, the API must keep its usage plans and API keys, and traffic is only a few requests a minute. What should the developer do?

  1. AMove the API to an HTTP API with a longer integration timeout
  2. BRequest a higher integration timeout for the current edge-optimized API
  3. CPut an Application Load Balancer in front of the Lambda function
  4. DSwitch the API to a Regional endpoint and raise its integration timeout
Show the answer and why
  • AMove the API to an HTTP API with a longer integration timeout

    Incorrect

    HTTP APIs are lighter and cheaper, but their maximum integration timeout is 30 seconds, and usage plans with API keys are a REST API feature.

  • BRequest a higher integration timeout for the current edge-optimized API

    Incorrect

    The integration timeout can be raised above 29 seconds for Regional and private REST APIs, not for edge-optimized ones.

  • CPut an Application Load Balancer in front of the Lambda function

    Incorrect

    A load balancer waits for a Lambda target until it responds or times out, which suits long calls. It offers no usage plans or API keys.

  • DSwitch the API to a Regional endpoint and raise its integration timeout

    Correct

    An edge-optimized API can be changed to Regional, and Regional REST APIs can raise the integration timeout above 29 seconds, which may lower the Region's throttle quota, acceptable at this volume.

Long synchronous calls are possible on REST APIs, but the endpoint type and the throttle trade-off decide whether the timeout can move.

Question 9 · choose 1

An AWS Step Functions Standard workflow builds a due-diligence pack for each acquisition target. Eleven Amazon Bedrock calls produce the pack in about 25 minutes at a cost of about $40, and a final Task state uploads it to a partner's document portal. Yesterday the portal was down for six hours, and 30 executions failed at the upload state after its retries ran out. The portal is working again. Auditors require one execution ID with a complete history for each pack, finance will not pay for the model calls again, and the state machine definition must stay unchanged. What should the developer do?

  1. AStart a new execution for each pack with the original input
  2. BRedrive each failed execution so that it resumes at the upload state
  3. CRun the upload state alone with the TestState API and the failed input
  4. DAdd a Catch to the upload state that waits an hour and tries again
Show the answer and why
  • AStart a new execution for each pack with the original input

    Incorrect

    A new execution gets a new ID and runs every state again, including the eleven model calls.

  • BRedrive each failed execution so that it resumes at the upload state

    Correct

    Redrive continues a failed Standard execution from the unsuccessful step, within 14 days, with the same input, definition and execution ARN. Successful steps are not rerun, and the redrive events are appended to the original history.

  • CRun the upload state alone with the TestState API and the failed input

    Incorrect

    TestState runs a state definition in isolation for testing. The original executions would stay failed, and their histories would not show the upload.

  • DAdd a Catch to the upload state that waits an hour and tries again

    Incorrect

    A Catch sends errors to a fallback state in later executions. It changes the definition and does nothing for the executions that already failed.

To finish a failed Standard execution without repeating its completed work, redrive it from the failed step.

Practise domain 2 →Practise all domains →