Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to identify a read-heavy system characteristic.
HLD
if system_type == '[1]': optimize_for = 'cache and fast reads'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing write-heavy instead of read-heavy.
✗ Incorrect
Read-heavy systems focus on optimizing read operations, often using caching.
2fill in blank
mediumComplete the code to identify a write-heavy system characteristic.
HLD
if system_type == '[1]': optimize_for = 'fast writes and data durability'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing read-heavy with write-heavy.
✗ Incorrect
Write-heavy systems focus on fast and reliable write operations.
3fill in blank
hardFix the error in the system optimization check.
HLD
if workload == '[1]': use_cache = True else: use_cache = False
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting write-heavy which disables caching incorrectly.
✗ Incorrect
Caching is mainly beneficial for read-heavy workloads.
4fill in blank
hardFill both blanks to optimize system design for read-heavy and write-heavy workloads.
HLD
if workload == '[1]': database = 'replicated read replicas' elif workload == '[2]': database = 'sharded write nodes'
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up read-heavy and write-heavy in blanks.
✗ Incorrect
Read-heavy systems use read replicas; write-heavy systems use sharding for writes.
5fill in blank
hardFill all three blanks to complete the system design for read-heavy and write-heavy workloads with caching strategy.
HLD
system = {
'type': '[1]',
'database': '[2]',
'cache_enabled': [3]
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Enabling cache for write-heavy systems incorrectly.
✗ Incorrect
Read-heavy systems use replicated read replicas and enable caching.