Practice
1. A notification system must handle 1 million notification writes per second and fan out to millions of devices asynchronously. Which component best decouples the write load from delivery workers to ensure durability and scalability?
easy
Solution
Step 1: Identify the role of the message queue
Kafka provides durable, partitioned logs that decouple producers from consumers, enabling high write throughput and ordered delivery per user.Step 2: Evaluate other options
Relational DB polling (A) can't handle 1M writes/sec efficiently; Redis (C) lacks durability and persistence guarantees; synchronous HTTP (D) blocks on delivery and doesn't scale.Final Answer:
Option D -> Option DQuick Check:
Kafka partitions by user ID -> durable, ordered fan-out [check]
Hint: Kafka partitions decouple writes from delivery at scale [check]
Common Mistakes:
2. In the typeahead system request flow, at step 4 the Ranking Service receives candidate suggestions from the Trie Cache. What does the Ranking Service do if the personalization data for the user is missing at this step?
easy
Solution
Step 1: Trace Ranking Service behavior at step 4
Ranking Service combines candidate suggestions with personalization data; if missing, it must still return relevant results.Step 2: Evaluate fallback strategies
Blocking for personalization data (C) causes latency; empty results (A) degrade UX; querying Trie again (D) is unrelated. Falling back to global popularity ranking ensures responsiveness.Final Answer:
Option C -> Option CQuick Check:
Ranking Service fallback -> global popularity ranking [check]
Hint: Missing personalization -> fallback to global popularity ranking [check]
Common Mistakes:
3. A system must efficiently handle millions of concurrent calendar availability updates from hosts worldwide, ensuring low latency and eventual consistency. Which component is best suited to buffer and process these updates asynchronously?
easy
Solution
Step 1: Identify the need for asynchronous buffering
Millions of concurrent updates require decoupling ingestion from processing to avoid bottlenecks.Step 2: Evaluate component suitability
Relational DB (A) causes high contention and latency; Redis (C) is volatile and not durable; synchronous API calls (D) block and reduce throughput. Kafka (B) provides durable, ordered, and scalable buffering.Final Answer:
Option D -> Option DQuick Check:
Kafka buffers high-throughput writes asynchronously with durability [check]
Hint: Buffer high-write updates asynchronously with durable queues [check]
Common Mistakes:
4. In a system where a user requests access to a protected resource, at step 4 the Authorization Service checks the user's access token. What happens if the token is expired at this step?
easy
Solution
Step 1: Understand Authorization Service behavior at token validation
The service validates token expiry and rejects expired tokens.Step 2: Eliminate incorrect behaviors
Granting access with expired token violates security; automatic refresh is done by Authentication Service, not Authorization; forwarding without validation breaks security.Final Answer:
Option D -> Option DQuick Check:
Expired tokens cause 401 Unauthorized rejection [check]
Hint: Expired token -> Authorization rejects with 401 Unauthorized [check]
Common Mistakes:
5. If the Bloom filter component is removed from a Cassandra-like system, what exact failure occurs during a read request for a non-existent key?
medium
Solution
Step 1: Understand Bloom filter role in reads
Bloom filters prevent unnecessary disk reads for non-existent keys but do not affect correctness of existing keys.Step 2: Trace failure without Bloom filters
Without Bloom filters, reads for non-existent keys cause disk lookups, increasing latency but do not cause incorrect key-not-found errors for existing keys; however, missing Bloom filters can cause stale data to be returned if caching is mismanaged.Final Answer:
Option D -> Option DQuick Check:
Removing Bloom filters risks incorrect key-not-found errors due to stale cache [check]
Hint: No Bloom filter -> stale cache causes wrong misses [check]
Common Mistakes:
