Practice
Solution
Step 1: Understand metadata server role in file write
The metadata server manages file metadata like inodes and directory entries, not the actual data blocks.Step 2: Trace what happens at step 3
On a write request, the metadata server updates the inode and directory metadata to reflect changes; data blocks are handled separately by storage nodes.Final Answer:
Option C -> Option CQuick Check:
Metadata server updates inode, not data blocks [check]
Solution
Step 1: Identify the need for strong coordination
Preventing double booking requires distributed synchronization to ensure only one reservation succeeds for a room at a given time.Step 2: Evaluate coordination mechanisms
Relational DB unique constraints (Use a relational database with unique constraints on room and date columns to prevent duplicates) can help but may cause high contention and deadlocks at scale. NoSQL with last-write-wins (Use an eventually consistent NoSQL store with last-write-wins conflict resolution) allows conflicts and can cause double bookings. Client-side validation (Use client-side validation to check room availability before submitting reservations) is unreliable due to race conditions. Distributed lock service (Use a distributed lock service like ZooKeeper to coordinate reservation attempts) provides strong consistency and coordination across distributed components.Final Answer:
Option A -> Option AQuick Check:
Distributed locks coordinate concurrent reservations reliably [check]
Solution
Step 1: Understand cache TTL impact
When the cache expires, the service assumes no prior usage until refreshed, allowing requests that may exceed limits.Step 2: Evaluate other options
Rejecting all requests or blocking permanently is too harsh; synchronous DB queries per request cause latency and overload.Final Answer:
Option B -> Option BQuick Check:
Expired cache -> assume zero usage -> risk over-limit [check]
Solution
Step 1: Evaluate DNS round-robin limitations
DNS round-robin (Use DNS round-robin to distribute requests evenly across data centers) lacks real-time health checks and can send traffic to unhealthy data centers, causing poor availability.Step 2: Assess global load balancer benefits
A global load balancer (Use a global load balancer with health checks and geo-routing capabilities) performs health checks and routes users to the nearest healthy data center, optimizing latency and availability.Step 3: Consider client-side and centralized load balancing drawbacks
Client-side load balancing (Use client-side load balancing with hardcoded server IPs in the client app) is hard to update and lacks global awareness. A single centralized load balancer (Use a single centralized load balancer in one data center to route all traffic) creates a single point of failure and latency bottleneck.Final Answer:
Option B -> Option BQuick Check:
Global load balancer with geo-routing optimizes latency and availability [check]
Solution
Step 1: Identify stateful components at scale
WebSocket servers maintain persistent connections bound to server memory, limiting horizontal scaling.Step 2: Compare with stateless components
Stateless API servers and load balancers scale horizontally more easily; databases fail later due to storage.Final Answer:
Option A -> Option AQuick Check:
Stateful WebSocket servers bottleneck first due to connection affinity [check]
