Hint: FilterExpression filters after Scan, not KeyConditionExpression [OK]
Common Mistakes:
Using KeyConditionExpression with Scan
Using wrong parameter names like Filter or ConditionExpression
Not providing ExpressionAttributeValues for placeholders
3. Given a DynamoDB table 'Products' with 3 items: {"ID":1, "Category":"Book"}, {"ID":2, "Category":"Toy"}, {"ID":3, "Category":"Book"}, what will be the result of this Scan operation?
Code lacks ExpressionAttributeValues, so filter cannot apply and returns all items.
Final Answer:
Missing ExpressionAttributeValues for ':s'. -> Option A
Quick Check:
Filter needs ExpressionAttributeValues [OK]
Hint: Always provide ExpressionAttributeValues for FilterExpression [OK]
Common Mistakes:
Confusing FilterExpression with KeyConditionExpression
Forgetting ExpressionAttributeValues
Assuming Scan ignores missing values silently
5. You have a large DynamoDB table with millions of items but no suitable key for your query. You need to find all items where Status = 'Active'. Which approach is best?
hard
A. Use Scan with FilterExpression 'Status = :status' and paginate results.
B. Create a Global Secondary Index on 'Status' and use Query.
C. Use Query with KeyConditionExpression on 'Status'.
D. Use Scan without any filter to get all items.
Solution
Step 1: Understand limitations of Scan on large tables
Scan reads all items and is slow and costly on large tables, even with filters.
Step 2: Use Global Secondary Index (GSI) for efficient queries
Creating a GSI on 'Status' allows Query operation, which is fast and efficient for filtering by 'Status'.
Final Answer:
Create a Global Secondary Index on 'Status' and use Query. -> Option B
Quick Check:
GSI + Query = efficient large table filter [OK]
Hint: Use GSI for filtering large tables, not Scan [OK]
Common Mistakes:
Using Scan on large tables causing slow performance
Trying Query without suitable key or index
Ignoring cost and speed implications
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.