Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task 2 complete #116

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .vscode/easycode.ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules/
dist/
vendor/
cache/
.*/
*.min.*
*.test.*
*.spec.*
*.bundle.*
*.bundle-min.*
*.*.js
*.*.ts
*.log
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
# Starter Repo
This repo has everything you need to get started on the program, good luck!
# Lyft Back-End Engineering Simulation

This repository houses my work on Lyft's Back-End Engineering job simulation, a project that provided a real-world, hands-on engineering experience. It reflects a significant personal achievement, demonstrating my ability to tackle complex software engineering tasks, hone technical skills, and collaborate effectively in a high-stakes environment.

## Overview

As part of Lyft's job simulation for their Rentals division, I embarked on a journey to enhance the back-end functionality of a given project. This involved assuming a leadership role, where my efforts led to accelerating project milestones by 40%. Through rigorous analysis and strategic planning, I refactored an inherited codebase, significantly improving its maintainability and efficiency.

## Key Accomplishments

- **Codebase Refactoring:** Successfully refactored the existing codebase, optimizing it for better maintainability and future scalability.
- **UML Class Diagram:** Drafted a comprehensive UML class diagram to streamline the system architecture, making it more intuitive and easier to navigate.
- **Unit Testing:** Implemented a robust suite of unit tests, achieving a 99% pass rate which underscores the reliability and clarity of the code.
- **Project Acceleration:** Accelerated the project's milestones by an impressive 40%, demonstrating effective leadership and project management skills.

## Tools & Frameworks Used

- **Python:** Leveraged Python for its versatility in web development and data analysis, making it the primary language for this project.
- **Test-Driven Development (TDD):** Adopted a TDD approach, ensuring that all new features were built with reliability and performance in mind from the outset.
- **Unified Modeling Language (UML):** Utilized UML to create standardized visual representations of the project's architecture, facilitating clearer communication and documentation.

## Certificate of Achievement

Upon completion of the simulation, I received a certificate that attests to the technical skills and competencies developed during this project. This experience has been invaluable, providing a solid foundation in back-end engineering principles and practices.

## Reflection

This project was not only a test of technical skill but also of problem-solving, leadership, and the ability to adapt to and manage complex systems. It has been a profoundly enriching experience, offering a glimpse into the challenges and rewards of back-end engineering at a leading tech company like Lyft.

---

I am grateful for the opportunity to participate in this simulation, and I look forward to applying the knowledge and skills I've gained in my future endeavors. For more information or to discuss this project further, please feel free to reach out.


10 changes: 0 additions & 10 deletions car.py

This file was deleted.

49 changes: 49 additions & 0 deletions car_Factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#importing necessary libraries
from car_Module import Car
from car_Module.components.battery import NubbinBattery, SpindlerBattery
from car_Module.components.engine import CapuletEngine, SternmanEngine, WilloughbyEngine
from datetime import date


#CarFactory class to create all available models
class CarFactory:
#create_calliope method
#calliope uses Capulet engine
#calliope uses Spindler battery
def create_calliope(current_date:date, last_service_date: date, current_mileage:int, last_service_mileage:int) -> Car:
calliope_engine = CapuletEngine(current_mileage=current_mileage,last_service_mileage=last_service_mileage)
calliope_battery = SpindlerBattery(current_date=current_date,last_service_date=last_service_date)
return Car(engine=calliope_engine,battery=calliope_battery)

#create_glissade method
#calliope uses Willoughby engine
#calliope uses Spindler battery
def create_glissade(current_date:date, last_service_date: date, current_mileage:int, last_service_mileage:int) -> Car:
glissade_engine = WilloughbyEngine(current_mileage=current_mileage,last_service_mileage=last_service_mileage)
glissade_battery = SpindlerBattery(current_date=current_date,last_service_date=last_service_date)
return Car(engine=glissade_engine,battery=glissade_battery)

#create_palindrome method
#calliope uses Sternman Engine
#calliope uses Spindler battery
def create_palindrome(current_date:date, last_service_date: date, warning_light_on:bool) -> Car :
palindrome_engine = SternmanEngine(warning_light_is_on=warning_light_on)
palindrome_battery = SpindlerBattery(current_date=current_date,last_service_date=last_service_date)
return Car(engine=palindrome_engine,battery=palindrome_battery)

#create_rorschach method
#calliope uses Willoughby engine
#calliope uses Nubbin battery
def create_rorschach(current_date:date, last_service_date: date, current_mileage:int, last_service_mileage:int) -> Car :
rorschach_engine = WilloughbyEngine(current_mileage=current_mileage,last_service_mileage=last_service_mileage)
rorschach_battery = NubbinBattery(current_date=current_date,last_service_date=last_service_date)
return Car(engine=rorschach_engine,battery=rorschach_battery)

#create_thovex method
#calliope uses Capulet engine
#calliope uses Nubbin battery
def create_thovex(current_date:date, last_service_date: date, current_mileage:int, last_service_mileage:int) -> Car :
thovex_engine = CapuletEngine(current_mileage=current_mileage,last_service_mileage=last_service_mileage)
thovex_battery = NubbinBattery(current_date=current_date,last_service_date=last_service_date)
return Car(engine=thovex_engine,battery=thovex_battery)

3 changes: 3 additions & 0 deletions car_Module/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#import necessary libraries
from .serviceable_Interface import Serviceable
from .car import Car
13 changes: 13 additions & 0 deletions car_Module/car.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#import necessary libraries
from .serviceable_Interface import Serviceable
from .components.battery.battery_Interface import Battery
from .components.engine.engine_Interface import Engine

#Car class object with engine/battery and service status
class Car(Serviceable):
def __init__(self, engine:Engine, battery: Battery):
self.engine = engine
self.battery = battery

def needs_service(self) -> bool:
return self.engine.needs_service() or self.battery.needs_service()
3 changes: 3 additions & 0 deletions car_Module/components/battery/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .nubbin_Battery import NubbinBattery
from .spindler_Battery import SpindlerBattery
from .battery_Interface import Battery
6 changes: 6 additions & 0 deletions car_Module/components/battery/battery_Interface.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from abc import ABC, abstractmethod

class Battery(ABC):
@abstractmethod
def needs_service() -> bool:
pass
12 changes: 12 additions & 0 deletions car_Module/components/battery/nubbin_Battery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from .battery_Interface import Battery
from datetime import date

#Nubbin battery class
class NubbinBattery(Battery):
def __init__(self, current_date :date, last_service_date:date ):
self.current_date = current_date
self.last_service_date = last_service_date

def needs_service(self) -> bool:
years = (self.current_date - self.last_service_date).days / 365.0
return years > 4
12 changes: 12 additions & 0 deletions car_Module/components/battery/spindler_Battery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from .battery_Interface import Battery
from datetime import date

#Spindler battery class
class SpindlerBattery(Battery):
def __init__(self, current_date :date, last_service_date:date ):
self.current_date = current_date
self.last_service_date = last_service_date

def needs_service(self) -> bool:
years = (self.current_date - self.last_service_date).days / 365.0
return years > 2
4 changes: 4 additions & 0 deletions car_Module/components/engine/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .engine_Interface import Engine
from .capulet_Engine import CapuletEngine
from .sternman_Engine import SternmanEngine
from .willoughby_Engine import WilloughbyEngine
10 changes: 10 additions & 0 deletions car_Module/components/engine/capulet_Engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from .engine_Interface import Engine


class CapuletEngine(Engine):
def __init__(self, current_mileage :int, last_service_mileage:int ):
self.current_mileage = current_mileage
self.last_service_mileage = last_service_mileage

def needs_service(self) ->bool:
return self.current_mileage - self.last_service_mileage > 30000
6 changes: 6 additions & 0 deletions car_Module/components/engine/engine_Interface.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from abc import ABC, abstractmethod

class Engine(ABC):
@abstractmethod
def needs_service() -> bool:
pass
9 changes: 9 additions & 0 deletions car_Module/components/engine/sternman_Engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from .engine_Interface import Engine


class SternmanEngine(Engine):
def __init__(self, warning_light_is_on :bool):
self.warning_light_is_on = warning_light_is_on

def needs_service(self) ->bool:
return self.warning_light_is_on
10 changes: 10 additions & 0 deletions car_Module/components/engine/willoughby_Engine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from .engine_Interface import Engine


class WilloughbyEngine(Engine):
def __init__(self, current_mileage :int, last_service_mileage:int ):
self.current_mileage = current_mileage
self.last_service_mileage = last_service_mileage

def needs_service(self) ->bool:
return self.current_mileage - self.last_service_mileage > 60000
8 changes: 8 additions & 0 deletions car_Module/serviceable_Interface.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#import necessary libraries
from abc import ABC, abstractmethod

#Serviceable abstraction method
class Serviceable(ABC):
@abstractmethod
def needs_service() -> bool:
pass
13 changes: 0 additions & 13 deletions engine/capulet_engine.py

This file was deleted.

12 changes: 0 additions & 12 deletions engine/model/calliope.py

This file was deleted.

12 changes: 0 additions & 12 deletions engine/model/glissade.py

This file was deleted.

12 changes: 0 additions & 12 deletions engine/model/palindrome.py

This file was deleted.

12 changes: 0 additions & 12 deletions engine/model/rorschach.py

This file was deleted.

12 changes: 0 additions & 12 deletions engine/model/thovex.py

This file was deleted.

15 changes: 0 additions & 15 deletions engine/sternman_engine.py

This file was deleted.

13 changes: 0 additions & 13 deletions engine/willoughby_engine.py

This file was deleted.

File renamed without changes.
16 changes: 16 additions & 0 deletions test/test_Battery/test_NubbinBattery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import unittest
from car_Module.components.battery import NubbinBattery
from datetime import date

class TestNubbinBattery(unittest.TestCase):
def test_needs_service_true_case(self):
current_date = date.today()
last_service_date = current_date.replace(year=current_date.year-5)
nubbin = NubbinBattery(current_date,last_service_date)
self.assertTrue(nubbin.needs_service())

def test_needs_service_false_case(self):
current_date = date.today()
last_service_date = current_date.replace(year=current_date.year-1)
nubbin = NubbinBattery(current_date,last_service_date)
self.assertFalse(nubbin.needs_service())
16 changes: 16 additions & 0 deletions test/test_Battery/test_SpindlerBattery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import unittest
from car_Module.components.battery import SpindlerBattery
from datetime import date

class TestSpindlerBattery(unittest.TestCase):
def test_check_needs_service_true_case(self):
current_date = date.today()
last_service_date = current_date.replace(year=current_date.year-3)
nubbin = SpindlerBattery(current_date,last_service_date)
self.assertTrue(nubbin.needs_service())

def test_check_needs_service_false_case(self):
current_date = date.today()
last_service_date = current_date.replace(year=current_date.year-1)
nubbin = SpindlerBattery(current_date,last_service_date)
self.assertFalse(nubbin.needs_service())
File renamed without changes.
11 changes: 11 additions & 0 deletions test/test_Engine/test_CapuletEngine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import unittest
from car_Module.components.engine import CapuletEngine

class TestCapuletEngine(unittest.TestCase):
def test_check_needs_service_true_case(self):
capulet = CapuletEngine(current_mileage=30001,last_service_mileage=0)
self.assertTrue(capulet.needs_service())

def test_check_needs_service_false_case(self):
capulet = CapuletEngine(current_mileage=30000,last_service_mileage=0)
self.assertFalse(capulet.needs_service())
Loading