Practice
1. In the hotel booking system, at step 4 of the reservation flow, the Inventory Service checks room availability. What state does the Inventory Service report if the room was reserved moments ago but the Reservation Service has not yet confirmed the booking?
easy
Solution
Step 1: Trace Inventory Service state at step 4
The Inventory Service relies on confirmed reservation events to update availability. Pending reservations may not yet be reflected.Step 2: Understand event-driven state updates
Without confirmation, Inventory cannot mark the room as unavailable. It waits for Reservation Service confirmation events to update state, so availability is unknown until then.Final Answer:
Option D -> Option DQuick Check:
Inventory waits for confirmation events before updating availability [check]
Hint: Inventory updates only after confirmed reservation events [check]
Common Mistakes:
2. You must design a high-throughput OLTP system that requires strong consistency but can tolerate some delay in durability guarantees. Which approach is best suited?
medium
Solution
Step 1: Analyze consistency and durability trade-offs
Strong consistency requires strict serializable isolation; durability can be delayed to improve throughput.Step 2: Evaluate replication and isolation options
Asynchronous replication with strict serializable isolation fits the requirement, allowing durability delay without sacrificing consistency.Final Answer:
Option A -> Option AQuick Check:
Async replication + strict serializable -> strong consistency, delayed durability [check]
Hint: Strong consistency needs strict isolation, durability can lag [check]
Common Mistakes:
3. Without the segment manifest (playlist) update mechanism, what exactly breaks in the adaptive bitrate HLS streaming workflow?
medium
Solution
Step 1: Role of manifest updates in HLS
Manifest updates inform clients about new segments and available bitrates, enabling selective fetching.Step 2: Consequence of missing manifest updates
Without updates, clients cannot know which segments to fetch next, leading them to request all variants to avoid stalls, wasting bandwidth.Final Answer:
Option A -> Option AQuick Check:
Missing manifest updates cause clients to fetch all variants, wasting bandwidth [check]
Hint: No manifest updates -> clients fetch all bitrates, wasting bandwidth [check]
Common Mistakes:
4. If the distributed priority queue component fails and becomes unavailable, what is the immediate failure mode observed in the task scheduler?
medium
Solution
Step 1: Understand role of distributed priority queue
The queue is the source of truth for pending tasks; if unavailable, new tasks cannot be fetched.Step 2: Analyze failure impact
Without the queue, tasks submitted may be lost if not persisted elsewhere; workers cannot fetch tasks, so blocking (B) is unlikely if queue is down; cron scheduler (D) does not reschedule tasks automatically.Step 3: Evaluate silent drops (C)
Without queue durability, tasks may be lost silently if producers cannot enqueue or retries are not implemented.Final Answer:
Option B -> Option BQuick Check:
Queue failure causes silent task loss without retries [check]
Hint: Queue failure causes silent task loss without retries [check]
Common Mistakes:
5. At 10x traffic scale during a flash sale, which component is most likely to fail first and why?
hard
Solution
Step 1: Identify stateful components under load
API Gateway maintains user session state (e.g., WebSocket connections), which are sticky and stateful, limiting horizontal scaling.Step 2: Compare other components
Relational DB (A) can be sharded; cache (C) TTL floods are mitigated by pre-warming; inventory locking (D) is optimized with partitioning. API Gateway statefulness causes connection limits and bottlenecks first.Final Answer:
Option B -> Option BQuick Check:
API Gateway stateful sessions limit horizontal scaling [check]
Hint: Stateful API Gateway limits scaling under 10x load [check]
Common Mistakes:
