Practice
Solution
Step 1: Identify query pattern
Friend-of-friend queries require efficient traversal of relationships, which relational JOINs or document stores handle poorly at scale.Step 2: Match technology to pattern
Graph databases optimize relationship traversal with index-free adjacency, enabling low-latency queries on connected data.Final Answer:
Option C -> Option CQuick Check:
Graph DBs excel at relationship traversal, unlike wide-column or document stores [check]
Solution
Step 1: Understand latency percentiles
P99 latency captures the latency below which 99% of requests complete, highlighting the slowest 1% tail.Step 2: Why average and median fail
Average latency can be skewed by outliers but doesn't reflect tail latency; median (P50) only shows the middle, missing slow requests; maximum latency is noisy and not stable.Final Answer:
Option A -> Option AQuick Check:
P99 latency highlights slowest 1% requests, not average or median [OK]
Solution
Step 1: Trace failure impact of authentication service crash
Without the authentication service, the gateway cannot verify credentials and may default to allowing requests through if no fail-closed mechanism is implemented.Step 2: Evaluate other options
Clients receive a 500 Internal Server Error due to gateway crash is unlikely as gateway remains up. Clients receive a 401 Unauthorized response because authentication cannot be verified requires fail-closed design, which is not always implemented. Requests queue indefinitely at the gateway until authentication service recovers causes indefinite blocking, which is rare.Final Answer:
Option C -> Option CQuick Check:
Auth service down -> requests pass unverified if no fail-closed [check]
Solution
Step 1: Analyze replication under network partitions
Synchronous replication blocks writes on slow or unreachable replicas, hurting availability.Step 2: Asynchronous replication tolerates partitions
Allows writes to proceed locally and replicates changes later, favoring availability over immediate consistency.Final Answer:
Option A -> Option AQuick Check:
Async replication favors availability during partitions [check]
Solution
Step 1: Role of message broker
Broker decouples sender and receiver, enabling asynchronous delivery and retries.Step 2: Consequence of missing broker
Without it, messages are sent synchronously causing sender blocking; if receiver crashes, messages are lost; encryption (A) unaffected; blocking and loss (C) is exact failure; batch mode (D) not automatic.Final Answer:
Option A -> Option AQuick Check:
Broker removal causes blocking sends and message loss on receiver failure [check]
