This is a read me for the avant code challenge.
This code contains the solutions for both factor and caching challenge and line of credit program challenge
This program is developed and test on Python 2.7
##Factor and Caching
This is the solution to this challenge prompt: https://github.com/avantcredit/programming_challenges/blob/master/factors_and_caching
The FactorManager is located inside the objects.py It's test are located inside tests.py
- A cache is implemented inside the FactorManager using a simply python dict using the frozen set as the key
- The performance of the cache is O(1), as it is a dictionary. As the performance is constant, is it hard to improve the performance. However, this caching is in-memory. It will not persist through system reboots. We can make this cache be persistence by writing to a file.
- I am not sure if this is a hypothetical question, but if we were to implement a reverse factoring, it would not change the cache method.
A web page is provided to demonstrate the factor manager
- with flask installed
- Run Python Views.py
- Visit localhost:5000
##Line of Credit This is the solution to this challenge prompt: https://github.com/avantcredit/programming_challenges/blob/master/line_of_credit_test
The CreditLine object is located inside the objects.py It's test are located inside tests.py
The days are reset every 30 days. To simulate action use the "advance_days" function to make transaction on a different day.
There is no web page support for this object. Please import and run this object via interactive command line. Usage examples are found in tests.py