This repository contains implementations of two programming assignments demonstrating concurrent programming and data analysis.
BuildChallenge/
├── assignment-1/
│ ├── producer_consumer.py
│ └── main_test_producer_consumer.py
├── assignment-2/
│ ├── sales_analysis.py
│ └── main_test_sales_analysis.py
├── data/
│ └── sales_data.csv
├── demo.py
├── setup.sh
├── requirements.txt
└── README.md
- Python 3.7+
- All dependencies are from Python standard library (no external packages required)
- See
requirements.txtfor details
- Clone the repository:
git clone https://github.com/nvsahana/BuildChallenge.git
cd BuildChallenge- Run all tests:
chmod +x setup.sh
./setup.sh- Or run the interactive demo:
python3 demo.pyImplements thread synchronization with:
- Blocking queue with condition variables
- Wait/notify mechanism
- Producer and Consumer threads
- Poison pill shutdown
Run tests:
cd assignment-1
python3 main_test_producer_consumer.pyPerforms data analysis using:
- Lambda expressions and map()
- Stream operations
- Functional grouping with groupby()
- Aggregate functions (sum, min, max, avg)
Run tests:
cd assignment-2
python3 main_test_sales_analysis.pyAssignment 1: 3 tests (simple, large dataset, empty source)
Ran 3 tests in 1.278s - OK
Assignment 2: 6 tests (all aggregation methods)
Ran 6 tests in 0.001s - OK
Total Units: 213
Total Revenue: $5,685.00
Most Sold Item: Socks
Average Price: $37.40
Price Range: $5.00 - $80.00
Revenue by Region: East ($1,545), North ($1,210), South ($1,305), West ($1,625)
Sahana NV