0
0
DynamoDBquery~20 mins

Event-driven architecture patterns in DynamoDB - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Event-Driven DynamoDB Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2:00remaining
Querying DynamoDB Stream Events for Specific Event Types
You have a DynamoDB table with streams enabled. The stream records include events of types INSERT, MODIFY, and REMOVE. Which query expression will correctly filter and return only the INSERT events from the stream records?
DynamoDB
SELECT * FROM StreamRecords WHERE eventName = 'INSERT';
ASELECT * FROM StreamRecords WHERE eventName = 'ADD';
BSELECT * FROM StreamRecords WHERE eventType = 'INSERT';
CSELECT * FROM StreamRecords WHERE eventName = 'INSERT';
DSELECT * FROM StreamRecords WHERE eventName = 'CREATE';
Attempts:
2 left
💡 Hint
Check the exact attribute name used for event type in DynamoDB streams.
🧠 Conceptual
intermediate
2:00remaining
Understanding Event Sourcing with DynamoDB
In an event-driven architecture using DynamoDB, what is the main advantage of using event sourcing to store changes as events rather than storing only the current state?
AIt allows reconstructing the entire state history by replaying events.
BIt reduces the storage size by storing only the latest state.
CIt eliminates the need for DynamoDB streams.
DIt automatically indexes all events for faster queries.
Attempts:
2 left
💡 Hint
Think about how event sourcing helps with state recovery and auditing.
📝 Syntax
advanced
2:00remaining
Correct Syntax for DynamoDB Stream Event Processing in Lambda
Which of the following AWS Lambda event handler code snippets correctly accesses the new image of a DynamoDB stream record for an INSERT event?
DynamoDB
exports.handler = async (event) => {
  for (const record of event.Records) {
    if (record.eventName === 'INSERT') {
      const newImage = record.dynamodb.NewImage;
      // process newImage
    }
  }
};
Aconst newImage = record.dynamodb.NewImage;
Bconst newImage = record.dynamodb.newImage;
Cconst newImage = record.DynamoDB.NewImage;
Dconst newImage = record.dynamodb.OldImage;
Attempts:
2 left
💡 Hint
Check the exact casing and property names in the DynamoDB stream record object.
optimization
advanced
2:00remaining
Optimizing Event Processing with DynamoDB Streams and Lambda
You want to optimize your Lambda function triggered by DynamoDB streams to process events efficiently. Which approach will best reduce cold start latency and improve throughput?
ASet the batch size to 1 to process events one by one for simplicity.
BUse batch processing by setting the batch size to a higher number in the event source mapping.
CDisable parallelization to ensure events are processed sequentially.
DIncrease the Lambda timeout to the maximum allowed to avoid timeouts.
Attempts:
2 left
💡 Hint
Think about how batch size affects invocation frequency and processing speed.
🔧 Debug
expert
2:00remaining
Debugging Missing Events in DynamoDB Stream Processing
Your Lambda function processing DynamoDB stream events sometimes misses INSERT events. Which of the following is the most likely cause?
AThe Lambda function code incorrectly accesses 'OldImage' instead of 'NewImage'.
BThe DynamoDB table does not have streams enabled.
CThe Lambda event source mapping has a filter that excludes INSERT events.
DThe DynamoDB stream is set to KEYS_ONLY, so new images are not available.
Attempts:
2 left
💡 Hint
Consider the stream view type configuration and what data it provides.