Skip to content

wenzou/avant_challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. A cache is implemented inside the FactorManager using a simply python dict using the frozen set as the key
  2. 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.
  3. 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published