Practice
1. A globally distributed application requires strong consistency for writes but must tolerate network partitions gracefully. Which replication pattern best fits this scenario?
easy
Solution
Step 1: Understand consistency requirements
Strong consistency requires writes to be serialized and acknowledged before success.Step 2: Evaluate replication patterns
Primary-replica with synchronous writes ensures all writes go through a single primary, preserving consistency. Multi-primary with async or eventual consistency cannot guarantee strong consistency.Final Answer:
Option D -> Option DQuick Check:
Primary sync writes -> strong consistency, tolerates partitions by blocking writes [check]
Hint: Strong consistency -> single primary synchronous writes [check]
Common Mistakes:
2. In the request flow of a video call setup, at step 5 the Signaling Server receives an SDP offer from Alice and forwards it to Bob. What state does the Signaling Server maintain immediately after forwarding the offer?
easy
Solution
Step 1: Trace Signaling Server behavior at step 5
The server forwards Alice's SDP offer to Bob and stores it to correlate with Bob's answer.Step 2: Understand session state management
Session is not established until Bob's SDP answer arrives; the offer must be retained temporarily.Final Answer:
Option A -> Option AQuick Check:
Signaling Server stores offer awaiting answer before session established [check]
Hint: Signaling stores offer until answer arrives, then session established [check]
Common Mistakes:
3. In a system design interview, at step 4, you explain your choice of caching layer to reduce latency. What happens at this step when the cache misses the requested data?
easy
Solution
Step 1: Trace cache behavior on miss at step 4
On a cache miss, the cache should fetch fresh data from the backend to serve the request.Step 2: Confirm cache updates itself before responding
This ensures subsequent requests hit the cache, reducing latency and load on backend.Final Answer:
Option D -> Option DQuick Check:
Cache miss triggers backend fetch and cache update [check]
Hint: Cache miss triggers backend fetch and update [check]
Common Mistakes:
4. For a large-scale web crawler, which architecture best balances crawl rate and politeness when crawling millions of domains with varying rate limits?
medium
Solution
Step 1: Analyze centralized vs distributed scheduling
Centralized Scheduler becomes a bottleneck at scale; distributed sharding allows parallelism and localized politeness enforcement.Step 2: Evaluate other options
Independent crawlers without shared politeness risk domain overload; single-threaded crawler can't scale to millions of domains.Final Answer:
Option B -> Option BQuick Check:
Distributed sharding enables scalable politeness enforcement [check]
Hint: Distributed sharding scales politeness enforcement best [OK]
Common Mistakes:
5. For a globally distributed collaborative editor with many offline users, which approach better supports eventual consistency and offline edits, and why?
medium
Solution
Step 1: Compare OT and CRDT for offline and distributed scenarios
OT typically requires a central server to order and transform operations, making offline support complex.Step 2: Understand CRDT advantages
CRDTs are designed for decentralized environments, allowing local operations to be merged eventually without coordination, ideal for offline edits and global distribution.Final Answer:
Option C -> Option CQuick Check:
CRDTs enable offline edits and eventual consistency without central coordination [check]
Hint: CRDTs merge offline edits without central coordination [OK]
Common Mistakes:
