Practice
Solution
Step 1: Identify token streaming requirements
Token streaming demands low latency and ordered delivery with backpressure to avoid overwhelming clients.Step 2: Evaluate component suitability
Relational DBs (A) add latency and locking overhead; distributed file systems (C) are too slow for real-time streaming; batch processing (D) adds unacceptable delay. Redis Streams (B) supports in-memory buffering with backpressure and ordered delivery.Final Answer:
Option C -> Option CQuick Check:
Redis Streams supports ordered, low-latency token streaming with backpressure [check]
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: Trace Feed Worker behavior at cache miss
When TTL expires, the cache is stale. The Feed Worker must avoid blocking feed generation.Step 2: Understand asynchronous cache refresh
To maintain low latency, the Feed Worker returns empty stories immediately and triggers async cache refresh. Blocking fetch (B) would increase latency. Returning stale data (A) risks outdated content. Skipping stories silently (C) loses user experience.Final Answer:
Option A -> Option AQuick Check:
Async cache refresh avoids blocking feed generation [check]
Solution
Step 1: Analyze log storage requirements
Logs are write-once, large volume, and require fast analytical queries.Step 2: Evaluate columnar data warehouse
Columnar stores optimize for append-only writes and fast scans, reducing cost and improving query speed.Final Answer:
Option C -> Option CQuick Check:
Columnar warehouse -> optimized for append-only and analytics [check]
Solution
Step 1: Understand failure impact on Layer 7 inspection
If HTTP header inspection fails, the load balancer may fallback to Layer 4 forwarding to maintain availability.Step 2: Eliminate options inconsistent with graceful degradation
Dropping all connections (B) is unlikely; forwarding blindly to default backend (A) loses load distribution; encryption errors (D) unrelated.Final Answer:
Option C -> Option CQuick Check:
Layer 7 failure -> fallback to Layer 4 forwarding without HTTP routing [check]
