Practice
1. A distributed API rate limiter must enforce limits with minimal latency at the network edge. Which component is best suited to perform this enforcement?
easy
Solution
Step 1: Identify edge enforcement needs
Enforcement must be low-latency and close to the client to avoid network round trips.Step 2: Evaluate options for latency and consistency
Centralized DB (A) adds latency; batch jobs (C) are too delayed; client SDK (D) is untrustworthy. Edge cache with local counters (B) balances latency and eventual consistency.Final Answer:
Option B -> Option BQuick Check:
Edge cache enforces limits locally with periodic sync [check]
Hint: Enforce limits close to client with local counters [check]
Common Mistakes:
2. In the Pastebin system request flow, at Step 4 the Expiration Worker scans stored snippets to remove expired entries. What state does the worker observe for a snippet whose TTL just expired but is still being accessed by a user?
easy
Solution
Step 1: Trace Expiration Worker behavior at Step 4
The worker deletes expired snippets in batches; deletion is not instantaneous upon TTL expiry.Step 2: Understand user access during deletion
Until deletion completes, the snippet remains accessible; no locking or blocking occurs.Final Answer:
Option B -> Option BQuick Check:
Batch deletion delays snippet removal, keeping it accessible briefly [check]
Hint: Expiration deletion is batch-based, not instant [check]
Common Mistakes:
3. If the Progress Worker crashes before persisting a user's video watch progress, what is the exact failure observed by the user when they resume the course?
medium
Solution
Step 1: Trace failure impact of Progress Worker crash
Progress Worker crash before persistence means recent watch time is lost.Step 2: Evaluate user experience on resume
System detects missing progress update and returns error preventing continuation (User receives an error message preventing course continuation until retry), rather than silently resetting or duplicating progress.Final Answer:
Option C -> Option CQuick Check:
Crash causes error blocking course continuation until retry [check]
Hint: Crash blocks progress update, user sees error [OK]
Common Mistakes:
4. If the random payload generation step in KSUID is removed, what exactly breaks in the system's ID generation?
medium
Solution
Step 1: Understand role of random payload in KSUID
The random payload ensures uniqueness among IDs generated at the same timestamp across nodes.Step 2: Analyze consequences of removing random payload
Without random payload, IDs generated at the same timestamp collide, causing duplicates and predictability; timestamp remains, so sortability is intact (A false); length and encoding unchanged (C and D false).Final Answer:
Option B -> Option BQuick Check:
Random payload prevents collisions at identical timestamps [check]
Hint: Random payload prevents collisions at same timestamp [check]
Common Mistakes:
5. At 10x scale, which component in a time-series database system is most likely to fail first and why?
hard
Solution
Step 1: Identify bottlenecks at 10x scale
High write volume increases partition count and complexity of partition coordination.Step 2: Evaluate component scalability
Query engine (A) slows but can be scaled horizontally. Storage nodes (C) face I/O limits but can add disks. Metadata service (D) scales better with caching. Partition coordinator (B) faces coordination overhead and metadata contention, causing first failure.Final Answer:
Option C -> Option CQuick Check:
Partition coordinator overhead grows fastest at scale [check]
Hint: Partition coordination overhead grows fastest at scale [check]
Common Mistakes:
