All quizzesMedium
Distributed Systems
Preview — 3 of 10 questions
What does the CAP theorem state?
javascript
CP (Consistency + Partition Tolerance):
→ Returns error when partition occurs rather than stale data
→ Examples: HBase, Zookeeper, MongoDB (with strong consistency)
AP (Availability + Partition Tolerance):
→ Returns potentially stale data during partition
→ Examples: Cassandra, DynamoDB, CouchDBAA distributed system can achieve Consistency, Availability, and Partition Tolerance simultaneously.
BCAP applies only to relational databases, not NoSQL systems.
CA distributed system can guarantee at most two of: Consistency, Availability, and Partition Tolerance.
DCAP theorem states that consistency is always more important than availability.
What is a CDN (Content Delivery Network) and when should you use it?
javascript
Without CDN:
User in Tokyo → Origin server in New York → 150ms latency
With CDN:
User in Tokyo → Edge server in Tokyo → 5ms latencyAA CDN is a type of SQL database optimized for content management systems.
BA CDN is a service that automatically scales your backend servers based on traffic.
CA CDN encrypts all traffic between your server and users.
DA CDN is a distributed network of servers that delivers static assets from locations geographically close to users to reduce latency.
Why do database indexes improve query performance?
javascript
Table scan: check row 1, 2, 3... 1,000,000 → FOUND (500ms)AIndexes compress data so less disk space is used.
BIndexes automatically cache the results of frequent queries in memory.
CIndexes replicate data across multiple servers for redundancy.
DIndexes create a sorted data structure that allows the database to find rows without scanning the entire table.
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.