Practice
Solution
Step 1: Understand BFF responsibilities at step 4
At step 4, the BFF aggregates data from multiple microservices and transforms it into a response tailored to the client's needs.Step 2: Eliminate incorrect options
BFF caches the entire response from microservices before returning to client is wrong because caching happens after response, not before calling microservices. BFF directly proxies the request without modification to microservices is incorrect as BFF modifies requests/responses rather than proxying blindly. BFF performs authentication and then sends request to a single microservice is incomplete; authentication usually happens earlier at API Gateway, and BFF calls multiple microservices, not just one.Final Answer:
Option A -> Option AQuick Check:
BFF aggregates and transforms data before responding [check]
Solution
Step 1: Evaluate synchronous recomputation
Monolithic synchronous (A) causes high latency and poor scalability.Step 2: Compare batch vs streaming
Streaming (C) offers freshness but is complex and costly at scale; client-side (D) lacks data for quality recommendations.Step 3: Select batch precompute
Batch jobs (B) balance freshness and scalability by precomputing and caching recommendations.Final Answer:
Option C -> Option CQuick Check:
Batch precompute caches recommendations for scalable freshness [check]
Solution
Step 1: Analyze communication pattern
Live news feed requires unidirectional server-to-client updates with many clients and no client messages.Step 2: Evaluate technology trade-offs
Server-Sent Events efficiently support unidirectional streaming with automatic reconnection and lower overhead than WebSockets. WebSockets add complexity and resource usage for no client-to-server messages. Long Polling is less efficient due to repeated HTTP requests. HTTP/2 server push is not widely supported for this use case.Final Answer:
Option B -> Option BQuick Check:
Server-Sent Events optimize unidirectional streaming with scalability [check]
Solution
Step 1: Analyze false negative tolerance
Bloom filters have zero false negatives but allow false positives, so exact checks need backend confirmation.Step 2: Evaluate approaches
Only Bloom filter (A) risks false positives causing incorrect hits. Distributed cache (C) is costly at scale. Counting Bloom filters (D) track counts but still have false positives and complexity.Final Answer:
Option D -> Option DQuick Check:
Bloom filter filters negatives; backend confirms positives for exactness [check]
Solution
Step 1: Identify bottlenecks at 10x scale
Network switches (A) scale with hardware upgrades; ZooKeeper (C) handles coordination but is lightweight compared to brokers; consumers (D) can be scaled horizontally.Step 2: Kafka broker partition leader overload
Partition leaders handle all writes and replication for their partitions; at 10x scale, leaders become hotspots causing CPU, disk, and network saturation, leading to failures.Final Answer:
Option A -> Option AQuick Check:
Partition leaders overloaded -> broker failure first at scale [check]
