0
0
DynamoDBquery~20 mins

TTL behavior and timing in DynamoDB - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
TTL Timing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
When does DynamoDB delete expired items?

In DynamoDB, after an item's TTL timestamp passes, when will DynamoDB delete that item?

AAt the end of each day during a scheduled cleanup window.
BImmediately at the exact second the TTL timestamp is reached.
COnly when a read or write operation accesses the expired item.
DWithin 48 hours after the TTL timestamp has passed, but timing is not guaranteed.
Attempts:
2 left
💡 Hint

Think about how background processes work asynchronously in cloud services.

query_result
intermediate
2:00remaining
Effect of TTL on Query Results

You have a DynamoDB table with TTL enabled on attribute expireAt. You run a Query operation immediately after an item's TTL timestamp has passed but before DynamoDB deletes it. What will the Query return?

AThe expired item will be returned because it still exists in the table.
BThe expired item will not be returned because TTL hides expired items instantly.
CThe Query will return an error due to expired items.
DThe Query will return only the expired item and no others.
Attempts:
2 left
💡 Hint

Consider when DynamoDB physically removes expired items versus when they expire logically.

📝 Syntax
advanced
2:00remaining
Correct TTL Attribute Format

Which of the following DynamoDB item attributes is correctly formatted for TTL to work?

DynamoDB
Item example: { "id": "123", "expireAt": ??? }
A"expireAt": "June 1, 2024 12:00:00"
B"expireAt": "2024-06-01T12:00:00Z"
C"expireAt": 1711896000
D"expireAt": true
Attempts:
2 left
💡 Hint

TTL expects a specific type of timestamp value.

optimization
advanced
2:00remaining
Reducing Delay in TTL Deletion

You want expired items to be deleted as soon as possible after TTL expiration. Which approach can help reduce the delay?

AIncrease the TTL timestamp by a few hours to batch deletions.
BEnable DynamoDB Streams and process expired items manually to delete them faster.
CDisable TTL and delete expired items with a scheduled Lambda function only.
DSet the TTL attribute to a string date format for faster processing.
Attempts:
2 left
💡 Hint

Think about how you can react to changes in the table immediately.

🔧 Debug
expert
2:00remaining
Why are expired items not deleted after 48 hours?

You enabled TTL on your DynamoDB table with attribute expireAt. Some items have expired more than 48 hours ago but still appear in the table. What is the most likely reason?

AThe TTL attribute is missing or has incorrect data type on those items.
BDynamoDB deletes expired items only during monthly maintenance windows.
CThe table's read capacity is too low to allow TTL deletions.
DExpired items are never deleted automatically; TTL only marks them.
Attempts:
2 left
💡 Hint

Check the attribute format and presence carefully.