Practice
1. A system must enforce a maximum number of API calls per user per minute to prevent abuse. Which component in an API Gateway architecture is best suited to handle this requirement?
easy
Solution
Step 1: Identify rate limiting responsibility
The API Gateway is the entry point and can efficiently enforce rate limits before requests reach backend services, preventing overload.Step 2: Eliminate other options
The backend microservices implement rate limiting individually to distribute load spreads rate limiting, risking inconsistent enforcement and backend overload. A centralized database tracks request counts and enforces limits synchronously adds latency and complexity by synchronous DB checks. Clients are responsible for self-throttling their request rates trusts clients, which is insecure.Final Answer:
Option A -> Option AQuick Check:
API Gateway enforces rate limits upfront to protect backend [check]
Hint: Rate limiting belongs at the gateway entry point [check]
Common Mistakes:
2. In the request flow for delivering an HLS video segment, at step 4 the Delivery Worker checks the cache status of the requested segment. What happens if the segment is not found in the edge cache at this step?
easy
Solution
Step 1: Trace Delivery Worker decision at Step 4 -- cache miss handling
On cache miss, the Delivery Worker does not immediately fetch from origin but queues the request and waits for the segment to be fetched asynchronously.Step 2: Eliminate other options
Immediate 404 is incorrect as segments may be fetched; redirecting client is inefficient; immediate fetch blocks delivery worker, violating async design.Final Answer:
Option A -> Option AQuick Check:
Delivery Worker waits for segment availability before responding [check]
Hint: Cache miss triggers async fetch; delivery waits, no immediate fetch [check]
Common Mistakes:
3. If the commit metadata database becomes unavailable, what is the immediate failure observed when a user tries to create a new branch?
medium
Solution
Step 1: Understand role of commit metadata DB
Commit metadata DB stores branch pointers; without it, server cannot persist new branches.Step 2: Trace branch creation failure
Client may create branch locally, but server cannot persist it, so branch is effectively lost or inconsistent.Step 3: Eliminate other options
Queuing without notification hides failure; immediate error is possible but not typical if client allows local ops; marking unverified branches requires metadata DB access.Final Answer:
Option D -> Option DQuick Check:
Metadata DB down -> branch created locally but not persisted [check]
Hint: Metadata DB down -> local branch only, no server persistence [check]
Common Mistakes:
4. For real-time analytics requiring low-latency dashboards and complex ad-hoc queries, which architecture is best suited?
medium
Solution
Step 1: Evaluate streaming aggregation and query needs
Flink excels at complex streaming aggregations; OLAP stores support fast ad-hoc queries and low-latency dashboards.Step 2: Eliminate other options
Kafka Streams lacks complex query capabilities; batch ETL adds latency unsuitable for real-time; NoSQL key-value stores lack rich query support for dashboards.Final Answer:
Option D -> Option DQuick Check:
Flink + OLAP store balances streaming and query complexity [check]
Hint: Flink streams, OLAP queries for real-time + ad-hoc [check]
Common Mistakes:
5. If the cache invalidation mechanism for the Trie shards fails, what is the most likely failure observed in the typeahead suggestions?
medium
Solution
Step 1: Understand cache invalidation role
Cache invalidation ensures Trie shards reflect recent data; failure means stale data remains served.Step 2: Analyze failure impact
Memory overflow (B) or empty suggestions (C) are unrelated to invalidation failure; personalization ranking (D) is separate from cache invalidation.Final Answer:
Option A -> Option AQuick Check:
Failed invalidation -> stale suggestions served [check]
Hint: Failed cache invalidation -> stale suggestions served [check]
Common Mistakes:
