0
0
DynamoDBquery~20 mins

DynamoDB Streams concept - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DynamoDB Streams Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What does DynamoDB Streams capture?
DynamoDB Streams records changes in a DynamoDB table. What kind of changes does it capture?
AAll item-level modifications including inserts, updates, and deletes
BOnly deleted items from the table
COnly new items added to the table
DOnly changes to table indexes
Attempts:
2 left
💡 Hint
Think about what you want to track if you want a full history of changes.
query_result
intermediate
1:30remaining
What is the output of this DynamoDB Stream record?
Given a DynamoDB Stream record for an update event, what does the 'NewImage' attribute contain?
DynamoDB
StreamRecord: {
  "eventName": "MODIFY",
  "dynamodb": {
    "NewImage": {"Id": {"S": "101"}, "Status": {"S": "Shipped"}},
    "OldImage": {"Id": {"S": "101"}, "Status": {"S": "Pending"}}
  }
}
AThe item data after the update
BThe item data before the update
COnly the changed attributes
DThe entire table data
Attempts:
2 left
💡 Hint
NewImage means the new state of the item after the change.
📝 Syntax
advanced
2:00remaining
Which option correctly enables DynamoDB Streams on a table with NEW_AND_OLD_IMAGES?
You want to enable DynamoDB Streams on a table to capture both new and old images of items. Which AWS CLI command is correct?
DynamoDB
aws dynamodb update-table --table-name Orders --stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES
Aaws dynamodb update-table --table-name Orders --stream-specification StreamEnabled=true;StreamViewType=NEW_AND_OLD_IMAGES
Baws dynamodb update-table --table-name Orders --stream-specification StreamEnabled=true StreamViewType=NEW_AND_OLD_IMAGES
Caws dynamodb update-table --table-name Orders --stream-specification StreamEnabled: true, StreamViewType: NEW_AND_OLD_IMAGES
Daws dynamodb update-table --table-name Orders --stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES
Attempts:
2 left
💡 Hint
Check the correct syntax for comma-separated key-value pairs in AWS CLI.
optimization
advanced
1:30remaining
How to minimize costs when using DynamoDB Streams?
You want to reduce costs while using DynamoDB Streams for a high-traffic table. Which approach helps minimize costs?
ADisable Streams and poll the table directly for changes
BEnable Streams with NEW_AND_OLD_IMAGES to capture full item data
CEnable Streams with KEYS_ONLY view type to reduce data volume
DUse Streams with NEW_IMAGE and process all attributes
Attempts:
2 left
💡 Hint
Less data in streams means less processing and storage cost.
🔧 Debug
expert
2:30remaining
Why does this Lambda function triggered by DynamoDB Streams fail with a TypeError?
A Lambda function processes DynamoDB Stream events. It tries to access event.Records[0].dynamodb.NewImage.Name.S but fails with TypeError: Cannot read property 'S' of undefined. What is the likely cause?
DynamoDB
exports.handler = async (event) => {
  const name = event.Records[0].dynamodb.NewImage.Name.S;
  console.log(name);
};
AThe event.Records array is empty
BThe 'Name' attribute does not exist in NewImage for this event
CThe Lambda function lacks permissions to read the stream
DThe stream is disabled on the DynamoDB table
Attempts:
2 left
💡 Hint
Check if the attribute you access is always present in the stream record.