0
0
AWScloud~20 mins

Scan vs query performance in AWS - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DynamoDB Scan vs Query Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Scan vs Query in DynamoDB

Which statement best describes the performance difference between a Scan and a Query operation in DynamoDB?

ABoth Scan and Query read all items but Query is slower due to filtering.
BScan reads items based on primary key and is faster; Query reads all items and is slower.
CScan reads all items in a table and is slower; Query reads items based on primary key and is faster.
DScan and Query have identical performance because they both use indexes.
Attempts:
2 left
💡 Hint

Think about how many items each operation reads from the table.

service_behavior
intermediate
2:00remaining
Result Count Differences Between Scan and Query

You perform a Scan and a Query on a DynamoDB table with 1000 items. The Query uses a partition key that matches 50 items. How many items will each operation read?

AScan reads 1000 items; Query reads 50 items.
BScan reads 50 items; Query reads 1000 items.
CBoth Scan and Query read 1000 items.
DBoth Scan and Query read 50 items.
Attempts:
2 left
💡 Hint

Consider what each operation scans or queries in the table.

Architecture
advanced
2:30remaining
Optimizing DynamoDB Access Patterns

You want to design a DynamoDB table to minimize the use of Scan operations for better performance. Which design choice helps achieve this?

AUse a well-defined partition key and sort key to enable efficient Query operations.
BAvoid using any keys and rely on Scan for all data retrieval.
CUse only Scan operations with filters to reduce data read.
DStore all data in a single partition to simplify access.
Attempts:
2 left
💡 Hint

Think about how keys help DynamoDB find data quickly.

security
advanced
2:30remaining
Security Implications of Scan vs Query

Which security risk is higher when using Scan operations compared to Query operations in DynamoDB?

AScan operations are encrypted by default, Query operations are not.
BScan may expose more data than intended because it reads the entire table.
CQuery exposes more data because it uses keys.
DThere is no difference in security risks between Scan and Query.
Attempts:
2 left
💡 Hint

Consider how much data each operation accesses.

Best Practice
expert
3:00remaining
Choosing Between Scan and Query for Large Tables

You manage a DynamoDB table with millions of items. You need to retrieve items matching a specific attribute that is not part of the primary key. Which approach is best to maintain performance?

AUse Scan with a filter expression on the attribute to find matching items.
BExport the table data and search externally to avoid Scan or Query.
CAdd the attribute to the primary key and use Query on the main table.
DCreate a Global Secondary Index (GSI) on that attribute and use Query on the GSI.
Attempts:
2 left
💡 Hint

Think about how to query non-key attributes efficiently.