Decompose problems into pipelines of data transformations. Refactors loops into map/filter/reduce chains, converts nested/OO logic into composable function sequences, designs multi-step data transformation pipelines. Trigger on: "transformational programming", "data pipeline", "function pipeline", "pipe operator", "|>", "stream processing", "chained transformations", "Unix pipes", "dataflow", "decompose into steps", "write this as a pipeline", "compose functions", "chain of transformations", or restructuring imperative/OO code into data transforms. NOT for ETL infrastructure or stream processing frameworks (Kafka, Flink) — focuses on code-level function composition and transformation design patterns.
94
97%
Does it follow best practices?
Impact
85%
1.19xAverage score across 3 eval scenarios
Passed
No known issues
A smart building company collects temperature, humidity, and CO2 readings from hundreds of IoT sensors spread across multiple floors. Every hour, each sensor writes a JSON record containing its ID, floor number, sensor type, timestamp, and numeric reading. The raw data comes in as a flat list of these records — some malformed, some from sensors that went offline and sent null readings.
The analytics team needs a program that takes this raw list as input and produces a summary: for each floor, the average reading per sensor type, along with the number of valid readings and the number of records skipped due to malformed data. Right now there is no code for this — you need to design it from scratch.
Your job is to decompose this problem into a data transformation pipeline and write the implementation. Walk through the full transformation analysis before writing code: define the data flow, break down each step, then implement it. Choose whichever programming language you prefer.
Produce a single file named pipeline_analysis.md that contains your full transformation analysis and implementation. The file must include your decomposition of the problem into pipeline steps, the data flow from input to output, and working code that processes the sensor data.
Also produce a file named pipeline.py (or the equivalent for your chosen language) containing the standalone implementation, separate from the analysis document.