Practice
1. A distributed messaging system processes millions of events per second. Some messages fail processing due to transient errors and must be retried without blocking the main queue. Which component best handles isolating these failed messages for later inspection and retry?
easy
Solution
Step 1: Identify the role of Dead Letter Queues
DLQs isolate failed messages from the main queue, enabling retries without blocking normal processing.Step 2: Evaluate alternatives
Relational DBs (A) add latency and complexity; Redis (C) lacks durability guarantees; load balancers (D) do not handle message state or retries.Final Answer:
Option A -> Option AQuick Check:
DLQ isolates failures for retry without blocking main queue [check]
Hint: Dead Letter Queues isolate failures, not caches or DBs [OK]
Common Mistakes:
2. In a distributed counter system using sharded CRDTs, at Step 4 the Aggregator node merges shard states received from replicas. What is the Aggregator's state immediately after merging two shards with counts 100 and 150?
easy
Solution
Step 1: Understand CRDT merge semantics for counters
Sharded counters merge by summing counts from each shard to reflect total increments without double counting.Step 2: Apply merge to counts 100 and 150
Sum is 250, representing combined increments from both shards.Final Answer:
Option C -> Option CQuick Check:
CRDT counters merge by summing shard values [check]
Hint: CRDT counters merge by summing shard counts [check]
Common Mistakes:
3. For storing feature metadata and versioning in the registry, which storage approach is best when the system requires strong consistency and auditability for compliance?
medium
Solution
Step 1: Identify compliance needs for strong consistency and auditability
Compliance requires strict transactional guarantees and immutable audit trails.Step 2: Evaluate storage options
NoSQL and object stores offer eventual consistency, risking stale reads. Kafka provides append-only logs but lacks transactional ACID guarantees for metadata queries. Relational DBs provide ACID transactions and built-in audit logging, ensuring compliance.Final Answer:
Option A -> Option AQuick Check:
Relational DBs ensure ACID and audit logging for compliance [check]
Hint: Compliance needs ACID and audit logs -> relational DB [check]
Common Mistakes:
4. For the fraud detection system's rule engine, which architecture best supports rapid rule updates without downtime while maintaining low latency scoring?
medium
Solution
Step 1: Evaluate embedding rules in code (A) and binaries (D)
Both require redeployment or restart on rule changes, causing downtime or latency spikes.Step 2: Assess querying rules synchronously (C)
Querying rules synchronously adds latency and risk of inconsistent rule versions during scoring.Step 3: Consider external rule engine with hot-reload (B)
This allows dynamic rule updates without downtime and low latency via caching and efficient evaluation.Final Answer:
Option B -> Option BQuick Check:
External hot-reload rule engine -> dynamic updates, low latency [check]
Hint: Hot-reload rule engine enables live updates without downtime [check]
Common Mistakes:
5. For a stock exchange system requiring low-latency order matching and high availability, which architecture is best suited to handle failover without losing in-flight orders?
medium
Solution
Step 1: Analyze architecture requirements
Low latency and high availability require partitioning to avoid bottlenecks and asynchronous replication to avoid blocking on failover.Step 2: Evaluate options
Use a single centralized matching engine with synchronous replication to a hot standby blocks on synchronous replication causing latency; Use multiple independent matching engines with eventual consistency and conflict resolution risks conflicts and inconsistent order books; Use a cloud-managed database with built-in failover and no dedicated matching engine lacks dedicated matching engine causing latency and complexity.Final Answer:
Option A -> Option AQuick Check:
Partitioned matching engine + async replication -> low latency + availability [check]
Hint: Partition and async replication for low latency failover [check]
Common Mistakes:
