Practice
X-API-Version header, what is the exact failure observed by clients using header-based versioning?Solution
Step 1: Understand gateway header parsing role
The gateway usesX-API-Versionheader to route requests; losing parsing logic means it cannot determine version.Step 2: Trace failure consequences
Without parsing, the gateway may retry or fallback inefficiently, causing increased latency rather than immediate errors or silent fallback.Final Answer:
Option D -> Option DQuick Check:
Missing header parsing causes retries and latency spikes [check]
Solution
Step 1: Analyze push vs pull for dynamic content freshness
Push model can overload origin with frequent updates; polling adds unnecessary load.Step 2: Evaluate pull with TTL caching
Pull with TTL balances freshness and origin load by caching briefly and refreshing on expiry.Final Answer:
Option A -> Option AQuick Check:
Pull with TTL caching balances freshness and origin load [check]
Solution
Step 1: Understand role of commit metadata DB
Commit metadata DB stores branch pointers; without it, server cannot persist new branches.Step 2: Trace branch creation failure
Client may create branch locally, but server cannot persist it, so branch is effectively lost or inconsistent.Step 3: Eliminate other options
Queuing without notification hides failure; immediate error is possible but not typical if client allows local ops; marking unverified branches requires metadata DB access.Final Answer:
Option D -> Option DQuick Check:
Metadata DB down -> branch created locally but not persisted [check]
Solution
Step 1: Analyze timeline cache scaling challenges
Timeline caches hold per-user timelines; large follower counts cause exponential memory growth.Step 2: Compare other components
Relational DB (A) is mostly append-only and sharded; chat servers (B) irrelevant here; delivery workers (D) scale with Kafka partitions.Step 3: Identify first failure point
Memory pressure on timeline caches causes eviction and stale timelines first at 10x scale.Final Answer:
Option D -> Option DQuick Check:
Timeline caches hit memory limits first due to follower fan-out [check]
Solution
Step 1: Analyze stateful WebSocket connections on Chat Servers
Chat Servers maintain in-memory state per WebSocket; scaling requires connection migration which is complex.Step 2: Compare other components
Databases can shard; Kafka partitions can be increased with rebalancing; presence TTL cache scales horizontally.Final Answer:
Option A -> Option AQuick Check:
Stateful WebSocket connections -> Chat Servers bottleneck at scale [check]
