Practice
1. For candidate-job matching, which architecture better supports real-time personalized recommendations with low latency and frequent profile updates?
medium
Solution
Step 1: Analyze real-time personalization needs
Low latency and frequent profile updates require online, streaming data processing.Step 2: Evaluate architectures
Batch (A) is too stale; static precomputed scores (C) can't adapt quickly; client-side filtering (D) lacks server-side intelligence. Online feature store with streaming (B) supports fresh data and low latency scoring.Final Answer:
Option C -> Option CQuick Check:
Streaming updates + real-time scoring -> fresh personalized matches [check]
Hint: Streaming + online features enable fresh real-time recommendations [check]
Common Mistakes:
2. If the sliding window counter's timestamp cleanup process fails, what is the most likely failure observed in rate limiting?
medium
Solution
Step 1: Understand sliding window cleanup role
Cleanup removes timestamps outside the window; failure causes stale timestamps to accumulate.Step 2: Accumulated stale timestamps inflate request counts, causing the rate limiter to block legitimate requests indefinitely
This leads to false positives in rate limiting, denying service unnecessarily.Final Answer:
Option C -> Option CQuick Check:
Failed cleanup -> stale timestamps inflate counts -> requests blocked indefinitely [check]
Hint: No cleanup means stale timestamps block requests falsely [check]
Common Mistakes:
3. Without the asynchronous replication component in a PACELC system prioritizing latency, what exactly breaks during a network partition?
medium
Solution
Step 1: Identify role of asynchronous replication
It propagates updates to other replicas to keep data fresh despite partitions.Step 2: Trace failure without async replication
Without it, replicas do not get updates, so reads return stale data indefinitely.Final Answer:
Option A -> Option AQuick Check:
No async replication -> stale reads persist during partition [check]
Hint: No async replication -> stale reads never update during partition [check]
Common Mistakes:
4. For a system requiring globally unique, roughly time-ordered IDs across multiple data centers, which approach best balances latency and uniqueness guarantees?
medium
Solution
Step 1: Evaluate centralized generator with sync replication
This causes high latency and single point of failure, unsuitable for geo-distributed low-latency needs.Step 2: Assess decentralized Snowflake approach
Decentralized generators with node IDs and loosely synchronized clocks provide low latency and uniqueness with approximate ordering.Step 3: Consider UUID v4 and DB auto-increment
UUID v4 lacks ordering; DB auto-increment with partitioning risks collisions and coordination overhead.Final Answer:
Option B -> Option BQuick Check:
Decentralized Snowflake -> low latency + uniqueness + approximate ordering [check]
Hint: Decentralized with node ID and clock sync balances latency and uniqueness [check]
Common Mistakes:
5. At 10x scale, which component in a real-time chat system is most likely to fail first due to latency-throughput trade-offs, and why?
hard
Solution
Step 1: Identify stateful bottlenecks
Chat servers maintain WebSocket connections statefully, limiting horizontal scaling.Step 2: Compare other components
Databases (A) can be sharded; brokers (C) can add partitions; load balancers (D) scale horizontally; chat servers (B) fail first due to sticky state and connection limits.Final Answer:
Option D -> Option DQuick Check:
Stateful WebSocket servers limit scaling more than other components [check]
Hint: Stateful WebSocket servers block scaling first at 10x load [check]
Common Mistakes:
