Pipes-and-Filters Pattern Quiz

Q1. A team proposes adding data transformation logic into the pipe connecting two filters to lighten the filters’ workload. According to the pipes-and-filters pattern, what is the proper assignment of responsibilities?




Q2. You are designing two pipelines: one for real-time sensor events (streaming) and another for daily log files (batch). What key difference in execution should you consider for a streaming pipeline versus a batch pipeline?




Q3. In one project, an entire sequence of processing steps was implemented inside a single filter stage, rather than as separate filters. Which outcome is most likely with this “mega-filter” approach?




Q4. A certain filter was changed to maintain a running aggregate of data (becoming stateful), whereas other filters in the pipeline remain stateless. What is a trade-off of introducing this stateful filter stage?




Q5. Midway through development, the team needs to add a new validation step between two existing filters in a pipeline. If the pipes-and-filters architecture has been followed properly, how difficult is it to insert this new filter?




Q6. One pipeline design uses a push model (upstream elements send data as fast as possible), while another uses a pull model (downstream elements request data when ready). The push-based pipeline sometimes overwhelms a slow filter with too many messages. What mechanism would best prevent the fast producer from flooding the slower consumer?




Q7. A malformed input record causes a filter to throw an exception every time it’s processed, blocking the pipeline as it repeatedly retries and fails on this “poison pill” message. What is a robust handling strategy for such a scenario?




Q8. After deploying a pipeline, the team sees that throughput is low and latency is high. They have metrics for total end-to-end processing time but can’t identify which stage is the bottleneck. What should they do to pinpoint the slow filter?




Q9. Filter Y in a pipeline expects data in a very specific format produced by Filter X. When Filter X’s output format changed slightly, Filter Y broke, causing a cascade of fixes. What pipeline anti-pattern does this situation represent?




Q10. One stage of a pipeline sends out email notifications for each input event. During a failure and restart, some events may be processed twice, raising the risk of duplicate emails being sent to users. How can the design prevent duplicates without losing emails?




Q11. In an image-processing pipeline, a filter that resizes images is significantly slower than other filters, creating a throughput bottleneck. The system needs to handle a high volume of images per second. What is the best way to scale this stage and alleviate the bottleneck?




Q12. A pipeline contains a sequence of ten very lightweight filters, each performing a simple transformation. Profiling shows that the pipeline spends more time handing off data between filters than doing actual work. How can you improve performance without changing the core logic of each filter?




Q13. In a long-running stream processing pipeline, if one filter crashes mid-processing, the entire pipeline currently has to be restarted from the beginning of the data stream. What design improvement would allow the pipeline to resume work closer to where it left off after a failure?




Q14. A financial transactions pipeline requires exactly-once processing semantics – each transaction must be applied only once even if failures or retries occur. Which approach best achieves an end-to-end exactly-once guarantee in a pipes-and-filters architecture?




Q15. The team refactors the pipeline so that each filter runs as a separate microservice on the network, with pipes implemented as messaging between services. What new challenges might this distributed pipes-and-filters implementation introduce compared to an in-process pipeline?




software-architecture