0
0
DynamoDBquery~20 mins

Attribute types (S, N, B, BOOL, L, M) in DynamoDB - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DynamoDB Attribute Types Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
1:30remaining
What is the output of this DynamoDB item retrieval?
Given a DynamoDB item with attribute types:

{"Name": {"S": "Alice"}, "Age": {"N": "30"}, "Active": {"BOOL": true}}

What will be the value of the "Age" attribute when retrieved?
A30 (number)
B"30" (string)
Ctrue (boolean)
Dnull (no value)
Attempts:
2 left
💡 Hint
Remember that DynamoDB stores numbers as strings in the N type.
query_result
intermediate
1:30remaining
What is the output of this DynamoDB item with nested map and list?
Consider this DynamoDB item:

{"User": {"M": {"Name": {"S": "Bob"}, "Scores": {"L": [{"N": "10"}, {"N": "20"}]}}}}

What is the value type of "Scores" inside "User"?
AMap of numbers
BList of numbers
CList of strings
DMap of strings
Attempts:
2 left
💡 Hint
Look at the L and N attribute types inside the Scores attribute.
📝 Syntax
advanced
2:00remaining
Which option correctly defines a DynamoDB item with a binary attribute?
You want to store a binary attribute named "ImageData" in DynamoDB. Which of the following JSON representations is syntactically correct?
A{"ImageData": {"B": "aGVsbG8="}}
B{"ImageData": {"N": "aGVsbG8="}}
C{"ImageData": {"S": "aGVsbG8="}}
D{"ImageData": {"BOOL": "aGVsbG8="}}
Attempts:
2 left
💡 Hint
Binary data uses the B attribute type and is base64 encoded.
🧠 Conceptual
advanced
1:00remaining
Which attribute type is best to store a true/false value in DynamoDB?
You want to store a flag indicating if a user is active or not. Which DynamoDB attribute type should you use?
AS (String)
BN (Number)
CB (Binary)
DBOOL (Boolean)
Attempts:
2 left
💡 Hint
DynamoDB has a dedicated type for true/false values.
🔧 Debug
expert
2:30remaining
Why does this DynamoDB query fail to retrieve the nested map attribute?
You have this item:

{"Profile": {"M": {"Name": {"S": "Eve"}, "Count": {"M": {"Age": {"N": "25"}}}}}}

You try to get the Age value with this expression:

ProjectionExpression: "Profile.Count.Age"

But the query returns no value for Age. What is the likely cause?
ADynamoDB does not support nested map attributes
BAge attribute is missing from the item
CProjectionExpression syntax requires using # placeholders for nested map keys
DProjectionExpression must use dot notation only for list attributes
Attempts:
2 left
💡 Hint
Check how DynamoDB handles nested attribute names in ProjectionExpression.