0
0
AWScloud~20 mins

Put, get, and query operations in AWS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DynamoDB Put/Get/Query Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
DynamoDB PutItem operation behavior

You use the AWS DynamoDB PutItem operation to add an item with a primary key that already exists in the table. What happens to the existing item?

AThe new item is merged with the existing item, updating only specified attributes.
BThe PutItem operation fails with a ConditionalCheckFailedException.
CThe existing item is replaced with the new item completely.
DThe PutItem operation appends the new item as a duplicate entry.
Attempts:
2 left
💡 Hint

Think about how PutItem treats items with the same primary key.

service_behavior
intermediate
2:00remaining
DynamoDB GetItem consistency options

When you perform a GetItem operation in DynamoDB, which option ensures you get the most up-to-date data?

ASet the ConsistentRead parameter to true for a strongly consistent read.
BUse the default eventually consistent read option.
CUse a Query operation instead of GetItem.
DEnable DynamoDB Streams to get the latest data.
Attempts:
2 left
💡 Hint

Consider how DynamoDB handles read consistency.

Configuration
advanced
2:30remaining
DynamoDB Query operation with filter expression

You want to retrieve all items from a DynamoDB table where the partition key is 'User123' and the attribute 'Status' equals 'Active'. Which Query operation parameters correctly achieve this?

AWS
TableName: 'Users'
KeyConditionExpression: 'UserId = :uid'
FilterExpression: 'Status = :status'
ExpressionAttributeValues: { ':uid': {S: 'User123'}, ':status': {S: 'Active'} }
AUse only FilterExpression for both UserId and Status.
BUse KeyConditionExpression for both UserId and Status attributes.
CUse FilterExpression for UserId and KeyConditionExpression for Status.
DUse KeyConditionExpression for UserId and FilterExpression for Status.
Attempts:
2 left
💡 Hint

Remember that KeyConditionExpression must include the partition key.

Architecture
advanced
2:30remaining
Efficient retrieval of multiple items by keys

You need to retrieve multiple items from a DynamoDB table by their primary keys in a single request. Which operation is the most efficient and appropriate?

AUse multiple GetItem requests in parallel.
BUse BatchGetItem operation with all keys specified.
CUse Query operation with multiple KeyConditionExpressions.
DUse Scan operation with a filter on primary keys.
Attempts:
2 left
💡 Hint

Consider which operation supports multiple keys in one call.

security
expert
3:00remaining
Securing DynamoDB PutItem operations with IAM policies

You want to restrict an IAM user so they can only perform PutItem operations on a DynamoDB table but only for items where the attribute 'Department' equals 'Sales'. Which IAM policy condition correctly enforces this?

A"Condition": {"StringEquals": {"dynamodb:Attributes/Department": "Sales"}}
B"Condition": {"ForAllValues:StringEquals": {"dynamodb:Attributes/Department": "Sales"}}
C"Condition": {"StringEqualsIfExists": {"dynamodb:LeadingKeys": ["Sales"]}}
D"Condition": {"StringEquals": {"dynamodb:LeadingKeys": ["Sales"]}}
Attempts:
2 left
💡 Hint

Think about how to restrict based on an attribute value in IAM conditions.