You will be given two CSV files, one consisting of rules for Cueball Capital's budget and anotherconsisting of investment opportunities. Investment opportunities will be sorted by date, so thatyou can...

You will be given two CSV files, one consisting of rules for Cueball Capital's budget and anotherconsisting of investment opportunities. Investment opportunities will be sorted by date, so thatyou can process them in chronological order. Any investment that does not violate the budgetshould be assumed to be made, so that the relevant budget is then reduced by that amount.Finally, your program should output a list of investment opportunities (their IDs, each one on aseparate line) which violate the budget.


Programming Challenge  Backend                            General Instructions  ● Use either Python 3 or Node.js to solve the following problems.  ● Make sure that your program does not print anything except the content in the 'Output'                              section.  ● You can download the example input files from the links provided.  ● You can use this boilerplate code for reading CSV files: ​Python 3​ | ​Node.js​.  ● Use only standard libraries, in your chosen language, to solve the problem. You can use                              moment.js​ for Node.js and ​dateutil​ for Python3 to handle dates.  ● Please send a single Python or Javascript file with a properly formatted solution and                            comments wherever possible.  Challenge  There is a Venture Capital firm called Cueball Capital. Having lost a lot of money in the last few                                      years, they have decided to regulate their investment by following a strict budget. Their budget                              consists of several rules which are applicable on time period or type of investment or both.  An example rule: Limit investment to 25 million USD per quarter on BigData startups.  You will be given two CSV files, one consisting of rules for Cueball Capital's budget and another                                  consisting of investment opportunities. Investment opportunities will be sorted by date, so that                          you can process them in chronological order. Any investment that does not violate the budget                              should be assumed to be made, so that the relevant budget is then reduced by that amount.  Finally, your program should output a list of investment opportunities (their IDs, each one on a                                separate line) which violate the budget.  Example  budget.csv ID Amount Time Period Sector 1 75 Month 2 30 FinTech 3 25 Quarter BigData 4 70 Year E-Commerce 5 350 Year   1  All rights reserved. This document is strictly private and confidential.  https://gist.githubusercontent.com/ashishmadeti/d61855d662398d2a417284542d5b5ee7/raw/4475299c80bcb93c0ff7b49a5cc13cf792b672ad/read_csv.py https://gist.githubusercontent.com/ashishmadeti/17e26dfe46d9ed1a808db6ce6829c5c4/raw/64b9ced8a7138620617744e1695d86b68b95a4ae/read_csv.js https://momentjs.com/docs/ https://dateutil.readthedocs.io/en/stable/index.html https://gist.githubusercontent.com/ashishmadeti/14dfc449c77b70edfda5e70974a523e7/raw/190c10f91fa83619014131bf915885d975b55ec2/budget.csv     investments.csv​ (with date in the format dd/mm/yyyy) ID Date Amount Sector 1 06/01/2020 10 BigData 2 23/01/2020 20 E-Commerce 3 02/02/2020 35 FinTech 4 10/02/2020 65 SaaS 5 14/02/2020 15 BigData 6 17/02/2020 5 SaaS 7 29/02/2020 5 FinTech 8 18/03/2020 15 BigData 9 03/05/2020 30 E-Commerce 10 18/05/2020 50 E-Commerce   In the above example, the following investments will not go through because of budget                            violations:  ● Investment 3, because it violates Rule 2  ● Investment 5, because it violates Rule 1 (having already made an investment of 65 in                              Feb 2020)  ● Investment 10, because it violates both Rules 1 and 4 (having already made an                            investment of 30 in May 2020 in E-Commerce)  Note:  ● Time Period can only be one of: 'Month', 'Quarter' or 'Year'  ● Sector can be arbitrary  ● Time period starts on the 1st of the relevant month. For example: 1st Quarter of the year                                  starts on 1st January and ends on 31st March.  ● At least one of Time Period and Sector will be present in a budget rule.  ● All amounts are in millions of USD.  Input /path/to/budget.csv /path/to/investments.csv 2  All rights reserved. This document is strictly private and confidential.  https://gist.githubusercontent.com/ashishmadeti/37777cc54fd5748a301a7ed51421d877/raw/713f0a662765e1d607610d17f9e7d36df7b2b499/investments.csv     Output 3 5 10   3  All rights reserved. This document is strictly private and confidential.
Oct 30, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here