Practice
Solution
Step 1: Identify decoupling mechanism
Relational DB batch inserts (A) add latency and don't handle high write throughput well. Redis (C) lacks durability guarantees for buffering. Direct synchronous calls (D) cause backpressure and tight coupling.Step 2: Evaluate Kafka suitability
Kafka supports high-throughput, partitioned by user ID to maintain ordering per user, and durable storage, enabling asynchronous processing and backpressure handling.Final Answer:
Option D -> Option DQuick Check:
Kafka partitions decouple ingestion and scoring with durability and ordering [check]
Solution
Step 1: Trace Indexer behavior at step 3
The Indexer updates the inverted index with terms from the batch and retains batch metadata for consistency and fault tolerance.Step 2: Eliminate incorrect states
Deleting raw documents immediately risks data loss. PageRank runs after indexing, not before. Re-parsing is triggered by errors, not term frequency.Final Answer:
Option A -> Option AQuick Check:
Indexer updates index and keeps metadata for consistency [check]
Solution
Step 1: Understand load balancer behavior with round-robin and no sticky sessions
Requests are distributed evenly but not consistently to the same server.Step 2: Analyze session state handling
Stateless servers do not hold session state, so routing to different servers does not cause loss; but if state is stored in-memory, session loss occurs.Final Answer:
Option D -> Option DQuick Check:
Round-robin without sticky sessions routes requests to different servers, risking session loss [check]
Solution
Step 1: Understand DLQ role in failure isolation
Without DLQ, failed messages remain in the main queue causing retries that block subsequent messages.Step 2: Evaluate failure outcomes
Silent drops (A) lose data; automatic routing (C) requires DLQ logic; synchronous fallback (D) is not automatic.Final Answer:
Option A -> Option AQuick Check:
No DLQ -> retries block main queue causing backpressure [check]
Solution
Step 1: Evaluate consistency needs
Exactly-once processing requires strong consistency on idempotency keys to prevent duplicates during retries.Step 2: Compare architectures
Distributed cache with eventual consistency risks duplicates; client-only IDs lack server enforcement; async reconciliation delays correctness.Final Answer:
Option A -> Option AQuick Check:
Strongly consistent idempotency store ensures exactly-once processing [check]
