Practice
1. A company needs to store large amounts of unstructured data like images and videos with metadata accessible via HTTP APIs. Which storage type best fits this use case?
easy
Solution
Step 1: Identify storage needs for unstructured data with metadata
Object storage stores data as objects with customizable metadata and supports HTTP APIs, ideal for images/videos.Step 2: Eliminate other storage types
Block storage is low-level and lacks metadata support; file storage is optimized for hierarchical file systems but less scalable for massive unstructured data; in-memory storage is volatile and unsuitable for large persistent files.Final Answer:
Option A -> Option AQuick Check:
Object storage = scalable unstructured data + metadata + HTTP [check]
Hint: Object storage = objects + metadata + HTTP access [check]
Common Mistakes:
2. A distributed system needs to enforce a global rate limit of 1000 requests per second across multiple API servers. Which component is best suited to maintain a consistent count of requests in real-time?
easy
Solution
Step 1: Identify the need for a consistent global count
Local counters aggregated periodically (Use a local in-memory counter on each API server and aggregate periodically) cause stale counts and race conditions, failing real-time enforcement.Step 2: Evaluate Redis atomic increments
Redis supports atomic INCR commands ensuring consistent, real-time global counters across distributed servers.Final Answer:
Option D -> Option DQuick Check:
Redis atomic counters ensure global consistency and low latency [check]
Hint: Centralized atomic counters ensure global consistency [check]
Common Mistakes:
3. For billing in a multi-tenant SaaS platform, which architecture best supports accurate usage tracking with minimal latency impact on tenant requests?
medium
Solution
Step 1: Analyze latency and accuracy trade-offs
Synchronous updates (Synchronous billing updates on every tenant API call to the billing database) add latency; polling (Periodic polling of tenant usage logs by the billing service every hour) delays billing data; in-memory counters (Embedding billing logic directly in the tenant service to update counters in-memory) risk data loss.Step 2: Evaluate asynchronous event-driven approach
Asynchronous event-driven usage aggregation via a message queue and batch processing decouples billing from tenant requests, ensuring accurate aggregation with minimal latency impact.Final Answer:
Option A -> Option AQuick Check:
Event-driven async billing -> accurate, low-latency tenant requests [check]
Hint: Async event-driven billing decouples latency [check]
Common Mistakes:
4. At 10x scale, which component in a synchronous quorum replication system is most likely to become the bottleneck and why?
hard
Solution
Step 1: Identify synchronous quorum coordinator role
Coordinator waits synchronously for majority acks, causing latency and throughput limits.Step 2: Compare other components' scaling challenges
Storage nodes and network scale better; client-side blocking is per client, less centralized.Final Answer:
Option A -> Option AQuick Check:
Coordinator sync wait limits throughput at scale [check]
Hint: Coordinator sync wait blocks throughput first at scale [check]
Common Mistakes:
5. At 10x traffic scale, which component in a multi-CDN architecture is most likely to become the first bottleneck, and why?
hard
Solution
Step 1: Identify scaling challenges of Global Traffic Manager
It maintains real-time health and routing state for all CDNs and users, which grows with traffic scale.Step 2: Compare other components
Origin servers (A) can be scaled horizontally with caching. Edge caches (C) scale by adding nodes. Client DNS (D) caching delays but does not bottleneck traffic flow.Step 3: Conclude bottleneck
Global Traffic Manager's centralized stateful routing logic is hardest to shard and scale linearly.Final Answer:
Option D -> Option DQuick Check:
Global Traffic Manager stateful routing -> first bottleneck at 10x scale [check]
Hint: Global Traffic Manager stateful routing limits scale first [OK]
Common Mistakes:
