Interview Questions/Technical Deep Dive/Designing Backpressure in Reactive Systems
AdvancedTechnical
5 min

Designing Backpressure in Reactive Systems

Reactive SystemsReliabilityPerformance
Advertisement
Interview Question

In a streaming system under bursty load, how do you implement backpressure to prevent overload and cascading failures?

Key Points to Cover
  • Use bounded queues and demand-driven pull (Reactive Streams semantics)
  • Apply rate limiting, token buckets, and priority queues
  • Shed load gracefully and return retry hints
  • Instrument queue depths and processing latencies
Evaluation Rubric
Explains backpressure mechanisms clearly35% weight
Covers load shedding/graceful degradation25% weight
Monitors backlogs and latencies20% weight
Prevents cascades across services20% weight
Hints
  • 💡Think demand propagation and bounded resources.
Common Pitfalls to Avoid
  • ⚠️Ignoring or poorly implementing Reactive Streams publisher/subscriber contracts.
  • ⚠️Using unbounded queues, which defer the problem and lead to OutOfMemory errors.
  • ⚠️Lack of clear differentiation and prioritization for different data streams.
  • ⚠️Aggressive or poorly designed load shedding that causes data loss without proper client notification.
  • ⚠️Failure to implement intelligent retry mechanisms, leading to client starvation or re-triggering of overload.
Potential Follow-up Questions
  • How to test backpressure behaviors?
  • What about priority inversion risks?
Advertisement