Practice
Solution
Step 1: Identify low-latency requirement for online inference
Online inference demands sub-millisecond feature retrieval, which batch systems or heavy SQL queries cannot provide efficiently.Step 2: Evaluate component suitability
Distributed file systems and batch processing are optimized for throughput, not low latency. Relational DBs struggle with scale and latency at 100K QPS. In-memory key-value stores like Redis provide fast, scalable lookups ideal for this use case.Final Answer:
Option C -> Option CQuick Check:
In-memory key-value stores enable low-latency feature serving [check]
Solution
Step 1: Identify latency and loss tolerance requirements
Live video streaming prioritizes low latency and can tolerate some packet loss, so retransmission delays are undesirable.Step 2: Match protocol characteristics
UDP provides minimal overhead and no retransmission, fitting low latency needs. TCP guarantees delivery but adds delay due to retransmissions and congestion control.Final Answer:
Option A -> Option AQuick Check:
UDP suits low-latency, lossy streaming [check]
Solution
Step 1: Identify the need for decoupling writes from fan-out
Handling 1 million writes per second with synchronous fan-out is not feasible on a single machine or direct calls.Step 2: Evaluate components for asynchronous buffering
Kafka provides durable, partitioned logs that buffer writes and allow scalable asynchronous delivery. Relational DBs can't handle this write load synchronously. Redis lacks durability guarantees for this scale. Direct HTTP calls block and don't scale.Final Answer:
Option D -> Option DQuick Check:
Kafka buffers writes asynchronously, enabling high write throughput [check]
Solution
Step 1: Understand hash function independence role
Independent hash functions distribute bits uniformly; correlated hashes cause clustering.Step 2: Trace effect of correlated hashes
Correlated hashes set overlapping bits, saturating the bit array faster, increasing false positives and reducing filter effectiveness.Final Answer:
Option A -> Option AQuick Check:
Correlated hashes cause bit array saturation, raising false positives [check]
Solution
Step 1: Understand Kafka's role in buffering vote events
Kafka buffers vote events reliably; if it fails, vote events cannot be streamed to processors.Step 2: Analyze failure impact
Vote submissions do not block immediately (Vote events cannot be buffered, causing vote submission requests to block or fail immediately wrong) because frontends can still accept votes and cache temporarily. Votes are not lost silently (Users can still vote, but votes are lost silently without any retry wrong) because Redis or other caches buffer them. UI shows stale scores due to lack of processed updates (The UI shows stale post scores but votes are queued in Redis for later processing correct). Votes continue to be processed but ranking updates become inconsistent is incorrect as votes stop flowing, not just ranking inconsistency.Final Answer:
Option B -> Option BQuick Check:
Kafka failure causes stale UI scores; votes buffered in Redis [check]
