Practice
1. In a system trace, at step 4 the circuit breaker checks the failure count before forwarding a request. What happens if the failure count exceeds the threshold at this step?
easy
Solution
Step 1: Trace circuit breaker decision at Step 4
When failure count exceeds threshold, the circuit breaker transitions to OPEN state and stops forwarding requests.Step 2: Understand behavior on open circuit
Requests are immediately failed (B), not forwarded (A), retried (C), or queued (D).Final Answer:
Option A -> Option AQuick Check:
Open circuit returns error immediately without downstream call [check]
Hint: Open circuit returns error immediately, no downstream call [OK]
Common Mistakes:
2. In a code repository system, which component is best suited to efficiently store and retrieve file diffs to minimize storage space while allowing fast access for merges?
easy
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]
Hint: Content-addressable storage deduplicates by hash [check]
Common Mistakes:
3. For a chat application requiring low latency message delivery but tolerating occasional message loss, which architecture best balances latency and throughput?
medium
Solution
Step 1: Analyze latency vs throughput needs
Batch processing adds latency but can increase throughput and tolerate some message loss.Step 2: Evaluate architectures
Synchronous (A) increases latency; asynchronous queue (B) reduces latency but may cause duplicates; distributed cache (D) lacks delivery guarantees; batch (C) balances throughput with acceptable latency for some use cases.Final Answer:
Option A -> Option AQuick Check:
Batching trades latency for throughput, tolerating some loss [check]
Hint: Batching trades latency for throughput and tolerates loss [check]
Common Mistakes:
4. If the centralized session store is unavailable, what exactly breaks in a system where stateless frontends rely on it for user session data?
medium
Solution
Step 1: Identify session store role
Centralized session store provides authentication and session state to stateless frontends.Step 2: Trace failure impact
If unavailable, frontends cannot validate sessions, leading to silent session expiry and unauthenticated request processing.Final Answer:
Option C -> Option CQuick Check:
Session store down -> sessions expire silently, requests proceed unauthenticated [check]
Hint: Session store down -> silent expiry, unauthenticated requests proceed [check]
Common Mistakes:
5. Without a distributed lock service, what exactly breaks when two instances concurrently update a shared configuration in a distributed system?
medium
Solution
Step 1: Understand lack of distributed locking
Without distributed locks, concurrent updates can overwrite each other silently (B), causing inconsistent state.Step 2: Evaluate other options
System does not automatically queue updates (C) without explicit coordination. Database rejecting conflicting transactions (D) depends on isolation level and may not prevent lost updates. System crash (A) is unrelated.Final Answer:
Option C -> Option CQuick Check:
Concurrent updates without locks -> silent overwrite [check]
Hint: No lock -> silent overwrite, no automatic queuing [check]
Common Mistakes:
