Practice
Solution
Step 1: Identify the role of BFF
The BFF layer acts as a tailored API gateway that adapts responses specifically for each client type, reducing payload and improving UX.Step 2: Eliminate other options
Use a shared database view that filters data per device type is incorrect because database views are not designed for client-specific adaptation and increase coupling. Let each microservice handle device-specific logic internally is wrong as microservices should remain generic and not handle client-specific logic. Use a CDN to cache different payloads per device type is incorrect because CDNs cache static content and cannot dynamically tailor API responses per device.Final Answer:
Option D -> Option DQuick Check:
BFF adapts APIs per client type for optimized payloads [check]
Solution
Step 1: Understand CDN adaptive streaming role at step 4
The CDN edge server uses bandwidth info to decide streaming quality dynamically.Step 2: Analyze adaptive streaming behavior on low bandwidth
Switching immediately to lowest bitrate (It immediately switches the stream to the lowest bitrate available without buffering) can cause playback stalls. Requesting new manifest (It requests the origin server to send a new manifest with lower bitrate options) is unnecessary at CDN edge. Serving lower bitrate chunk from cache (It serves the next video chunk at a lower bitrate from its cache if available) requires prior caching. The CDN typically pauses streaming to allow client buffering (It pauses the stream and waits for the client to buffer more data) to avoid playback interruption.Final Answer:
Option B -> Option BQuick Check:
CDN pauses streaming to buffer on low bandwidth [check]
Solution
Step 1: Analyze Redis Sorted Sets scaling limits
Sorted Sets require in-memory storage and have limited sharding options, making Redis cluster memory the bottleneck.Step 2: Compare other components
Databases can be scaled horizontally; Ranking Workers can be parallelized; API Gateways scale with load balancers.Step 3: Identify Redis cluster as first failure point
Memory pressure and inability to shard sorted sets efficiently cause Redis cluster to fail first under 10x load.Final Answer:
Option A -> Option AQuick Check:
Redis Sorted Sets memory and sharding limits cause first failure at scale [check]
Solution
Step 1: Identify bottleneck in percentile computation
Computing P50, P95, and P99 latencies in real-time requires sorting or approximation algorithms that are CPU and memory intensive.Step 2: Why aggregation service fails first
At 10x scale, the aggregation service faces exponential resource demands, making it the first to fail before storage or alerting.Final Answer:
Option B -> Option BQuick Check:
Real-time percentile computation scales poorly -> aggregation service fails first [check]
Solution
Step 1: Identify stateful components that limit horizontal scaling
The metrics aggregation service maintains counters and error budget state, which are hard to shard without losing accuracy.Step 2: Evaluate other components' scalability
Dashboards (A) are client-side and less critical; Kafka (C) scales well with partitions; alerting (D) can batch and scale horizontally.Final Answer:
Option A -> Option AQuick Check:
Stateful aggregation -> sharding limits -> bottleneck at scale [check]
