Practice
1. A video upload service must handle millions of concurrent uploads and ensure durability before transcoding. Which component best handles temporary storage and durability of raw uploads before processing?
easy
Solution
Step 1: Identify durability and scale needs for raw uploads
Raw uploads require durable, scalable storage that can handle large binary files and high concurrency. Redis (Use an in-memory cache like Redis to store raw uploads temporarily) is in-memory and not durable for large files. Relational DBs (Store raw uploads directly in a relational database for strong consistency) are inefficient for large blobs and scale poorly. CDN edge caches (Use a CDN edge cache to hold raw uploads before transcoding) are for delivery, not upload storage.Step 2: Recognize object storage suitability
Distributed object storage like S3 provides durability, scalability, and cost-effective storage for large files, making it ideal for raw uploads before transcoding.Final Answer:
Option C -> Option CQuick Check:
Object storage ensures durable, scalable raw upload storage [check]
Hint: Object storage for durable large file uploads [check]
Common Mistakes:
2. To support personalized course recommendations at scale, should the system use a batch offline ML pipeline or a real-time streaming recommendation engine? Consider latency and update frequency constraints.
medium
Solution
Step 1: Analyze latency and update frequency constraints
Real-time streaming (Options C and D) offers low latency but may sacrifice model complexity or accuracy.Step 2: Evaluate batch offline pipeline suitability
Batch offline ML (Use batch offline ML pipeline for periodic recommendations with high accuracy) provides higher accuracy with periodic updates, suitable when real-time freshness is not critical.Final Answer:
Option D -> Option DQuick Check:
Batch offline pipeline balances accuracy and periodic updates [check]
Hint: Batch ML for accuracy, streaming for latency trade-off [OK]
Common Mistakes:
3. For job recommendation ranking, which architecture better supports real-time updates to user preferences and job postings with low latency and high throughput?
medium
Solution
Step 1: Analyze latency and throughput requirements
Real-time updates require low latency and high throughput, which batch processing (Batch processing of job and user data nightly with offline model training) and manual curation (Manual curation of job recommendations updated weekly by content teams) cannot provide.Step 2: Compare online feature store vs periodic REST calls
Online feature store with streaming pipelines (Online feature store with streaming data pipelines and real-time model scoring) supports continuous updates and real-time scoring, unlike periodic REST calls (Periodic REST API calls to external recommendation services with caching) which add latency and stale data.Final Answer:
Option B -> Option BQuick Check:
Streaming pipelines + online store -> real-time low latency [check]
Hint: Streaming pipelines enable real-time model updates [OK]
Common Mistakes:
4. Without explicitly stating your assumptions during a design interview, what failure mode is most likely to occur in your explanation?
medium
Solution
Step 1: Understand the role of stating assumptions
Explicit assumptions clarify scope and constraints, preventing misunderstandings.Step 2: Trace failure when assumptions are omitted
Without assumptions, interviewers may accept incomplete designs without challenge, missing flaws.Final Answer:
Option C -> Option CQuick Check:
Omitting assumptions leads to unchallenged flawed designs [check]
Hint: State assumptions to avoid unchallenged flawed designs [check]
Common Mistakes:
5. At 10x scale, which component in the AI Code Assistant system is most likely to fail first due to stateful connection limits, and why?
hard
Solution
Step 1: Analyze vector search scaling
Vector search scales with index size but can shard horizontally; query latency grows but not immediate failure (A incorrect).Step 2: Assess code generator scaling
GPU saturation is a bottleneck but can be mitigated by batching and autoscaling (B less immediate).Step 3: Evaluate API gateway
API gateways are stateless and horizontally scalable (C incorrect).Step 4: Identify WebSocket server bottleneck
WebSocket servers hold stateful connections bound to server memory; sharding existing connections is complex, causing first failure at 10x scale (D correct).Final Answer:
Option C -> Option CQuick Check:
Stateful WebSocket connections limit server scaling [check]
Hint: Stateful WebSocket servers bottleneck scaling first [check]
Common Mistakes:
