Practice
1. 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:
2. For a mobile app with limited control over HTTP headers and caching proxies, which API versioning strategy is best to ensure backward compatibility and cache friendliness?
medium
Solution
Step 1: Consider mobile client and caching constraints
Mobile clients and caching proxies often ignore or strip custom headers, making header-based versioning unreliable.Step 2: Evaluate URL versioning benefits
Embedding version in URL ensures cache keys differ per version, enabling backward compatibility and cache friendliness.Final Answer:
Option A -> Option AQuick Check:
URL versioning works best with caching proxies and limited header control [check]
Hint: URL versioning beats headers for caching and mobile clients [check]
Common Mistakes:
3. If Redis becomes unavailable in a centralized rate limiting system, what is the immediate failure mode for incoming requests?
medium
Solution
Step 1: Understand Redis unavailability impact
Without Redis, the centralized counter is unreachable, so rate limiting cannot be enforced.Step 2: Check fallback behavior
Most implementations allow requests to proceed without rate limiting to avoid blocking, risking overload.Final Answer:
Option A -> Option AQuick Check:
Redis down -> no rate limiting -> requests allowed unchecked [check]
Hint: No Redis means no rate limiting, requests pass unchecked [check]
Common Mistakes:
4. For an API serving millions of users with varying traffic patterns, which rate limiting strategy best balances fairness and system protection?
medium
Solution
Step 1: Evaluate fixed window and global approaches
Global fixed window (A) causes unfairness and synchronized spikes; global leaky bucket (D) smooths but penalizes all clients equally.Step 2: Compare per-client token bucket vs fixed quota
Fixed quota (C) disallows bursts, hurting user experience; token bucket (B) allows bursts while enforcing long-term limits, balancing fairness and protection.Final Answer:
Option C -> Option CQuick Check:
Token bucket per client allows controlled bursts [check]
Hint: Token bucket per client balances bursts and fairness [check]
Common Mistakes:
5. At 10x traffic scale, which cache invalidation component is most likely to become the bottleneck first and why?
hard
Solution
Step 1: Analyze TTL expiration scalability
TTL expirations are typically handled by distributed timers or lazy expiry, scaling well.Step 2: Evaluate purge API load
Purge API handles synchronous invalidation requests; at 10x scale, request volume can overwhelm it causing delays.Step 3: Consider surrogate key store and client headers
Surrogate key stores scale with sharding; client headers affect cache hit ratio but not invalidation bottleneck.Final Answer:
Option D -> Option DQuick Check:
Purge API synchronous requests bottleneck at high scale [check]
Hint: Purge API sync invalidations bottleneck first at scale [check]
Common Mistakes:
