Thanks to visit codestin.com
Credit goes to github.com

Skip to content

nvsahana/BuildChallenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Challenge - Python Implementation

This repository contains implementations of two programming assignments demonstrating concurrent programming and data analysis.

Project Structure

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

Requirements

  • Python 3.7+
  • All dependencies are from Python standard library (no external packages required)
  • See requirements.txt for details

Setup

  1. Clone the repository:
git clone https://github.com/nvsahana/BuildChallenge.git
cd BuildChallenge
  1. Run all tests:
chmod +x setup.sh
./setup.sh
  1. Or run the interactive demo:
python3 demo.py

Assignment 1: Producer-Consumer Pattern

Implements 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.py

Assignment 2: Sales Analysis

Performs 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.py

Sample Output

Assignment 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)

Author

Sahana NV

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors