Practice
Solution
Step 1: Understand Delivery Worker role at Step 4
It checks recipient online status cache to decide delivery method.Step 2: Behavior on expired cache entry
Expired cache means unknown status; system falls back to persistent queue to ensure message is not lost.Final Answer:
Option A -> Option AQuick Check:
Expired cache triggers fallback to persistent queue [check]
Solution
Step 1: Identify approximate frequency counting need
Relational DBs and caches store exact counts but require large memory and are slow at scale.Step 2: Recognize Count-Min Sketch properties
Count-Min Sketch uses multiple hash functions and fixed memory to estimate frequencies with bounded error.Final Answer:
Option A -> Option AQuick Check:
Count-Min Sketch approximates frequencies with fixed memory and multiple hashes [check]
Solution
Step 1: Identify deployment isolation needs
Decoupling feature deployments requires independent service lifecycles, which microservices provide.Step 2: Evaluate alternatives
Monoliths (A and C) share deployment units, risking system-wide impact. Serverless (D) can be tightly coupled if functions share state or deployment.Final Answer:
Option A -> Option AQuick Check:
Microservices enable independent deploys and reduce blast radius [check]
Solution
Step 1: Compare OT and CRDT for offline and distributed scenarios
OT typically requires a central server to order and transform operations, making offline support complex.Step 2: Understand CRDT advantages
CRDTs are designed for decentralized environments, allowing local operations to be merged eventually without coordination, ideal for offline edits and global distribution.Final Answer:
Option C -> Option CQuick Check:
CRDTs enable offline edits and eventual consistency without central coordination [check]
Solution
Step 1: Analyze write scalability and read patterns
High write throughput and millions of users require scalable writes and efficient feed reads.Step 2: Evaluate referencing with denormalization
Referencing separates concerns; denormalizing popular posts into feeds optimizes read performance without large documents.Final Answer:
Option D -> Option DQuick Check:
Referencing plus denormalization balances write scale and read speed [check]
