A downstream service slows from 100ms to 2 seconds
A medium Pipeline Design interview practice problem on DataDriven. Write and execute real pipeline design code with instant grading.
- Domain
- Pipeline Design
- Difficulty
- medium
Problem
A downstream service slows from 100ms to 2 seconds. The pipeline's worker queue (currently unbounded) accepts every put() instantly. Memory grows without limit. The producer crashes when memory exhausts; the producer's upstream begins to fill its own queue, and the failure cascades backward. The section's mitigation: every queue between two components has a maximum size, and when full the producer blocks (backpressure). Load-shedding is a complement when blocking is unacceptable. Apply backpressure by renaming the unbounded queue to one with maxsize and blocking semantics, and add a load-shedding policy on the source side.
Practice This Problem
Solve this Pipeline Design problem with real code execution. DataDriven runs your solution and grades it automatically.