Practice
1. A global CDN operator needs to prevent a misconfiguration from propagating incorrect BGP routes that could cause widespread internet outages. Which component is primarily responsible for detecting and containing such route leaks?
easy
Solution
Step 1: Identify BGP route filtering role
BGP route filters and prefix limits on edge routers prevent invalid or excessive route announcements, containing route leaks.Step 2: Eliminate other options
DNS firewalls (A) do not control BGP routing; client-side validation (C) is ineffective for routing control; distributed caches (D) do not enforce routing policies.Final Answer:
Option B -> Option BQuick Check:
BGP route filters contain route leaks at the network edge [check]
Hint: Edge routers enforce BGP filters to block bad routes [check]
Common Mistakes:
2. A system requires storing user profiles with flexible schemas and frequent updates to nested attributes. Which MongoDB data modeling pattern best supports this use case?
easy
Solution
Step 1: Identify schema flexibility and update frequency
User profiles have flexible nested attributes updated frequently, favoring atomic updates.Step 2: Evaluate embedded documents pattern
Embedding nested attributes allows atomic updates within a single document, reducing complexity and latency.Final Answer:
Option A -> Option AQuick Check:
Embedded documents enable atomic nested updates [check]
Hint: Embed nested data for atomic updates in flexible schemas [OK]
Common Mistakes:
3. For a distributed cache with frequent node joins and leaves, which approach best balances minimal key remapping and low client complexity?
medium
Solution
Step 1: Evaluate centralized directory approach
Centralized directory (Use a centralized directory service to map keys to nodes) adds single point of failure and latency, increasing client complexity.Step 2: Compare consistent hashing with virtual nodes
Consistent hashing with virtual nodes and client-side caching (Use consistent hashing with virtual nodes and client-side slot caching) minimizes remapping and keeps client complexity manageable.Final Answer:
Option B -> Option BQuick Check:
Consistent hashing + virtual nodes + client caching -> minimal remap, manageable complexity [check]
Hint: Consistent hashing + virtual nodes + client caching balances remap and complexity [OK]
Common Mistakes:
4. Without Kafka in the architecture, what exactly breaks in the message delivery flow when Alice sends a message to Bob?
medium
Solution
Step 1: Understand Kafka's role in decoupling send and delivery
Kafka buffers messages asynchronously; without it, Chat Server must synchronously contact Bob's server.Step 2: Trace failure without Kafka
If Bob's server is slow or crashes, Alice's send blocks or message is lost with no retry, breaking reliability.Final Answer:
Option C -> Option CQuick Check:
No Kafka -> synchronous send blocks, message loss on Bob's crash [check]
Hint: No Kafka -> synchronous send blocks, no retry, message lost [check]
Common Mistakes:
5. At 10x scale, which component of the Snowflake ID generation system is most likely to become the bottleneck first, and why?
hard
Solution
Step 1: Analyze timestamp and network constraints
Timestamp synchronization (A) is challenging but tolerable with NTP; network coordination (D) is minimal as IDs are generated locally.Step 2: Evaluate sequence number limits
Sequence number (B) limits per millisecond can cause blocking but can be mitigated by load balancing or sharding.Step 3: Identify machine ID allocation bottleneck
Machine ID bits are fixed (e.g., 10 bits), limiting the number of unique machines. At 10x scale, running out of unique machine IDs causes collisions or requires complex reallocation.Final Answer:
Option D -> Option DQuick Check:
Fixed machine ID bits limit scale -> collisions or reconfiguration needed [check]
Hint: Fixed machine ID bits limit scale before sequence or timestamp issues [OK]
Common Mistakes:
