How antoniocas997/entrevista_tecnica works
1. Repo purpose
- This repository is an interview exercise for building an offline data-processing pipeline from two CSV inputs: energy measurements and alarm events.
- The repo is currently very small: it contains the README, and the raw inputs in /data. No source code is present yet.
2. Main inputs
- /data/energia.csv is the numerical time-series source for energy and power.
- /data/Alarmas.csv is the event source for device alarms.
- These files are the only upstream systems; there are no APIs, queues, or external services implied by the repo.
3. Energy-processing subsystem
- The energy flow reads energia.csv, filters the target period around 2026-03-16 through before 2026-03-22/23 as specified, and produces a daily view.
- The key business split is by asset category:
- Total
- Refrigeración
- Aire acondicionado
- Iluminación
- Otros, computed as Total - Refrigeración - Aire acondicionado - Iluminación
- This is the main transformation boundary: raw readings in, daily aggregated metrics out.
4. Aggregation model
- The README asks for “consumo total diario por activo,” which means the pipeline must normalize timestamped measurements into day-level aggregates.
- The architecture should treat “daily aggregation” as a distinct stage between ingestion and reporting.
5. Visualization subsystem
- A chart is required for the same energy period, showing the behavior of power over time per asset.
- This is a separate presentation layer from the table output: it consumes the processed energy dataset and renders a time-series plot, likely saved as an artifact rather than served interactively.
6. SQLite persistence subsystem
- Processed data must be stored in SQLite, which makes the solution a local, file-backed analytics pipeline.
- The database is not the source of truth; it is a persistence/reporting layer for the transformed data.
- The required view combines:
- the main period from 2026-03-16 inclusive to before 2026-03-23
- a comparison window one week earlier
- That means the DB layer needs to support both the primary analysis window and a historical comparison slice.
7. Alarm-processing subsystem
- Alarmas.csv is processed independently from energy data.
- The first step is extracting the unique values of Advisory Message.
- The second step is grouping by controller/source (Source) and counting alarm types based on those unique advisory messages.
- This subsystem is event-oriented rather than numeric time-series processing.
8. Functional boundaries
- The repository’s architecture naturally splits into three pipelines:
- Energy ingestion + aggregation + charting
- Energy persistence + SQLite view creation
- Alarm ingestion + uniqueness extraction + per-controller counts
- These should be separate functions/modules because they operate on different schemas and outputs.
9. Cross-cutting concerns
- The README explicitly requires:
- code structured in functions
- error handling
- documentation
- So the solution should include input validation, date parsing robustness, and graceful handling of malformed CSVs or missing columns.
10. Expected outputs / artifacts
- The deliverables implied by the repo are:
- source code
- auxiliary scripts
- generated SQLite database
- README with execution instructions
- likely a tabular report and a saved chart artifact
- There is no indication of deployment or runtime infrastructure beyond local execution.
11. Suggested architectural diagram perspective
- For an accurate diagram, show a single batch-processing entry point reading from the two CSV files, branching into:
- an energy analytics path
- an alarms analytics path
- Both paths are local and deterministic, with the energy path additionally writing to SQLite and producing a visualization.
12. Current repo maturity
- At present, the repository is mostly a specification plus data bundle rather than a completed system.
- The architecture is therefore defined by the README requirements more than by implemented code.
Main entry points: README.md README · energia.csv Energy CSV · Alarmas.csv Alarm CSV
Components 16
Inputs
Raw local CSV sources bundled with the repository.
- README · Repository requirements and execution guidance.
README.md - Energy CSV · Numerical energy and power measurements.
data/energia.csv - Alarm CSV · Alarm events with advisory messages and source controllers.
data/Alarmas.csv
Energy pipeline
Batch flow for time-series energy processing, aggregation, storage, and charting.
- Batch entry · Single local execution entry point coordinating both pipelines.
- Energy ingest · Loads and validates energy records, including date parsing and schema checks.
- Period filter · Selects the target analysis window around 2026-03-16 through before 2026-03-23.
- Daily aggregate · Normalizes timestamped readings into day-level consumption and power summaries.
- Asset split · Computes Total, Refrigeración, Aire acondicionado, Iluminación, and Otros.
- SQLite store · Writes processed energy data to local SQLite for reporting and comparison windows.
Alarm pipeline
Batch flow for alarm event extraction and grouping.
- Alarm ingest · Loads alarm rows and validates required columns.
- Unique messages · Extracts distinct Advisory Message values.
- Source counts · Groups by Source and counts alarm types from unique advisory messages.
Outputs
Local analytical artifacts produced by the pipeline.
- Power chart · Renders time-series behavior of power over time per asset.
- Daily report · Produces the required daily consumption view for the main and comparison periods.
- Alarm summary · Local summary of unique messages and per-controller alarm counts.
- Instructions · Execution notes, error handling expectations, and usage guidance.
README.md
Connections 15
- README → Batch entry: defines · The README specifies the batch workflow.
- Energy CSV → Energy ingest: input · Raw energy measurements feed ingestion.
- Alarm CSV → Alarm ingest: input · Raw alarm events feed ingestion.
- Batch entry → Energy ingest: runs · The batch entry point starts the energy pipeline.
- Batch entry → Alarm ingest: runs · The batch entry point starts the alarm pipeline.
- Energy ingest → Period filter: cleaned data · Validated energy rows are filtered to the target window.
- Period filter → Daily aggregate: windowed data · Filtered readings are aggregated by day.
- Daily aggregate → Asset split: metrics · Daily metrics are split into business asset categories.
- Asset split → SQLite store: persist · Processed energy results are stored in SQLite.
- SQLite store → Daily report: query · The database supports the main and comparison reporting slices.
- Asset split → Power chart: render · Processed energy series are visualized as a chart.
- Alarm ingest → Unique messages: extract · Alarm rows are reduced to distinct advisory messages.
- Unique messages → Source counts: group · Unique messages are counted by source/controller.
- Source counts → Alarm summary: publish · Alarm analytics are emitted as a summary report.
- Batch entry → Instructions: supports · Documentation and error handling expectations wrap the batch flow.