Practice
1. A company wants to hide internal client IP addresses from external servers while allowing clients to access the internet. Which proxy type should be used to achieve this?
easy
Solution
Step 1: Identify proxy role in hiding client IPs
A forward proxy acts on behalf of clients, masking their IP addresses from external servers.Step 2: Eliminate other options
Reverse proxies hide backend servers, not clients; load balancers distribute load but don't hide clients; DNS proxies only resolve names.Final Answer:
Option D -> Option DQuick Check:
Forward proxy hides client IPs from external servers [check]
Hint: Forward proxy hides clients; reverse proxy hides servers [check]
Common Mistakes:
2. A distributed system requires generating unique IDs across multiple services without coordination delays. Which component best ensures strictly increasing, collision-free IDs with minimal latency?
easy
Solution
Step 1: Identify uniqueness and ordering requirements
UUIDs (A) are unique but not strictly increasing; timestamps with randomness (D) risk collisions under clock skew; consensus (C) adds coordination overhead and latency.Step 2: Recognize Ticket Server role
The Ticket Server (B) centrally issues sequential IDs ensuring strict ordering and uniqueness with minimal latency due to lightweight allocation.Final Answer:
Option D -> Option DQuick Check:
Centralized Ticket Server -> strict, collision-free IDs with low latency [check]
Hint: Central server issues ordered IDs, avoiding coordination delays [check]
Common Mistakes:
3. If the circuit breaker component is removed from a microservice architecture, what is the most likely failure sequence when the downstream service becomes slow or unresponsive?
medium
Solution
Step 1: Understand circuit breaker removal impact
Without circuit breaker, upstream calls block waiting for slow downstream responses.Step 2: Trace failure propagation
Blocking calls exhaust thread pools, leading to cascading failures (B). Queuing (A) or immediate failover (D) require explicit mechanisms. Immediate fail without retries (C) is unlikely without circuit breaker logic.Final Answer:
Option D -> Option DQuick Check:
Blocking calls cause thread exhaustion and cascade without circuit breaker [check]
Hint: No circuit breaker -> blocking calls exhaust threads -> cascade [OK]
Common Mistakes:
4. For a global social media platform with highly skewed user activity, which sharding strategy best balances load while minimizing cross-shard queries?
medium
Solution
Step 1: Analyze skew and query patterns
Skewed activity causes hotspots; static range or hash sharding can't adapt dynamically.Step 2: Evaluate strategies
Directory-based sharding allows dynamic assignment of hot users to dedicated shards, balancing load and reducing cross-shard queries.Final Answer:
Option A -> Option AQuick Check:
Directory-based sharding supports dynamic load balancing [check]
Hint: Directory sharding adapts dynamically to hotspots [check]
Common Mistakes:
5. 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:
