Practice
Solution
Step 1: Identify nested data fetching needs
REST typically requires multiple calls or over-fetching to get nested data, causing inefficiency.Step 2: Recognize GraphQL's single query nested fetch
GraphQL allows clients to specify nested fields in one request, reducing round-trips and over-fetching.Final Answer:
Option A -> Option AQuick Check:
GraphQL single query fetches nested data efficiently [check]
Solution
Step 1: Analyze centralized vs distributed scheduling
Centralized Scheduler becomes a bottleneck at scale; distributed sharding allows parallelism and localized politeness enforcement.Step 2: Evaluate other options
Independent crawlers without shared politeness risk domain overload; single-threaded crawler can't scale to millions of domains.Final Answer:
Option B -> Option BQuick Check:
Distributed sharding enables scalable politeness enforcement [check]
Solution
Step 1: Understand sliding window cleanup role
Cleanup removes timestamps outside the window; failure causes stale timestamps to accumulate.Step 2: Accumulated stale timestamps inflate request counts, causing the rate limiter to block legitimate requests indefinitely
This leads to false positives in rate limiting, denying service unnecessarily.Final Answer:
Option C -> Option CQuick Check:
Failed cleanup -> stale timestamps inflate counts -> requests blocked indefinitely [check]
Solution
Step 1: Evaluate centralized generator with sync replication
This causes high latency and single point of failure, unsuitable for geo-distributed low-latency needs.Step 2: Assess decentralized Snowflake approach
Decentralized generators with node IDs and loosely synchronized clocks provide low latency and uniqueness with approximate ordering.Step 3: Consider UUID v4 and DB auto-increment
UUID v4 lacks ordering; DB auto-increment with partitioning risks collisions and coordination overhead.Final Answer:
Option B -> Option BQuick Check:
Decentralized Snowflake -> low latency + uniqueness + approximate ordering [check]
Solution
Step 1: Analyze scale impact on components
Global aggregator (A) merges asynchronously, so less likely bottleneck. Replication overhead (C) grows but can be optimized. Client counters (D) can compact state.Step 2: Identify shard replicas failure mode
At 10x scale, network partitions increase, causing shards to diverge permanently without reconciliation, breaking eventual consistency.Final Answer:
Option A -> Option AQuick Check:
Network partitions cause shard divergence first at scale [check]
