Practice
Solution
Step 1: Identify version isolation requirements
Embedding version in the URL path clearly separates client requests by version, preventing accidental routing to incompatible handlers.Step 2: Evaluate alternatives
Custom headers and content negotiation can be ignored or mishandled by intermediaries or caches, risking breaking changes. Query parameters are less explicit and can cause caching issues.Final Answer:
Option C -> Option CQuick Check:
URL versioning cleanly isolates versions in routing paths [check]
Solution
Step 1: Identify constraints
Frequent deployments and multiple teams require fast, low-risk releases.Step 2: Evaluate options
Blue-Green alone is heavy for frequent deploys; Canary alone lacks feature granularity; Rolling with manual rollback is slow and risky.Step 3: Combine Feature Flags and Canary
Feature Flags enable gradual feature exposure; Canary controls version rollout risk.Final Answer:
Option C -> Option CQuick Check:
Feature Flags + Canary balance speed and risk for frequent deploys [check]
Solution
Step 1: Identify compliance needs for strong consistency and auditability
Compliance requires strict transactional guarantees and immutable audit trails.Step 2: Evaluate storage options
NoSQL and object stores offer eventual consistency, risking stale reads. Kafka provides append-only logs but lacks transactional ACID guarantees for metadata queries. Relational DBs provide ACID transactions and built-in audit logging, ensuring compliance.Final Answer:
Option A -> Option AQuick Check:
Relational DBs ensure ACID and audit logging for compliance [check]
Solution
Step 1: Analyze burst handling requirements
The system must avoid sudden bursts and enforce steady rate.Step 2: Compare algorithms
Token bucket allows bursts, fixed window counters reset counts causing bursts, sliding window logs allow spikes due to timestamp granularity.Final Answer:
Option C -> Option CQuick Check:
Leaky bucket enforces steady output rate, smoothing bursts [check]
Solution
Step 1: Identify stateful bottlenecks at scale
Streaming servers maintain WebSocket connections which are stateful and tied to server memory.Step 2: Evaluate scaling challenges
Metadata DB (A) can be sharded; CDN caches (B) scale by adding regions; offline manager (D) limited by device, not server scale. Streaming servers (C) face connection limits and resharding complexity.Final Answer:
Option B -> Option BQuick Check:
Stateful WebSocket servers fail first at 10x scale [check]
