Skip to content

kriya-finance/code-test-engineer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

MarketInvoice Coding Exercise

At MarketInvoice, we'd like to offer our customer loans. We would like to inform them how much a weekly installment will be, the total amount of interest paid and the overall cost of the loan.

For accounting purposes we need to know how much of each repayment is paying off interest and how much is paying off the principal.

The scope of the exercise is as follows:

We would like you to write a loans calculator API with two endpoints returning json fulfilling the following user stories:

  1. As a prospective loan customer, I want to know the weekly instalment, the total cost and the amount of interest paid for a loan of a given amount and APR.

  2. As a loans administrator, I want to know what the breakdown of repayments are in terms of interest paid and principal repaid for a given loan amount and APR.

e.g.

/loansummary?amount=50000&apr=19

will return

{
  "weeklyRepayment" : 1058,
  "totalRepaid" : 55016,
  "totalInterest" : 5016
}

and

/repaymentSchedule?amount=50000&apr=10

will return

{
   "installments":[
     {
       "installmentNumber": 1,
       "amountDue": 50000,
       "principal": 875,
       "interest": 183
     },
     
     ...
     
     {
      "installmentNumber": 52,
      "amountDue": 1054,
      "principal": 1054,
      "interest": 4
     }
   ]
}

Examples

Scenario 1

Given a loan of £50,000 taken out over 52 weeks at an annual interest rate of 19%
When I ask for the loan summary
Then I am told

  • the weekly repayment is £1,058
  • the total amount repaid is £55,016
  • the total interest paid is £5,016.

Scenario 2

Given a loan of £50,000 taken out over 52 weeks at an annual interest rate of 19% (assuming the installments are paid back regularly and on time)
When I ask for the repayment breakdown
Then I am given a breakdown that includes the following values:

Repayment Week Amount Due Principal Interest
1 50,000 875 183
2 49,125.17 878 179
10 42,010.44 904 153
26 26,184.45 958 99
52 1,053.68 1,054 4

(Note: Although we only provide a few examples here, we expect the endpoint to return data for all 52 installments)

Note

Each installment is calculated using the following formula:

formula for loans

Where

  • P is the amount of the loan (the Principal)
  • n is the number of payments over the life of the loan
  • r is the installment period interest rate (the Annual Percentage Rate divided by the number of installments)

https://www.wikihow.com/Calculate-an-Installment-Loan-Payment

We advice you to take no more than 60 minutes to complete this task.

What we pay attention to when we evaluate your submission

  • Code quality and consistency
  • Readability and simplicity
  • Backwards compatibility
  • Test quality
  • Commit history

Submission Guidelines

Here are guidelines on how to submit the exercise

If you are in contact with our Talent Team

  • ZIP your code directory, without uncommitted / ignored files (i.e. NuGet packages)
    • include git, but exclude anything not checked in (git clean -fdx).
  • Email the submission in a zip file to our Talent team contact

Getting in contact with our talent team

Get in touch with us via email at recruitment@marketinvoice.com!

Thank you for taking your time

MarketInvoice Tech Team

About

MarketInvoice Fullstack Engineer Code Test

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors