Practice
Solution
Step 1: Understand minimal remapping requirement
Modulo-based hashing (Use a simple modulo-based hash function on node count) causes massive remapping when node count changes. Centralized directory (Use a centralized directory service mapping keys to nodes) adds single point of failure and latency. Consistent hashing with virtual nodes (Use consistent hashing with virtual nodes and a hash ring) reduces remapping but is more complex and less direct than Rendezvous Hashing.Step 2: Identify Rendezvous Hashing benefits
Rendezvous Hashing assigns keys to nodes by computing scores and picking the highest, minimizing remapping and avoiding ring maintenance.Final Answer:
Option A -> Option AQuick Check:
Rendezvous Hashing picks highest score node -> minimal remapping [check]
Solution
Step 1: Trace Kafka's role in upload pipeline
Kafka buffers upload events for async processing; frontend uploads don't block on Kafka (A wrong).Step 2: Identify failure impact
Metadata extraction and transcoding (B) stall but do not cause immediate video unavailability; feed algorithm (D) depends on processed data, not Kafka directly.Step 3: Recognize CDN caching dependency
Without Kafka, processed videos don't reach CDN timely, causing cache misses and playback failures (C).Final Answer:
Option D -> Option DQuick Check:
Kafka outage delays CDN caching, causing playback failures [check]
Solution
Step 1: Analyze timeline and complexity constraints
Rapid iteration and minimal upfront complexity favor monolithic design to avoid distributed system overhead.Step 2: Eliminate options mismatched to constraints
Microservices add complexity and deployment overhead, unsuitable for quick iteration; monoliths still require deployment automation.Final Answer:
Option A -> Option AQuick Check:
Monolith -> faster iteration, less initial complexity [check]
Solution
Step 1: Analyze term distribution and query update needs
Skewed term distributions cause TF-IDF to overweight rare terms excessively; frequent updates require robust scoring.Step 2: Evaluate scoring methods
BM25 accounts for term frequency saturation and normalizes by document length, improving relevance in skewed data; TF-IDF and raw TF lack these refinements; vector space ignoring TF loses relevance signals.Final Answer:
Option C -> Option CQuick Check:
BM25 handles skew and length normalization better than TF-IDF [check]
Solution
Step 1: Analyze read latency and schema flexibility needs
Social feeds require fast reads and flexible schema to handle diverse content types.Step 2: Compare database options
Relational DBs have join overhead; graph DBs excel at relationships but not high-volume feed reads; in-memory cache alone lacks persistence.Step 3: Justify wide-column NoSQL choice
Wide-column stores denormalize data for fast reads and support flexible schemas, fitting feed requirements.Final Answer:
Option B -> Option BQuick Check:
Wide-column NoSQL -> denormalized, low-latency reads [check]
