AIP-C01 practice question: Handling throttling, retries and fallbacks
Implementation and Integration A free question from our original AIP-C01 practice exam. Try it, then open the answer to see why each option is right or wrong.
A ride-sharing company's support assistant calls a foundation model on Amazon Bedrock from an AWS Lambda function. During the evening peak, some calls fail with a ThrottlingException, which means the account briefly exceeded its request quota for that model in the Region.
The team wants most throttled calls to succeed within a few seconds, without dropping requests and without sending a burst of retries that makes throttling worse. The team does not want to request a higher quota, and the change should be small.
Which approach meets these requirements with the LEAST code change?
Choose one answer.
AA. Configure the AWS SDK retry strategy with exponential backoff, jitter and a capped number of attempts, so retries are spread out over a few seconds.
BB. Catch the throttling error and retry immediately in a loop of up to 100 attempts with no wait, so that a quota slot is likely to free up on the next try.
CC. Catch the throttling error and return a fixed apology to the rider without retrying, which keeps the code the simplest and avoids any extra calls.
DD. Request a higher quota for the model and launch the feature after the increase is approved, so that throttling does not happen during the evening peak.
Show the answer and explanation
Answer: A
A. Right: Exponential backoff with jitter spreads retries out, so the bursts that cause more throttling are avoided. The SDK setting is a small change, and most throttled calls succeed within seconds.
B. Wrong: Immediate retries from every Lambda invocation create a retry storm that keeps the account over its quota. The loop also ties up each function for a long time.
C. Wrong: This avoids extra calls, but most throttled requests would fail for the rider, which misses the success requirement. Dropping requests is the outcome the team wants to prevent.
D. Wrong: A quota increase may help, but the team has ruled it out for this change. The feature would also wait on an approval, while the requirement is a fix that works now.
Explanation
Exponential backoff with jitter in the SDK retries throttled calls over a spread-out schedule, so most requests succeed within seconds without a retry storm. The change is a configuration setting. Immediate retries, dropping requests and a quota increase each fail a stated requirement.
Want more on Handling throttling, retries and fallbacks? The 5 full-length practice sets have 5 more Handling throttling, retries and fallbacks questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →