Practice
Solution
Step 1: Understand consumer offset role
The offset tracks the last consumed message; if missing, the consumer has no progress marker.Step 2: Delivery Worker behavior on missing offset
Kafka semantics dictate resetting to earliest offset to avoid message loss; skipping (A) would lose messages; blocking (C) causes deadlock; deleting partition (D) is invalid.Final Answer:
Option A -> Option AQuick Check:
Missing offset -> reset to earliest offset to ensure delivery [check]
Solution
Step 1: Identify Kafka's role in ordering and durability
Kafka partitions keyed by stock symbol ensure strict ordering per symbol and durable storage of orders before matching.Step 2: Eliminate other options
Redis lacks durability guarantees; relational DB with global sequence is a bottleneck at scale; RabbitMQ without partitioning cannot guarantee ordering per symbol.Final Answer:
Option A -> Option AQuick Check:
Kafka partition keyed by symbol -> ordering + durability guaranteed [check]
Solution
Step 1: Understand Quadtree traversal
At step 4, the Quadtree recursively visits nodes overlapping the bounding box to efficiently narrow down candidate locations.Step 2: Eliminate other options
It returns all businesses within the bounding box without further filtering is incorrect because Quadtree does filtering, not a full scan. It converts the bounding box into Geohash prefixes and queries a key-value store describes Geohash usage, not Quadtree. It sends the bounding box to a full-text search engine for keyword filtering is unrelated to spatial indexing.Final Answer:
Option C -> Option CQuick Check:
Quadtree recursively traverses nodes intersecting query box [check]
Solution
Step 1: Trace Request Handler token check at Step 4
If the token bucket is empty, no tokens are available to allow immediate processing.Step 2: Determine request fate
The request must be rejected or delayed until tokens refill; processing without tokens violates rate limits.Final Answer:
Option C -> Option CQuick Check:
Empty bucket -> reject or delay request [check]
Solution
Step 1: Evaluate origin scaling and latency challenges
Auto-scaling origin servers reduce load but cannot eliminate latency for distant users.Step 2: Assess CDN edge caching benefits
CDN caches content near users, drastically reducing latency and origin load under heavy traffic.Final Answer:
Option A -> Option AQuick Check:
CDN edge caching best reduces latency and origin load globally [check]
