Practice
1. In a sliding window rate limiter, at step 3 the system records a new request timestamp. What happens internally to the stored counters at this step?
easy
Solution
Step 1: Understand sliding window counter mechanics
Sliding window counters maintain timestamps of recent requests and remove those outside the window to keep an accurate count.Step 2: At step 3, old timestamps beyond the window are purged before adding the new request timestamp
This ensures the count reflects only requests within the sliding window duration.Final Answer:
Option A -> Option AQuick Check:
Sliding window removes expired timestamps before counting new requests [check]
Hint: Sliding window purges old timestamps before counting new ones [check]
Common Mistakes:
2. A web application requires multiplexing multiple requests over a single TCP connection to reduce latency. Which HTTP version feature primarily enables this?
easy
Solution
Step 1: Identify multiplexing capability
HTTP/1.1 uses pipelining but suffers head-of-line blocking; HTTP/2 introduces multiplexing streams over a single TCP connection, allowing concurrent requests without blocking.Step 2: Eliminate other options
HTTP/3 uses UDP and multiplexing but is not the primary feature here; HTTP/1.1 with multiple TCP connections increases overhead and latency.Final Answer:
Option C -> Option CQuick Check:
HTTP/2 multiplexes streams on one TCP connection [check]
Hint: HTTP/2 multiplexes streams on one TCP connection [check]
Common Mistakes:
3. At 10x scale, which component is most likely to fail first and why?
hard
Solution
Step 1: Analyze timeline cache scaling challenges
Timeline caches hold per-user timelines; large follower counts cause exponential memory growth.Step 2: Compare other components
Relational DB (A) is mostly append-only and sharded; chat servers (B) irrelevant here; delivery workers (D) scale with Kafka partitions.Step 3: Identify first failure point
Memory pressure on timeline caches causes eviction and stale timelines first at 10x scale.Final Answer:
Option D -> Option DQuick Check:
Timeline caches hit memory limits first due to follower fan-out [check]
Hint: Timeline caches hit memory bottleneck first at scale [check]
Common Mistakes:
4. At 10x traffic scale, which component in a GeoDNS-based global traffic distribution system is most likely to fail first and why?
hard
Solution
Step 1: Identify GeoDNS scaling bottleneck
GeoDNS servers handle DNS queries globally; at 10x scale, query volume spikes, and short TTLs reduce cache hits, increasing load.Step 2: Eliminate other options
Authoritative DNS servers (A) are stateless per query. Data center load balancers (C) scale horizontally and are not the first bottleneck. Network routers (D) handle Anycast well at scale.Final Answer:
Option B -> Option BQuick Check:
GeoDNS query load spikes with limited caching cause first failure [check]
Hint: GeoDNS query load spikes first due to limited caching [check]
Common Mistakes:
5. At 10x scale, which component in a message queue system is most likely to fail first and why?
hard
Solution
Step 1: Analyze stateful components at scale
Chat servers maintain stateful WebSocket connections bound to server memory; scaling requires connection migration which is complex.Step 2: Compare other components
Database (A) and brokers (B) can be scaled horizontally with sharding and replication; producers (D) can be scaled out by adding more instances.Final Answer:
Option C -> Option CQuick Check:
Stateful WebSocket servers bottleneck scaling due to connection affinity [check]
Hint: Stateful WebSocket servers bottleneck scaling first [check]
Common Mistakes:
