Practice
Solution
Step 1: Identify the need for high write throughput and partition tolerance
A centralized DB (A) and distributed lock (C) impose coordination and reduce availability. Message queue batching (D) adds latency and synchronous bottlenecks.Step 2: Recognize CRDT sharded counters allow concurrent increments without coordination and eventual consistency
CRDTs replicate asynchronously and merge without conflicts, fitting the scale and partition tolerance needs.Final Answer:
Option D -> Option DQuick Check:
CRDTs enable concurrent, partition-tolerant increments [check]
Solution
Step 1: Understand Duplicate Detection behavior at Step 5
If the URL has been seen before, it is filtered out to prevent redundant crawling.Step 2: Eliminate other options
Re-queuing duplicates wastes resources; marking for delayed re-crawl is a separate process; Politeness Policy Manager handles timing, not duplication.Final Answer:
Option A -> Option AQuick Check:
Duplicate Detection discards seen URLs to avoid redundancy [check]
Solution
Step 1: Analyze latency and consistency needs
Real-time games require fast access to player state with strong consistency.Step 2: Evaluate architecture trade-offs
Stateful servers with in-memory state reduce latency and allow immediate state updates; periodic persistence balances durability.Final Answer:
Option D -> Option DQuick Check:
Stateful in-memory state + persistence -> low latency, consistent [check]
Solution
Step 1: Analyze scaling challenges
Matching Engine partitions order books per stock symbol, but large cross-symbol or large orders require coordination, causing latency and bottlenecks at scale.Step 2: Evaluate other components
Market Data Feed scales with multicast or sharding; Order Book storage uses scalable Kafka or NoSQL; network layer scales with load balancers and horizontal scaling.Final Answer:
Option D -> Option DQuick Check:
Cross-partition coordination -> Matching Engine bottleneck at scale [check]
Solution
Step 1: Analyze timestamp and network constraints
Timestamp synchronization (A) is challenging but tolerable with NTP; network coordination (D) is minimal as IDs are generated locally.Step 2: Evaluate sequence number limits
Sequence number (B) limits per millisecond can cause blocking but can be mitigated by load balancing or sharding.Step 3: Identify machine ID allocation bottleneck
Machine ID bits are fixed (e.g., 10 bits), limiting the number of unique machines. At 10x scale, running out of unique machine IDs causes collisions or requires complex reallocation.Final Answer:
Option D -> Option DQuick Check:
Fixed machine ID bits limit scale -> collisions or reconfiguration needed [check]
