Practice
1. In a system implementing causal consistency, at step 4 the Read Coordinator receives a read request for key K after a write W causally related to a previous write V. What state does the Read Coordinator ensure before returning the value for K?
easy
Solution
Step 1: Trace Read Coordinator behavior at Step 4
Under causal consistency, the Read Coordinator must ensure that all causally prior writes (like V) are visible before returning W's value to maintain causal order.Step 2: Eliminate other options
It returns the latest value of K without waiting, since eventual consistency suffices ignores causal dependencies; It returns the value from the local replica immediately, ignoring causal dependencies breaks causal guarantees by returning stale data; It synchronizes with the leader to enforce linearizability before responding enforces stronger linearizability, not required here.Final Answer:
Option B -> Option BQuick Check:
Read Coordinator waits for causal dependencies before returning [check]
Hint: Causal consistency waits for all prior causally related writes [check]
Common Mistakes:
2. In a messaging system, at step 4 the Delivery Worker checks the message queue for undelivered messages. What happens if the message's delivery TTL has expired at this step?
easy
Solution
Step 1: Understand Delivery Worker behavior at Step 4
It checks message TTL to decide if delivery attempts should continue.Step 2: TTL expiration handling
Expired messages are discarded without retry or marking to avoid resource waste; indefinite retries (A) cause resource exhaustion; marking expired (B) is not standard; dead-letter queue (C) is for failed, not expired messages.Final Answer:
Option B -> Option BQuick Check:
Expired messages are discarded to maintain throughput and latency balance [check]
Hint: Expired messages get discarded immediately, no retries [check]
Common Mistakes:
3. In a system where Step 4 is the Delivery Worker reading from a Kafka topic partitioned by user ID, what is the Delivery Worker's state if it reads a message but the downstream notification service is temporarily unavailable?
easy
Solution
Step 1: Understand Kafka consumer commit semantics
Kafka commits offsets only after successful processing. If downstream is unavailable, the message is not committed.Step 2: Delivery Worker retries uncommitted messages
Uncommitted messages remain in the topic and will be redelivered on retry, ensuring no message loss.Final Answer:
Option D -> Option DQuick Check:
Kafka offset commit after processing -> retries on failure [check]
Hint: Kafka commits offsets only after successful processing [OK]
Common Mistakes:
4. You must choose between a monolithic architecture and microservices for a system with rapidly evolving features and a small team. Which choice best justifies your design decision to the interviewer?
medium
Solution
Step 1: Analyze team size and feature velocity constraints
Small teams benefit from simpler architectures to reduce overhead and speed delivery.Step 2: Evaluate operational complexity of microservices
Microservices add deployment and operational complexity, which can slow small teams.Final Answer:
Option B -> Option BQuick Check:
Monolith reduces complexity, speeds delivery for small teams [check]
Hint: Small teams prefer monoliths for simplicity and speed [check]
Common Mistakes:
5. At 10x scale, which component in a push-based newsfeed system is most likely to fail first and why?
hard
Solution
Step 1: Analyze database scaling
Databases can be sharded and scaled horizontally; not usually the first bottleneck.Step 2: Analyze fan-out service scaling
Push-based fan-out causes write amplification proportional to follower count; at 10x scale, this bottleneck grows superlinearly and saturates first.Step 3: Analyze cache and web servers
Caches can be scaled with eviction and sharding; web servers scale with load balancers and stateless design.Final Answer:
Option A -> Option AQuick Check:
Fan-out write amplification causes first bottleneck at 10x scale [check]
Hint: Fan-out write amplification hits first at 10x scale [check]
Common Mistakes:
