Practice
Solution
Step 1: Identify ingestion requirements
High throughput (1M logs/sec) and ordering per source require a scalable, partitioned messaging system.Step 2: Evaluate Kafka's partitioning
Kafka partitions keyed by server ID ensure ordering per source and handle high throughput with durability.Final Answer:
Option D -> Option DQuick Check:
Kafka partitions keyed by source -> ordering and high throughput [check]
Solution
Step 1: Role of distributed consensus in leader election
Consensus protocols ensure exactly one leader at a time, preventing split-brain scenarios.Step 2: Consequences of missing consensus
Without consensus, multiple nodes may act as leader simultaneously, causing conflicting writes and data corruption, breaking availability guarantees.Final Answer:
Option B -> Option BQuick Check:
No consensus -> split-brain -> conflicting writes -> data corruption [check]
Solution
Step 1: Identify lock service role in reservation flow
The lock service ensures exclusive access to room inventory during reservation to prevent double booking.Step 2: Trace failure impact
Without the lock service, Inventory cannot reliably mark rooms as unavailable, leading to stale or incorrect availability states shown to users (Inventory service marks rooms as available incorrectly, causing UI to show wrong availability). Reservations may still proceed but with inconsistent inventory state. Blocking indefinitely (Reservation requests block indefinitely waiting for locks, causing user timeouts and failed bookings) is unlikely as fallback mechanisms exist. Payment processing (Payment processing fails because it depends on the lock service for transaction ordering) is independent of locking. Double bookings (Reservations proceed normally but double bookings increase due to lack of coordination) may increase but the immediate failure is incorrect inventory state.Final Answer:
Option C -> Option CQuick Check:
Lock service failure causes stale inventory availability state [check]
Solution
Step 1: Understand Kafka's role in event streaming
Kafka streams photo upload events to downstream processors like metadata extraction and feed generation.Step 2: Trace failure impact
If Kafka is down, photo uploads still succeed because upload service writes to storage directly. Feed generation depends on Kafka events for stories update; without Kafka, stories updates stop, but feed generation for photos continues from DB. Metadata extraction is delayed but not necessarily indefinite. Notifications are handled separately.Final Answer:
Option B -> Option BQuick Check:
Kafka outage stops stories update but feed photo generation continues [check]
Solution
Step 1: Analyze component scalability at 10x load
Media Servers scale with CPU but can be horizontally scaled; STUN/TURN scale well with stateless UDP; clients are outside system control.Step 2: Identify Signaling Server bottleneck
Signaling Servers hold stateful WebSocket connections per user, making sharding and scaling challenging.Final Answer:
Option B -> Option BQuick Check:
Stateful WebSocket connections limit Signaling Server horizontal scaling [check]
