Practice
Solution
Step 1: Analyze mobile client constraints
Mobile clients often have intermittent connectivity and limited support for persistent streaming (gRPC streaming in Use gRPC streaming for real-time message delivery to mobile clients is unreliable on mobile). WebSockets without offline caching (Use WebSockets with server push and no offline caching) fail offline support. Polling (Use polling every few seconds to fetch new messages) adds latency and battery drain.Step 2: Evaluate REST with local storage
REST APIs combined with client-side local storage and background sync enable offline message access and eventual consistency with low latency.Final Answer:
Option C -> Option CQuick Check:
REST + local storage -> offline support and sync [check]
Solution
Step 1: Role of ZooKeeper in Kafka
ZooKeeper manages partition leadership and consumer offsets; losing it affects coordination but not immediate message loss.Step 2: Failure impact on delivery
Without ZooKeeper, offset metadata can become inconsistent, causing consumers to re-read messages and receive duplicates (C); producers may still write (B is partially true but leadership election stalls eventually); cluster does not shut down automatically (D).Final Answer:
Option C -> Option CQuick Check:
ZooKeeper loss -> offset inconsistency -> duplicate consumer messages [check]
Solution
Step 1: Analyze latency and accuracy trade-offs
Synchronous updates (Synchronous billing updates on every tenant API call to the billing database) add latency; polling (Periodic polling of tenant usage logs by the billing service every hour) delays billing data; in-memory counters (Embedding billing logic directly in the tenant service to update counters in-memory) risk data loss.Step 2: Evaluate asynchronous event-driven approach
Asynchronous event-driven usage aggregation via a message queue and batch processing decouples billing from tenant requests, ensuring accurate aggregation with minimal latency impact.Final Answer:
Option A -> Option AQuick Check:
Event-driven async billing -> accurate, low-latency tenant requests [check]
Solution
Step 1: Analyze IP masking impact
GeoDNS relying on client IP (A) fails when IPs are masked by VPNs/proxies, causing inaccurate geolocation.Step 2: Evaluate alternatives
Anycast IP routing (B) routes clients to nearest data center at network level, unaffected by IP masking. DNS latency-based routing (C) adds complexity and latency. Centralized DNS (D) is a bottleneck and not scalable.Final Answer:
Option C -> Option CQuick Check:
Anycast routes at network layer, bypassing IP masking issues [check]
Solution
Step 1: Understand DF update role
Inverted Index Update Service maintains DF counts; if it crashes, DF stops updating and becomes stale.Step 2: Trace impact on ranking
Ranking cannot rely on fresh DF; system falls back to BM25 variant that tolerates stale DF or uses approximations; queries do not error out; new documents may still be indexed but DF is outdated.Final Answer:
Option A -> Option AQuick Check:
System falls back to BM25 variant tolerating stale DF [check]
