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. In the video transcoding pipeline, at step 4 the Transcoding Worker checks the job queue for new tasks. What happens if the queue is empty at this step?
easy
Solution
Step 1: Understand Transcoding Worker queue interaction
Transcoding Workers typically use message brokers with blocking or long-polling to avoid busy-waiting. Immediate shutdown (A) wastes throughput. Polling with delay (B) causes unnecessary load and latency. Backup queue in DB (D) is inefficient and not standard.Step 2: Recognize blocking on broker notification
Blocking on a message broker notification (e.g., Kafka consumer poll or RabbitMQ consumer wait) is efficient and standard to wait for new tasks.Final Answer:
Option D -> Option DQuick Check:
Blocking on broker notification avoids busy polling [check]
Hint: Workers block on broker notification, not busy poll [check]
Common Mistakes:
3. For a large-scale code repository system supporting millions of users, which branching strategy best balances performance and user flexibility?
medium
Solution
Step 1: Analyze branching strategies for scale
Lightweight branch pointers referencing immutable commits allow fast branch creation and merges without locking, supporting high concurrency.Step 2: Evaluate other options
Centralized locking serializes operations, hurting performance; full branch copies waste storage and complicate merges; synchronous replication adds latency and reduces availability.Final Answer:
Option B -> Option BQuick Check:
Immutable commits + lightweight pointers -> scalable branching [check]
Hint: Immutable commits enable lightweight, scalable branches [check]
Common Mistakes:
4. For a distributed cache with frequent node additions and removals, which approach best balances load and minimizes key remapping?
medium
Solution
Step 1: Compare consistent hashing and rendezvous hashing
Both minimize remapping, but consistent hashing with virtual nodes better smooths load across nodes, especially with frequent changes.Step 2: Evaluate centralized directory and modulo hashing
Centralized directory adds latency and single point of failure; modulo hashing causes massive remapping and manual rebalancing overhead.Final Answer:
Option C -> Option CQuick Check:
Virtual nodes in consistent hashing smooth load and minimize remapping [check]
Hint: Virtual nodes smooth load in consistent hashing [check]
Common Mistakes:
5. At 10x scale, which component is most likely to fail first in a ChatGPT-like system and why?
hard
Solution
Step 1: Analyze stateful components at scale
Chat Servers maintain WebSocket connections bound to server memory, limiting horizontal scaling and resharding.Step 2: Compare other components' scalability
LLM servers (A) can be scaled with model parallelism; Kafka (C) supports partition increases with planning; Context Manager DB (D) can be sharded or cached. Stateful WebSocket binding (B) is the hardest bottleneck.Final Answer:
Option B -> Option BQuick Check:
Stateful WebSocket binding limits Chat Server scaling first [check]
Hint: Stateful WebSockets block scaling; stateless components scale easier [check]
Common Mistakes:
