Practice
1. A webhook delivery system must guarantee ordered delivery of events per subscriber, even under retries and failures. Which component is best suited to enforce per-subscriber ordering?
easy
Solution
Step 1: Identify ordering guarantee mechanism
Kafka partitions keyed by subscriber ID ensure all events for that subscriber go to the same partition, preserving order.Step 2: Eliminate other options
Redis cache lacks strong ordering guarantees under retries; relational DB global sequence causes contention and latency; load balancer routing alone doesn't guarantee ordering without stateful processing.Final Answer:
Option A -> Option AQuick Check:
Kafka partition key -> per-subscriber ordering guaranteed [check]
Hint: Partition by subscriber ID for ordering [check]
Common Mistakes:
2. A video streaming service needs to deliver personalized movie recommendations to millions of users with low latency. Which component is best suited to handle the real-time personalization computation at scale?
easy
Solution
Step 1: Identify personalization latency requirements
Real-time personalization requires low latency responses, which batch processing (A batch processing system that recomputes recommendations once per day) cannot provide.Step 2: Evaluate component suitability
Relational DB (A relational database with complex SQL queries for each user request) is too slow for per-request complex queries at scale. CDN edge servers (A CDN edge server that directly computes recommendations on user devices) lack the data and compute power for personalization. Distributed in-memory cache (A distributed in-memory cache with precomputed user profiles updated asynchronously) supports fast lookups with asynchronously updated profiles, fitting the latency and scale needs.Final Answer:
Option A -> Option AQuick Check:
In-memory cache with async updates enables low-latency personalization [check]
Hint: Precompute profiles in cache for fast personalization [check]
Common Mistakes:
3. In a microservices architecture, a client request flows through API Gateway -> Auth Service -> Order Service -> Inventory Service. At step 3, the Order Service calls Inventory Service synchronously. What happens if Inventory Service is slow at step 3?
easy
Solution
Step 1: Trace synchronous call behavior at step 3
Order Service calls Inventory Service synchronously, so it waits for response before replying to client.Step 2: Analyze impact of slow Inventory Service
Because of synchronous call, client request blocks until Inventory Service responds or times out; no immediate return or retries happen automatically.Final Answer:
Option D -> Option DQuick Check:
Synchronous calls block caller until response or timeout [check]
Hint: Synchronous calls block caller until response or timeout [check]
Common Mistakes:
4. At 10x scale, which component of a distributed Count-Min Sketch system is most likely to fail first and why?
hard
Solution
Step 1: Identify bottleneck in distributed updates
Centralized coordinator serializes updates to maintain consistency, limiting throughput.Step 2: Analyze other components
Network bandwidth and hash function speed scale better; sketch arrays have fixed size but don't overflow.Step 3: Understand scale impact
At 10x scale, coordinator becomes overwhelmed, causing update latency and failures.Final Answer:
Option D -> Option DQuick Check:
Central coordinator serialization bottlenecks updates at scale [check]
Hint: Central coordinator serializes updates, bottlenecking at scale [check]
Common Mistakes:
5. At 10x transaction volume, which component in the digital wallet system is most likely to become the first bottleneck, and why?
hard
Solution
Step 1: Analyze ledger database constraints
Ledger DB enforces strong consistency and atomic double-entry transactions, limiting sharding options.Step 2: Compare other components
Reconciliation (A) can be scaled asynchronously; API gateway (C) can be scaled with stateless design; Kafka (D) scales with partitioning but ledger DB consistency is harder to scale.Final Answer:
Option D -> Option DQuick Check:
Ledger DB consistency limits sharding -> first bottleneck [check]
Hint: Ledger DB consistency limits sharding -> first bottleneck [OK]
Common Mistakes:
