0
0
DynamoDBquery~20 mins

Read and write capacity units in DynamoDB - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Capacity Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
query_result
intermediate
2:00remaining
Calculating Read Capacity Units for Strongly Consistent Reads

You have a DynamoDB table with items of size 3 KB each. You want to perform 100 strongly consistent read operations per second. How many read capacity units (RCUs) do you need to provision?

A100 RCUs
B200 RCUs
C300 RCUs
D400 RCUs
Attempts:
2 left
💡 Hint

Remember that one strongly consistent read capacity unit can read up to 4 KB per second.

query_result
intermediate
2:00remaining
Write Capacity Units for Large Items

You want to write 50 items per second to a DynamoDB table. Each item is 2 KB in size. How many write capacity units (WCUs) do you need to provision?

A150 WCUs
B50 WCUs
C100 WCUs
D200 WCUs
Attempts:
2 left
💡 Hint

One write capacity unit can write up to 1 KB per second.

📝 Syntax
advanced
2:00remaining
Identify the Error in Capacity Unit Calculation Expression

Which of the following expressions correctly calculates the number of read capacity units needed for eventually consistent reads of 150 items per second, each 5 KB in size?

ARCUs = 150 * CEIL(5 / 4) / 2
BRCUs = 150 * CEIL(5 / 4) * 2
CRCUs = 150 / 2 * CEIL(5 / 4)
DRCUs = CEIL(150 * 5 / 4) / 2
Attempts:
2 left
💡 Hint

Eventually consistent reads consume half the RCUs of strongly consistent reads.

🔧 Debug
advanced
2:00remaining
Debugging Provisioned Capacity Calculation for Mixed Reads

A developer wrote this formula to calculate total RCUs for 100 strongly consistent reads and 200 eventually consistent reads per second, each item 3 KB:

total_RCU = (100 + 200) * CEIL(3 / 4) / 2

What is the problem with this formula?

DynamoDB
total_RCU = (100 + 200) * CEIL(3 / 4) / 2
AIt should add 2 to the reads before multiplying
BIt incorrectly divides the sum of reads by 2, applying eventually consistent factor to all reads
CIt should use item size 4 KB instead of 3 KB
DIt should multiply by 2 instead of dividing by 2
Attempts:
2 left
💡 Hint

Strongly consistent reads consume full RCUs, eventually consistent reads consume half.

🧠 Conceptual
expert
3:00remaining
Optimizing Capacity Units for Variable Item Sizes

You have a DynamoDB table with items of varying sizes: 50% are 1 KB, 30% are 3 KB, and 20% are 7 KB. You expect 100 writes per second. How should you provision write capacity units (WCUs) to minimize cost while avoiding throttling?

AProvision WCUs based on median item size (3 KB) for all writes: 100 * 3 = 300 WCUs
BCalculate weighted average item size and provision WCUs accordingly: (0.5*1 + 0.3*3 + 0.2*7) * 100 = 3.2 * 100 = 320 WCUs
CProvision WCUs based on the smallest item size (1 KB) for all writes: 100 * 1 = 100 WCUs
DProvision WCUs based on the largest item size (7 KB) for all writes: 100 * 7 = 700 WCUs
Attempts:
2 left
💡 Hint

DynamoDB charges WCUs per 1 KB chunk per write. Underprovisioning causes throttling.