0
0
HLDsystem_design~10 mins

Why database choice impacts architecture in HLD - Test Your Understanding

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

Complete the code to select the type of database based on data structure.

HLD
if data_is_structured:
    database_type = '[1]'
else:
    database_type = 'NoSQL'
Drag options to blanks, or click blank then click option'
AKey-Value
BGraph
CRelational
DDocument
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing NoSQL for structured data
Confusing document and relational databases
2fill in blank
medium

Complete the code to choose a database type that supports flexible schema.

HLD
if need_flexible_schema:
    database_type = '[1]'
else:
    database_type = 'Relational'
Drag options to blanks, or click blank then click option'
ARelational
BNoSQL
CGraph
DTime-Series
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing relational databases for flexible schema
Confusing graph and time-series databases
3fill in blank
hard

Fix the error in the code that selects database based on query type.

HLD
if query_type == 'relationship-heavy':
    database = '[1]'
else:
    database = 'Relational'
Drag options to blanks, or click blank then click option'
AGraph
BNoSQL
CKey-Value
DDocument
Attempts:
3 left
💡 Hint
Common Mistakes
Using relational databases for relationship-heavy queries
Choosing key-value stores incorrectly
4fill in blank
hard

Fill both blanks to complete the code that estimates database impact on system design.

HLD
if database_type == '[1]':
    scaling_strategy = '[2]'
else:
    scaling_strategy = 'Vertical Scaling'
Drag options to blanks, or click blank then click option'
ANoSQL
BHorizontal Scaling
CRelational
DSharding
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing relational for horizontal scaling
Confusing sharding with scaling strategy
5fill in blank
hard

Fill all three blanks to complete the code that decides consistency model based on database type.

HLD
if database_type == '[1]':
    consistency = '[2]'
else:
    consistency = '[3]'
Drag options to blanks, or click blank then click option'
ARelational
BStrong Consistency
CEventual Consistency
DNoSQL
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up consistency models
Assigning eventual consistency to relational databases