0
0
AWScloud~10 mins

Scan vs query performance in AWS - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to perform a fast data retrieval using a DynamoDB operation.

AWS
response = table.[1](KeyConditionExpression=key_expression)
Drag options to blanks, or click blank then click option'
Ascan
Bquery
Cget_item
Dput_item
Attempts:
3 left
💡 Hint
Common Mistakes
Using scan instead of query causes slower performance.
2fill in blank
medium

Complete the code to retrieve all items from a DynamoDB table, which is slower but scans everything.

AWS
response = table.[1]()
Drag options to blanks, or click blank then click option'
Ascan
Bget_item
Cquery
Dupdate_item
Attempts:
3 left
💡 Hint
Common Mistakes
Using query when you want all items will not work without key conditions.
3fill in blank
hard

Fix the error in the code to improve performance by using the correct DynamoDB operation.

AWS
items = table.[1](KeyConditionExpression=key_expression)
Drag options to blanks, or click blank then click option'
Adelete_item
Bscan
Cquery
Dput_item
Attempts:
3 left
💡 Hint
Common Mistakes
Using scan with FilterExpression is slower than query with KeyConditionExpression.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that filters items with a condition and calculates a value.

AWS
result = {item['id']: item['value'] [1] 2 for item in items if item['value'] [2] 10}
Drag options to blanks, or click blank then click option'
A**
B>
C<
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using '+' instead of '**' changes the calculation.
5fill in blank
hard

Fill all three blanks to build a dictionary comprehension that transforms keys, selects values, and filters items.

AWS
filtered = [1]: [2] for [3], v in data.items() if v > 0}
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
Ck
Dv.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using v.lower() for keys or wrong variable names causes errors.