Curated

Development with AWS Services 2 (1.2–1.3)

0 votes

Questions40

  1. Question 1

    Development with AWS Services

    Which S3 Lifecycle action removes incomplete multipart uploads after a configured number of days?

    Show the answer

    Correct answerA. AbortIncompleteMultipartUpload

    AWhy this is right: This action aborts incomplete uploads and removes their uploaded parts after the configured interval.

    BWhy not this: Expiration manages completed objects rather than the parts of an incomplete multipart upload.

    CWhy not this: Transition changes an object's storage class rather than removing incomplete uploads.

    DWhy not this: NoncurrentVersionExpiration deletes older object versions, not unfinished uploads.

    AbortIncompleteMultipartUpload removes incomplete multipart uploads and their uploaded parts after the configured interval. Expiration applies to objects, not unfinished multipart uploads.

    Open this question
  2. Question 2

    Development with AWS Services

    An RDS DB instance has a seven-day automated backup retention period. A developer must preserve its current state for one year independently of that rolling window. What should the developer do?

    Show the answer

    Correct answerB. Create a manual DB snapshot and retain it

    AWhy not this: Multi-AZ deployment improves availability but does not preserve a fixed historical database state.

    BWhy this is right: A manual snapshot preserves a point-in-time state independently of the automated backup retention window.

    CWhy not this: RDS automated backup retention cannot be configured for 365 days; its maximum is 35 days.

    DWhy not this: An actively replicating read replica changes with the source rather than preserving its current state.

    A manual DB snapshot persists until explicitly deleted and is independent of automated backup retention. RDS automated backup retention supports up to 35 days, not one year.

    Open this question
  3. Question 3

    Development with AWS Services

    A versioned S3 bucket expires current object versions after 30 days, but storage charges keep growing because older versions remain. Which change will automatically remove those older versions after they have been noncurrent for 60 days?

    Show the answer

    Correct answerB. Configure noncurrent-version expiration for 60 days

    AWhy not this: Transitioning versions changes their storage class but does not remove them.

    BWhy this is right: Noncurrent-version expiration deletes older versions based on how long they have been noncurrent.

    CWhy not this: Current-version expiration does not configure deletion of versions that are already noncurrent.

    DWhy not this: Removing expired delete markers does not delete the older data versions that are consuming storage.

    Noncurrent-version expiration permanently deletes versions after the configured time since they became noncurrent. Current-version expiration in a versioned bucket normally adds a delete marker rather than deleting the underlying versions.

    Open this question
  4. Question 4

    Development with AWS Services

    An S3 archive must prevent deletion of each new object version for seven years, even by the account root user, while litigation can require protection beyond that period. An expiration rule already handles eventual cleanup; which Object Lock configuration meets both requirements?

    Show the answer

    Correct answerC. Seven-year compliance retention, plus legal holds for litigation

    AWhy not this: Governance retention can be bypassed with appropriate permissions, so it does not satisfy the root-user restriction.

    BWhy not this: Replication creates copies but does not independently protect the source version after its retention expires.

    CWhy this is right: Compliance retention enforces the minimum period, and legal holds preserve litigation versions beyond it.

    DWhy not this: Governance mode permits authorized bypass, and versioning alone does not prevent permanent version deletion.

    Compliance mode prevents deletion or shortening of retention even by the root user. A legal hold independently protects a version until removed, including after retention expires; governance mode permits authorized bypass.

    Open this question
  5. Question 5

    Development with AWS Services

    A developer enables DynamoDB TTL on the expiresAt attribute, but expired items remain for weeks. The attribute contains ISO 8601 date strings. What should the developer change?

    Show the answer

    Correct answerA. Store expiresAt as a Number containing Unix epoch seconds

    AWhy this is right: A numeric Unix epoch timestamp in seconds is the required TTL attribute representation.

    BWhy not this: Read consistency does not change whether an attribute is valid for TTL processing.

    CWhy not this: TTL does not require an index, and indexing does not fix an unsupported timestamp representation.

    DWhy not this: TTL interprets the number as seconds, so a millisecond timestamp would indicate an expiration far in the future.

    DynamoDB TTL requires the configured attribute to contain a Number representing Unix epoch time in seconds. Millisecond timestamps represent dates far in the future when interpreted as seconds.

    Open this question
  6. Question 6

    Development with AWS Services

    A VPC-connected Lambda function times out connecting to an RDS PostgreSQL database in the same VPC. Routes and network ACLs permit traffic, and the function allows outbound traffic, but the database security group has no inbound rules; what should the developer change?

    Show the answer

    Correct answerD. Allow inbound TCP port 5432 from the function's security group on the database security group.

    AWhy not this: An endpoint environment variable identifies the destination but does not change network filtering.

    BWhy not this: Permission to describe a database instance does not authorize network connections to its database port.

    CWhy not this: The function initiates the connection, so an inbound rule on its security group does not open the database.

    DWhy this is right: The database must allow incoming PostgreSQL connections from the security group associated with the function.

    The database security group must permit PostgreSQL connections from the function's security group. An inbound rule on the function does not authorize connections entering the database.

    Open this question
  7. Question 7

    Development with AWS Services

    A Lambda function attached to a public subnet can reach a private database but times out when calling a public HTTPS API. The subnet routes internet traffic to an internet gateway; what change restores API access while preserving private database access?

    Show the answer

    Correct answerC. Use private subnets with an internet route through a public NAT gateway.

    AWhy not this: Lambda-managed network interfaces do not support assigning an Elastic IP address directly.

    BWhy not this: Inbound HTTPS rules do not provide a route for outbound API requests.

    CWhy this is right: A public NAT gateway supplies outbound internet connectivity while the function retains private VPC connectivity.

    DWhy not this: A longer timeout cannot establish an outbound internet path that the network configuration lacks.

    VPC-connected Lambda functions do not receive public IP addresses, so an internet gateway route alone does not provide internet access. Private subnets routing through a public NAT gateway provide outbound access; increasing the timeout does not fix missing connectivity.

    Open this question
  8. Question 8

    Development with AWS Services

    A developer configures an existing Lambda function to use VPC subnets, but Lambda reports that its execution role cannot create network interfaces. Which change addresses this failure?

    Show the answer

    Correct answerD. Attach AWSLambdaVPCAccessExecutionRole to the function's execution role.

    AWhy not this: A function resource-based policy controls invocation access rather than execution-role permissions.

    BWhy not this: Security group rules filter network traffic; they do not authorize EC2 network-interface API operations.

    CWhy not this: Invocation permission for the deployment identity does not grant network-interface permissions to the execution role.

    DWhy this is right: This managed policy grants the execution role the network-interface permissions needed for Lambda VPC connectivity.

    The AWSLambdaVPCAccessExecutionRole managed policy grants the execution role permissions Lambda needs to manage VPC network interfaces. Invocation permissions control who can call the function, not whether Lambda can establish VPC connectivity.

    Open this question
  9. Question 9

    Development with AWS Services

    A Lambda function in isolated subnets reaches a private database but cannot retrieve its password from AWS Secrets Manager using the standard Regional hostname. IAM permissions are sufficient, and internet egress is prohibited; which configuration provides private access without changing application code?

    Show the answer

    Correct answerA. Create a Secrets Manager interface endpoint with private DNS enabled and allow HTTPS from the function.

    AWhy this is right: Private DNS preserves the hostname, while the endpoint security group permits HTTPS connections from the function.

    BWhy not this: A public subnet does not give Lambda a public IP address and would not meet the private-access requirement.

    CWhy not this: Secrets Manager uses interface VPC endpoints, not gateway endpoints.

    DWhy not this: Without private DNS, the unchanged standard Regional hostname does not resolve to the interface endpoint's private addresses.

    A Secrets Manager interface VPC endpoint provides private connectivity, and private DNS makes the standard Regional hostname resolve to endpoint addresses. Disabling private DNS generally requires using an endpoint-specific hostname instead.

    Open this question
  10. Question 10

    Development with AWS Services

    A Lambda function attached to private subnets of a VPC can query an RDS database in that VPC, but its calls to Amazon SQS time out. Which change lets it reach SQS without giving the function internet access?

    Show the answer

    Correct answerC. Create an interface VPC endpoint for Amazon SQS in the VPC.

    AWhy not this: A missing permission returns an access-denied error, not a network timeout.

    BWhy not this: Gateway VPC endpoints are available only for Amazon S3 and DynamoDB.

    CWhy this is right: An interface endpoint gives the VPC a private path to the SQS API without internet access.

    DWhy not this: Lambda's network interfaces do not receive public IP addresses, so a public subnet does not provide internet access.

    A VPC-attached function has no internet access, so it reaches public AWS APIs through a NAT gateway or a VPC endpoint; an interface endpoint (AWS PrivateLink) for SQS keeps traffic inside the VPC. Gateway endpoints exist only for S3 and DynamoDB, and Lambda network interfaces get no public IP even in a public subnet.

    Open this question
  11. Question 11

    Development with AWS Services

    Which Lambda configuration setting identifies the function entry point that the runtime invokes?

    Show the answer

    Correct answerA. Handler

    AWhy this is right: The handler identifies the application entry point that Lambda invokes.

    BWhy not this: The execution role supplies permissions for accessing AWS resources.

    CWhy not this: The timeout limits how long an invocation can run.

    DWhy not this: The runtime selects the language execution environment rather than the application's entry point.

    The handler identifies the entry point invoked by the Lambda runtime. The runtime selects the language execution environment, not the application's entry point.

    Open this question
  12. Question 12

    Development with AWS Services

    A Lambda function configured with 512 MB of memory performs CPU-bound calculations and exceeds its latency target, although peak memory use is only 180 MB. Which configuration change should the developer benchmark to reduce individual invocation duration?

    Show the answer

    Correct answerB. Increase the function's memory allocation.

    AWhy not this: A longer timeout permits longer execution but does not make calculations finish sooner.

    BWhy this is right: Increasing configured memory also increases CPU capacity and can reduce CPU-bound execution time.

    CWhy not this: Reserved concurrency controls simultaneous executions, not CPU capacity per execution.

    DWhy not this: Ephemeral storage increases temporary disk capacity, not the CPU allocation for calculations.

    Lambda allocates CPU capacity in proportion to configured memory, so increasing memory can accelerate CPU-bound work even when memory use is low. Increasing reserved concurrency permits more simultaneous invocations but does not add CPU capacity to an individual invocation.

    Open this question
  13. Question 13

    Development with AWS Services

    A Lambda function that resizes images has 512 MB of memory and a 3-second timeout. Its CPU-bound resize step must run faster, and the largest images need up to 2 minutes to finish. Which configuration changes meet these requirements? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersA. Increase the function's memory setting.C. Set the function's timeout to at least 120 seconds.

    AWhy this is right: Lambda allocates CPU in proportion to memory, so a higher memory setting gives the CPU-bound step more processing power.

    BWhy not this: Ephemeral storage adds /tmp disk space for files; it does not add CPU.

    CWhy this is right: The timeout must exceed the longest expected run, and Lambda allows up to 900 seconds.

    DWhy not this: Provisioned concurrency keeps environments initialized to avoid cold starts; it does not speed up code that is already running.

    EWhy not this: Reserved concurrency controls how many executions run in parallel, not how fast or how long one execution runs.

    Lambda allocates CPU power in proportion to the memory configured, so more memory speeds up CPU-bound code, and the timeout (up to 900 seconds) must cover the longest invocation. Ephemeral storage adds /tmp space, provisioned concurrency only removes cold-start initialization, and reserved concurrency caps or guarantees parallel executions; none of them makes a single invocation compute faster.

    Open this question
  14. Question 14

    Development with AWS Services

    A ZIP-based Lambda function references version 3 of a shared dependency layer. The team publishes version 4, but the function still uses the old dependency. What should the developer do?

    Show the answer

    Correct answerC. Replace the function's layer reference with the version 4 ARN.

    AWhy not this: Reserved concurrency changes execution capacity, not the attached layer version.

    BWhy not this: An event payload supplies invocation input and does not replace the function's configured layer.

    CWhy this is right: Updating the layer configuration to the version 4 ARN selects the newly published dependency.

    DWhy not this: Timeout controls invocation duration and does not change the attached dependency version.

    A function references a specific, immutable layer version ARN. Publishing a newer layer version does not update existing references; the function's layer configuration must explicitly reference the new version.

    Open this question
  15. Question 15

    Development with AWS Services

    A Lambda function has environment variables STAGE=prod and PREFIX=${STAGE}/images. Its code reads PREFIX directly and receives the placeholder unchanged. What should the developer do to produce prod/images?

    Show the answer

    Correct answerD. Read STAGE and construct the prefix in the function code.

    AWhy not this: Publishing a version snapshots configuration without expanding variable references.

    BWhy not this: IAM permissions do not enable substitution within Lambda environment variable values.

    CWhy not this: The handler identifies the entry point; it does not control environment variable substitution.

    DWhy this is right: The code must construct the value because Lambda does not expand environment variable references.

    Lambda treats environment variable values as literal strings and does not expand references to other variables. Publishing a version preserves the configuration; it does not perform variable substitution.

    Open this question
  16. Question 16

    Development with AWS Services

    A Lambda function processes an SQS standard queue through an event source mapping. A malformed message repeatedly fails and must eventually move to a quarantine queue while other messages continue processing; what should the developer configure?

    Show the answer

    Correct answerC. A source-queue redrive policy targeting the quarantine queue

    AWhy not this: A function dead-letter queue handles discarded asynchronous invocation events, not messages polled from SQS.

    BWhy not this: A zero visibility timeout makes the message immediately available again; it does not quarantine it.

    CWhy this is right: The source queue's redrive policy uses maxReceiveCount to move repeatedly received messages to its dead-letter queue.

    DWhy not this: Asynchronous invocation destinations do not govern failures from an SQS event source mapping.

    An SQS redrive policy moves a message to its dead-letter queue after the configured receive threshold is exceeded. Lambda's function dead-letter queue and asynchronous destinations do not handle failures from an SQS event source mapping.

    Open this question
  17. Question 17

    Development with AWS Services

    By default, how many additional attempts does Lambda make when an asynchronously invoked function returns a function error?

    Show the answer

    Correct answerA. Two additional attempts

    AWhy this is right: Lambda makes two additional attempts by default when an asynchronous invocation returns a function error.

    BWhy not this: One retry can be configured, but the default allows another retry after that.

    CWhy not this: Zero retries can be configured, but it is not the default for asynchronous function errors.

    DWhy not this: Three counts the initial attempt plus the default retries, rather than additional attempts.

    By default, Lambda retries an asynchronous invocation twice after a function error. Three is the total number of attempts, including the initial invocation, not the number of retries.

    Open this question
  18. Question 18

    Development with AWS Services

    An asynchronously invoked Lambda function is being throttled, leaving events in Lambda's internal queue. The application requires Lambda to discard queued events once they are five minutes old; which setting enforces this limit?

    Show the answer

    Correct answerB. MaximumEventAgeInSeconds set to 300

    AWhy not this: The function timeout limits the duration of an individual execution, not time spent in the asynchronous queue.

    BWhy this is right: This setting limits an asynchronous event's age in Lambda's queue to five minutes.

    CWhy not this: This setting limits retries after function errors, not the age of events waiting because of throttling.

    DWhy not this: Zero reserved concurrency prevents execution; it does not establish a five-minute queue retention limit.

    MaximumEventAgeInSeconds limits how long Lambda retains an event for asynchronous processing. MaximumRetryAttempts controls retries after function errors; it does not establish an age limit for queued events experiencing throttling.

    Open this question
  19. Question 19

    Development with AWS Services

    A Lambda function processes ordered payment messages from one SQS FIFO message group with partial batch responses enabled; its handler can atomically deduplicate payments by transaction ID. If a message fails after earlier messages succeed, which handling preserves order, avoids unnecessary retries, and prevents duplicate charges on redelivery?

    Show the answer

    Correct answerD. Stop processing; report the failed and unprocessed messages; deduplicate payments by transaction ID.

    AWhy not this: Continuing after a failure can process later messages in the group before the failed message succeeds.

    BWhy not this: FIFO ordering does not prevent a message from being processed again; payment handling must remain idempotent.

    CWhy not this: Reporting earlier successful messages causes unnecessary retries, even if deduplication prevents duplicate charges.

    DWhy this is right: Stopping preserves order, selective failure reporting avoids retrying successes, and deduplication protects against redelivery.

    For a FIFO batch, stop after the first failure and report the failed and unprocessed messages to preserve order without retrying earlier successes. Idempotent payment handling is still required because FIFO queues do not make Lambda processing exactly once.

    Open this question
  20. Question 20

    Development with AWS Services

    After asynchronous Lambda invocations exhaust their retries, a support application needs the original event, the function response, and error details in an SQS queue. What should the developer configure?

    Show the answer

    Correct answerC. An on-failure destination targeting the queue

    AWhy not this: An on-success destination receives records for successful invocations, not exhausted failures.

    BWhy not this: A function dead-letter queue preserves the original event and error attributes, but not the complete response record.

    CWhy this is right: An on-failure destination receives the invocation record after asynchronous processing exhausts its retries or event age.

    DWhy not this: An event source mapping polls SQS to invoke the function; it does not deliver failed invocation records to SQS.

    An on-failure destination receives an invocation record containing the request, response, and error context after asynchronous processing fails. A function dead-letter queue receives the original event with error attributes, not the complete invocation record.

    Open this question
  21. Question 21

    Development with AWS Services

    Which AWS data store is designed to store and retrieve large video files as objects by key?

    Show the answer

    Correct answerA. Amazon S3

    AWhy this is right: Amazon S3 stores large objects and retrieves them using object keys.

    BWhy not this: ElastiCache provides in-memory data access rather than durable storage for large video objects.

    CWhy not this: DynamoDB stores items with a 400 KB maximum, not large video files.

    DWhy not this: Amazon RDS provides relational database storage rather than purpose-built object storage.

    Amazon S3 provides object storage for files such as videos, retrieved by object key. DynamoDB also uses keys, but its item size limit makes it unsuitable for storing large video files directly.

    Open this question
  22. Question 22

    Development with AWS Services

    A developer is selecting workloads for DynamoDB on-demand capacity to handle unpredictable traffic without managing database servers. Which workloads fit DynamoDB's access model without requiring a separate query engine? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersA. Atomically update ten small inventory items identified by their primary keys.B. Retrieve small customer profiles by customer ID with no cross-customer joins.

    AWhy this is right: DynamoDB transactions can atomically update ten distinct keyed items within transaction size limits.

    BWhy this is right: Direct primary-key lookups of small items match DynamoDB's key-value access model.

    CWhy not this: File locks and byte-range writes require file-system semantics rather than an item-based database.

    DWhy not this: Arbitrary historical aggregations are not DynamoDB's native low-latency access pattern.

    EWhy not this: Changing joins across normalized tables favor a relational database rather than DynamoDB's native operations.

    FWhy not this: Individual DynamoDB items cannot exceed 400 KB; large video objects belong in object storage.

    DynamoDB suits key-based access and supports atomic transactions across a bounded set of items. Its transaction support makes the inventory workload suitable; arbitrary joins and interactive historical analytics require a different access model.

    Open this question
  23. Question 23

    Development with AWS Services

    An application stores orders, customers, and payments in normalized tables. Developers frequently introduce new SQL queries that join these tables using different combinations of columns; which data store is the best fit?

    Show the answer

    Correct answerA. Amazon RDS for PostgreSQL

    AWhy this is right: PostgreSQL supports normalized tables and SQL joins across changing combinations of columns.

    BWhy not this: ElastiCache provides in-memory data structures rather than a relational query engine.

    CWhy not this: DynamoDB favors planned key-based access and does not provide native joins across normalized tables.

    DWhy not this: Amazon S3 stores objects rather than providing a relational SQL database.

    Amazon RDS for PostgreSQL supports normalized relational data and flexible SQL joins. DynamoDB supports transactional operations, but it does not natively support joins across tables.

    Open this question
  24. Question 24

    Development with AWS Services

    Linux application instances in multiple Availability Zones must concurrently access the same directory tree using standard file APIs and POSIX permissions. Which data store should the developer choose?

    Show the answer

    Correct answerB. Amazon EFS

    AWhy not this: Amazon S3 provides object APIs rather than the required standard POSIX file-system interface.

    BWhy this is right: Amazon EFS supports shared file access across Availability Zones with POSIX permissions.

    CWhy not this: Amazon RDS exposes relational database access rather than a shared file-system interface.

    DWhy not this: DynamoDB stores keyed items and does not expose a shared directory tree.

    Amazon EFS provides a shared file system with standard file access and POSIX permissions for multiple instances. Amazon S3 provides object access rather than the required mounted file-system semantics.

    Open this question
  25. Question 25

    Development with AWS Services

    A game needs frequent score updates, top-player lists, and each player's current rank with submillisecond data access. The leaderboard can be rebuilt from a durable event store; which solution best fits these requirements?

    Show the answer

    Correct answerD. An Amazon ElastiCache for Valkey sorted set

    AWhy not this: A score index supports ordered queries, but determining an arbitrary player's rank requires additional work.

    BWhy not this: PostgreSQL can calculate rankings, but is less suited to this submillisecond, rebuildable leaderboard workload.

    CWhy not this: Updating an S3 object requires replacing its contents and does not provide native rank operations.

    DWhy this is right: Sorted sets provide native score updates, rank lookups, and ordered ranges with in-memory access.

    ElastiCache for Valkey sorted sets provide in-memory score updates, ordered retrieval, and rank operations. A DynamoDB score index can support ordered queries, but does not provide a native operation to retrieve a member's rank.

    Open this question
  26. Question 26

    Development with AWS Services

    Hundreds of application instances cache expensive RDS report results in ElastiCache, with staleness of up to five minutes permitted. Simultaneous expiration causes database overload, especially for one popular report; which design best addresses both synchronized expiration and duplicate recomputation?

    Show the answer

    Correct answerB. Randomize TTLs below five minutes and coordinate per-report regeneration with a shared lock.

    AWhy not this: Instance-local locks do not coordinate hundreds of instances, and identical TTLs retain synchronized expiration.

    BWhy this is right: TTL jitter spreads expirations, and shared per-report coordination prevents duplicate regeneration across instances.

    CWhy not this: Jitter spreads different reports' expirations but does not coordinate concurrent misses for the same report.

    DWhy not this: Identical TTLs synchronize expiration, and independent regeneration multiplies database work.

    TTL jitter spreads expirations, while a shared per-report lock limits concurrent regeneration across instances. Jitter alone cannot prevent many requests from recomputing the same popular report after its entry expires.

    Open this question
  27. Question 27

    Development with AWS Services

    An application repeatedly runs expensive aggregation queries against Amazon RDS for PostgreSQL. Results can be several minutes old. Which solution best reduces repeated database computation?

    Show the answer

    Correct answerD. Cache query results in Amazon ElastiCache.

    AWhy not this: DynamoDB Accelerator caches DynamoDB operations, not PostgreSQL query results.

    BWhy not this: RDS Proxy pools database connections; it does not cache SQL query results.

    CWhy not this: A read replica shifts query execution away from the primary but still recomputes the results.

    DWhy this is right: Cached aggregation results avoid repeating expensive database computation while allowing controlled staleness.

    Amazon ElastiCache can serve previously computed results without rerunning the aggregations. A read replica offloads queries from the primary but still performs the aggregation work.

    Open this question
  28. Question 28

    Development with AWS Services

    Which service caches public images stored in Amazon S3 at edge locations near users?

    Show the answer

    Correct answerC. Amazon CloudFront

    AWhy not this: API Gateway can cache API responses but is not the edge content delivery service for S3 images.

    BWhy not this: ElastiCache supports application caching but does not distribute S3 images through edge locations.

    CWhy this is right: CloudFront can use an S3 origin and cache images near users.

    DWhy not this: DynamoDB Accelerator caches DynamoDB reads rather than S3 objects.

    Amazon CloudFront caches S3 content at edge locations to reduce delivery latency. ElastiCache provides an application-accessed in-memory cache, not an edge delivery network.

    Open this question
  29. Question 29

    Development with AWS Services

    An RDS-backed application uses ElastiCache for product details, but most products are never requested. Which caching strategy avoids populating the cache with unread products?

    Show the answer

    Correct answerA. Populate the cache when a requested product is missing.

    AWhy this is right: Lazy loading fetches and caches a product only when a request encounters a cache miss.

    BWhy not this: Scheduled refresh maintains existing entries but does not define demand-driven initial population.

    CWhy not this: Preloading every product consumes cache capacity for unread products.

    DWhy not this: Write-through caching can populate products that no client requests.

    Lazy loading populates the cache on a read miss, so unread products need not occupy cache space. Write-through caching populates entries on writes even when those products are never read.

    Open this question
  30. Question 30

    Development with AWS Services

    An application caches DynamoDB Query results in DAX with a five-minute query cache TTL. After updating a matching item through DAX, the application repeats the same eventually consistent Query and sees the old value; which change best ensures fresh results for this query?

    Show the answer

    Correct answerB. Issue a strongly consistent Query to the table.

    AWhy not this: Direct DynamoDB writes do not invalidate DAX query cache entries and can also leave item cache entries stale.

    BWhy this is right: A strongly consistent table Query reads current committed data rather than serving the cached result set.

    CWhy not this: The item cache TTL does not control cached Query result sets.

    DWhy not this: Another DAX node does not provide a freshness guarantee for an eventually consistent cached Query.

    A strongly consistent Query against the table avoids the stale DAX query cache. Writes through DAX update its item cache but do not invalidate cached Query result sets.

    Open this question
  31. Question 31

    Development with AWS Services

    A DynamoDB Streams mapping processes one batch per shard, but iterator age is rising and Lambda concurrency is available. Which change increases simultaneous processing within each shard while preserving order for each item?

    Show the answer

    Correct answerB. Increase the mapping's parallelization factor.

    AWhy not this: A larger batching window allows more collection time but does not enable concurrent batches within a shard.

    BWhy this is right: ParallelizationFactor enables concurrent batches per shard while maintaining ordering for each DynamoDB item.

    CWhy not this: Concurrency is already available; changing this limit alone does not increase the mapping's per-shard parallelism.

    DWhy not this: Asynchronous invocation retry settings do not control DynamoDB Streams event source mapping throughput.

    Increasing ParallelizationFactor lets Lambda process concurrent batches from each DynamoDB stream shard while preserving order at the item level. Raising reserved concurrency alone does not change the mapping's one-batch-per-shard processing configuration.

    Open this question
  32. Question 32

    Development with AWS Services

    An API Gateway REST API integration targets the correct Lambda function, but API Gateway reports insufficient permission to invoke it. Which change should the developer make?

    Show the answer

    Correct answerC. Allow API Gateway invocation in the function's resource-based policy.

    AWhy not this: The execution role controls the function's outbound AWS API access, not API Gateway's permission to invoke it.

    BWhy not this: API Gateway invokes the Lambda service API; it does not connect to the function through its VPC security group.

    CWhy this is right: A resource-based policy can grant the API Gateway service principal permission to invoke the function.

    DWhy not this: API callers do not need to assume the Lambda execution role for an API Gateway integration.

    A Lambda resource-based policy can authorize API Gateway to invoke the function, restricted by the API's source ARN. The execution role governs what the function can access, not which services can invoke it.

    Open this question
  33. Question 33

    Development with AWS Services

    A Lambda handler creates a new AWS SDK client for DynamoDB on every invocation. How should the developer reduce repeated client initialization across warm invocations?

    Show the answer

    Correct answerA. Initialize the client outside the handler.

    AWhy this is right: Initialization outside the handler allows the SDK client to be reused when Lambda reuses the execution environment.

    BWhy not this: Batch size changes records per invocation, not client reuse across warm invocations.

    CWhy not this: A longer timeout allows more execution time but does not eliminate repeated client construction.

    DWhy not this: A layer changes dependency packaging, not how often the handler constructs an SDK client.

    Initializing the SDK client outside the handler allows warm invocations in the same execution environment to reuse it. A layer can package the SDK, but it does not prevent code inside the handler from constructing a new client each time.

    Open this question
  34. Question 34

    Development with AWS Services

    A Lambda function processes SQS messages in batches of 10 through an event source mapping. When one message fails, the whole batch returns to the queue and messages that already succeeded are processed again. Which changes make Lambda retry only the failed messages? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersA. Enable ReportBatchItemFailures in the event source mapping's function response types.C. Return the failed messages' IDs in batchItemFailures from the handler.

    AWhy this is right: ReportBatchItemFailures tells Lambda to read a partial batch response from the function.

    BWhy not this: SQS event source mappings do not support on-failure destinations; failed messages go to the queue's dead-letter queue.

    CWhy this is right: Listing the failed message IDs in batchItemFailures lets Lambda delete the rest and retry only those.

    DWhy not this: A longer visibility timeout prevents premature redelivery but still retries the whole batch.

    EWhy not this: The batch window controls how long Lambda gathers records, not which records are retried.

    With ReportBatchItemFailures enabled, the handler returns a batchItemFailures list of the failed message IDs, and Lambda deletes the successful messages while only the listed ones become visible again for retry. SQS event source mappings use the queue's dead-letter queue rather than on-failure destinations, and visibility timeout and batch window settings do not create partial batch responses.

    Open this question
  35. Question 35

    Development with AWS Services

    Which S3 configuration invokes a Lambda function when a new object is uploaded?

    Show the answer

    Correct answerC. An ObjectCreated event notification

    AWhy not this: CORS controls browser cross-origin access to S3 resources, not object event delivery.

    BWhy not this: Replication rules copy objects to destination buckets rather than configure Lambda invocation.

    CWhy this is right: An ObjectCreated event notification can invoke a configured Lambda destination when an object is uploaded.

    DWhy not this: Lifecycle expiration rules delete eligible objects rather than invoke a function when an upload occurs.

    An S3 ObjectCreated event notification can target a Lambda function when an object is created. Replication copies objects to another bucket; it does not configure a Lambda invocation.

    Open this question
  36. Question 36

    Development with AWS Services

    A developer is designing a DynamoDB table keyed by accountId and transactionId. The application also needs efficient, strongly consistent queries within an account ordered by postedAt; which design meets these requirements?

    Show the answer

    Correct answerC. Create a local secondary index with postedAt as its sort key

    AWhy not this: Scanning and sorting is not an efficient keyed query and requires application-side ordering.

    BWhy not this: A global secondary index supports the access pattern but cannot provide strongly consistent reads.

    CWhy this is right: A local secondary index supports an alternative sort key within an account and strongly consistent queries.

    DWhy not this: Filtering does not change the base table's transactionId ordering to postedAt ordering.

    A local secondary index preserves the table's partition key, supplies an alternative sort key, and supports strongly consistent reads. A global secondary index provides an alternative key structure but supports only eventually consistent reads.

    Open this question
  37. Question 37

    Development with AWS Services

    Which attribute data types can be used for a DynamoDB table's partition key? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersC. StringD. Number

    AWhy not this: Boolean is a scalar type, but DynamoDB does not support it for key attributes.

    BWhy not this: String set is a set type, not a supported scalar key type.

    CWhy this is right: String is a supported scalar type for partition and sort key attributes.

    DWhy this is right: Number is a supported scalar type for partition and sort key attributes.

    EWhy not this: List is a document type and cannot be used for a key attribute.

    FWhy not this: Map is a document type and cannot be used for a key attribute.

    DynamoDB key attributes must have a String, Number, or Binary scalar type. Boolean is also a scalar type, but it is not supported for key attributes.

    Open this question
  38. Question 38

    Development with AWS Services

    A DynamoDB table uses customerId as its partition key and orderTime as its sort key. How should a developer retrieve one customer's orders within a time range with the least read capacity consumption?

    Show the answer

    Correct answerA. Query with customerId and orderTime in a key condition

    AWhy this is right: The key condition restricts reads to the customer and the required sort key range.

    BWhy not this: Scan reads across the table before applying the filter, consuming capacity for unrelated orders.

    CWhy not this: The filter discards out-of-range orders only after they have consumed read capacity.

    DWhy not this: Scan still reads across the table; a projection does not restrict which items are read.

    A Query can use partition key equality and a sort key range to read only matching orders. Filtering orderTime after reading the customer's items consumes capacity for items that the filter discards.

    Open this question
  39. Question 39

    Development with AWS Services

    A filtered DynamoDB Query returns no items but includes a LastEvaluatedKey. What should the application do to retrieve any remaining matches?

    Show the answer

    Correct answerD. Continue using LastEvaluatedKey as ExclusiveStartKey

    AWhy not this: Removing the filter changes the requested results rather than continuing the filtered query.

    BWhy not this: Strong consistency controls data freshness, not continuation through query results.

    CWhy not this: A page can be empty after filtering even when more items remain to be evaluated.

    DWhy this is right: ExclusiveStartKey resumes evaluation after the last item evaluated in the previous page.

    Query applies its filter after evaluating a page, so a page can contain no returned matches and still require pagination. An empty items list alone does not establish that the query is complete.

    Open this question
  40. Question 40

    Development with AWS Services

    Which partition key best distributes DynamoDB writes for millions of devices that each send approximately the same number of readings?

    Show the answer

    Correct answerA. The device's unique identifier

    AWhy this is right: Millions of distinct device identifiers spread the approximately equal per-device write activity.

    BWhy not this: Model names group many devices under a limited set of partition key values.

    CWhy not this: Regions group many active devices under relatively few partition key values.

    DWhy not this: Readings arriving on the same date concentrate writes under one partition key value.

    Unique device identifiers provide many distinct partition key values with approximately even write activity. A calendar date concentrates current readings under the same key, creating a hot-key risk.

    Open this question