Practice
Solution
Step 1: Identify storage needs for diffs
Storing diffs efficiently requires deduplication and immutability; content-addressable storage (CAS) stores objects by their hash, enabling reuse of identical content and saving space.Step 2: Evaluate other options
Relational DB with BLOBs stores full versions, wasting space; Redis is volatile and not durable for persistent storage; file system copies waste space and slow for merges.Final Answer:
Option C -> Option CQuick Check:
CAS stores objects by hash -> deduplication and fast retrieval [check]
Solution
Step 1: Understand Ledger Service's double-entry validation
The Ledger Service enforces double-entry consistency; mismatches indicate data corruption or bugs.Step 2: Evaluate failure handling
Retrying indefinitely (A) risks blocking; ignoring mismatch (C) breaks accounting; deleting entries (D) risks data loss. Marking failed and alerting (B) enables safe manual reconciliation.Final Answer:
Option B -> Option BQuick Check:
Mismatch triggers failure mark and alert -> safe reconciliation [check]
Solution
Step 1: Identify the need for deduplication and exactly-once semantics
Duplicate callbacks require idempotent processing and event tracking to avoid double charges.Step 2: Evaluate event sourcing with idempotent handlers
Event sourcing stores all events immutably with unique IDs, enabling replay and deduplication.Final Answer:
Option A -> Option AQuick Check:
Event sourcing with idempotent handlers ensures exactly-once processing [check]
Solution
Step 1: Trace producer behavior on broker failure
Producers get errors on send; without retries, messages are lost. They do not block indefinitely (A).Step 2: Trace consumer behavior
Consumers cannot fetch new messages; cached messages may be consumed but no new delivery occurs, causing stalls. Duplication (D) is prevented by offset commits.Final Answer:
Option A -> Option AQuick Check:
Broker failure causes producer errors and consumer stalls, risking message loss [check]
Solution
Step 1: Understand role of HTTP status codes
Status codes signal success or failure; 200 OK means success.Step 2: Trace client behavior without proper error codes
Clients see 200 always, so they assume success even on errors, causing silent failures or incorrect retries.Final Answer:
Option D -> Option DQuick Check:
Always 200 OK hides errors, causing silent client failures [check]
