Practice
Solution
Step 1: Identify ordering guarantee mechanism
Kafka partitions keyed by subscriber ID ensure all events for that subscriber go to the same partition, preserving order.Step 2: Eliminate other options
Redis cache lacks strong ordering guarantees under retries; relational DB global sequence causes contention and latency; load balancer routing alone doesn't guarantee ordering without stateful processing.Final Answer:
Option A -> Option AQuick Check:
Kafka partition key -> per-subscriber ordering guaranteed [check]
Solution
Step 1: Identify Metadata Server role
Metadata Servers maintain the namespace and metadata such as file attributes and directory structure, handling frequent metadata updates.Step 2: Eliminate other components
Data Nodes store file blocks but do not manage metadata; client caching reduces load but does not handle updates; load balancers distribute traffic but don't manage metadata.Final Answer:
Option C -> Option CQuick Check:
Metadata Servers handle namespace and metadata updates efficiently [check]
Solution
Step 1: Identify failover orchestration component
The consensus protocol like Raft manages leader election and ensures log replication consistency, enabling automatic failover without data loss.Step 2: Eliminate other options
Client-side retries (A) handle reconnection but don't orchestrate failover; load balancers (B) redirect traffic but don't manage state; backups (D) aid recovery but not live failover.Final Answer:
Option A -> Option AQuick Check:
Consensus protocol controls leader election and failover [check]
Solution
Step 1: Identify decoupling and durability needs
In-memory queues (Use a simple in-memory queue on the producer server to buffer messages) lack durability and don't scale across servers. Direct HTTP push (Use a direct HTTP push from producer to each consumer) tightly couples producer and consumers, causing backpressure issues. Polling a relational DB (Use a relational database with polling by consumers) adds latency and load on DB, unsuitable for high throughput.Step 2: Recognize Kafka's role
Kafka's distributed log with topic partitions decouples producers and consumers, provides durability, and supports high throughput with consumer groups.Final Answer:
Option A -> Option AQuick Check:
Kafka partitions enable durable, scalable decoupling [check]
Solution
Step 1: Understand metadata server role in file writes
The metadata server manages file metadata; if it crashes, metadata updates are lost but data blocks may be written.Step 2: Trace failure impact
Without metadata updates, directory entries and inode info become inconsistent, leading to orphaned or inaccessible files despite data blocks existing.Final Answer:
Option D -> Option DQuick Check:
Metadata server crash -> lost metadata, inconsistent directory [check]
