0
0
DBMS Theoryknowledge~20 mins

Sharding and partitioning in DBMS Theory - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Sharding and Partitioning Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Difference between sharding and partitioning

Which statement best describes the difference between sharding and partitioning in databases?

APartitioning splits data across multiple machines, while sharding divides data within a single machine.
BSharding splits data across multiple machines, while partitioning divides data within a single machine.
CSharding and partitioning both mean the same and are used interchangeably.
DPartitioning is only used for backup purposes, while sharding is for performance.
Attempts:
2 left
💡 Hint

Think about whether the data is split across machines or within one machine.

📋 Factual
intermediate
2:00remaining
Common sharding key choice

Which of the following is the best choice for a sharding key in a user database?

AUser's email address
BUser's last login timestamp
CUser's account creation date
DUser's unique ID number
Attempts:
2 left
💡 Hint

The sharding key should evenly distribute data and be stable.

🔍 Analysis
advanced
2:00remaining
Impact of uneven data distribution in sharding

What is the main problem caused by uneven data distribution across shards?

AThe database automatically merges shards to balance data.
BData backup becomes impossible for the overloaded shards.
CSome shards become overloaded, causing slower response times and potential failures.
DUsers lose access to data stored on smaller shards.
Attempts:
2 left
💡 Hint

Consider what happens if one shard holds much more data than others.

Comparison
advanced
2:00remaining
Horizontal vs vertical partitioning

Which statement correctly compares horizontal and vertical partitioning?

AHorizontal partitioning splits rows into groups, vertical partitioning splits columns into groups.
BVertical partitioning splits rows into groups, horizontal partitioning splits columns into groups.
CBoth horizontal and vertical partitioning split data by rows only.
DBoth horizontal and vertical partitioning split data by columns only.
Attempts:
2 left
💡 Hint

Think about whether partitioning divides data by rows or columns.

Reasoning
expert
2:00remaining
Choosing sharding strategy for a global app

A global social media app wants to shard its user data to improve performance. Which sharding strategy is best to reduce latency for users worldwide?

AShard data by user geographic region so users connect to nearby servers.
BShard data by user age group to balance load evenly.
CShard data by user signup date to keep recent users together.
DShard data randomly to avoid any predictable pattern.
Attempts:
2 left
💡 Hint

Consider how physical location affects network speed and latency.