Practice
Solution
Step 1: Identify storage needs for unstructured data with metadata
Object storage stores data as objects with customizable metadata and supports HTTP APIs, ideal for images/videos.Step 2: Eliminate other storage types
Block storage is low-level and lacks metadata support; file storage is optimized for hierarchical file systems but less scalable for massive unstructured data; in-memory storage is volatile and unsuitable for large persistent files.Final Answer:
Option A -> Option AQuick Check:
Object storage = scalable unstructured data + metadata + HTTP [check]
Solution
Step 1: Trace Merge Worker behavior at Step 5
When a merge conflict occurs, automatic resolution is unsafe; the system flags the PR as conflicted and requires manual user intervention.Step 2: Eliminate incorrect options
Automatic conflict resolution risks data loss; discarding PR or deleting branches is destructive; infinite retries cause resource exhaustion.Final Answer:
Option A -> Option AQuick Check:
Merge conflicts -> PR marked conflicted, user notified [check]
Solution
Step 1: Identify data structure for sorted order and fast updates
Redis Sorted Sets provide O(log N) insertion and rank queries with in-memory speed, ideal for real-time leaderboards.Step 2: Eliminate other options based on latency and ordering
Relational DBs have higher write latency and complex locking; Kafka stores events but doesn't maintain sorted order; MongoDB lacks efficient sorted queries at scale.Final Answer:
Option D -> Option DQuick Check:
Redis Sorted Sets maintain sorted scores with low latency [check]
Solution
Step 1: Evaluate Redis SETNX under high contention
Redis SETNX with TTL (A) is fast but can cause split-brain and stale locks under network partitions, violating correctness.Step 2: Consider consensus-based lock service
Consensus-based services like etcd (B) provide strong consistency and fault tolerance, ensuring correctness even if latency is higher.Step 3: Assess database row locks and local locks
Database locks (C) have high latency and risk deadlocks; local locks (D) do not coordinate across nodes, failing correctness.Final Answer:
Option B -> Option BQuick Check:
Consensus ensures correctness under contention despite latency [check]
Solution
Step 1: Identify stateful bottlenecks at scale
Routing tables maintaining session persistence are stateful and hard to shard, causing scaling limits.Step 2: Compare other components
Health checks scale horizontally; backend servers scale independently; DNS resolvers can be cached and distributed.Final Answer:
Option A -> Option AQuick Check:
Stateful routing tables limit scaling due to session affinity [check]
