Practice
Solution
Step 1: Understand segment finalization
Once an HLS segment is finalized and published, it is immutable to ensure consistent playback for viewers.Step 2: Handling delayed packets
Reopening finalized segments (B) breaks immutability. Buffering for next segment (C) misplaces packets out of order. Restarting stream (D) is costly and unnecessary. Discarding late packets (A) maintains low latency and stream integrity.Final Answer:
Option A -> Option AQuick Check:
Discarding late packets preserves segment immutability and low latency [check]
Solution
Step 1: Role of ZooKeeper in Kafka
ZooKeeper manages partition leadership and consumer offsets; losing it affects coordination but not immediate message loss.Step 2: Failure impact on delivery
Without ZooKeeper, offset metadata can become inconsistent, causing consumers to re-read messages and receive duplicates (C); producers may still write (B is partially true but leadership election stalls eventually); cluster does not shut down automatically (D).Final Answer:
Option C -> Option CQuick Check:
ZooKeeper loss -> offset inconsistency -> duplicate consumer messages [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: Identify event store role in command processing
The event store (Kafka) durably persists events and decouples command processing from read model updates.Step 2: Trace failure without event store
Without Kafka, commands have no durable event persistence, causing silent failures as events are lost without notification.Final Answer:
Option C -> Option CQuick Check:
No event store -> commands lost silently, no durability [check]
Solution
Step 1: Analyze client connectivity constraints
Mobile clients often have intermittent connectivity and poor support for HTTP/2 streaming.Step 2: Evaluate streaming options
Direct gRPC streaming (A) is unreliable on mobile. WebSockets (C) add complexity and JSON is less efficient. REST long polling (D) is less efficient and higher latency. Unary calls with polling and backoff (B) handle intermittent connectivity gracefully.Final Answer:
Option B -> Option BQuick Check:
Mobile intermittent -> unary calls + polling with backoff [check]
