Build an EMI calculator: monthly payment, amortization schedule and exact rounding to the paisa

mediumAbout 30 minutesUpdated CodingProfinancemathroundingmachine-coding
Not solved

Share this question

Problem

Loan calculators are a common machine coding task in Indian fintech interviews (banks, Groww, Paytm, CRED): the UI is simple, and the interviewer watches how you handle the money. Write the engine behind one: emiPlan({ principal, annualRate, months }).

{
  emi,           // the monthly payment, in rupees, rounded to the paisa
  totalPayment,  // everything paid over the loan
  totalInterest, // totalPayment - principal
  schedule,      // one row per month: { month, payment, interest, principal, balance }
}

Ref. UR-1433 · © UIRound · uiround.com/questions/build-an-emi-calculator-monthly-payment-amortization-schedule-and-exact-rounding-to-the-paisa

Stuck? Take a hint

Try it in the editor

Run your code as often as you like. Submitting it to the full test suite is part of Pro.

Private, and saved in this browser as you type. All your notes are on My lists.

Every question and answer7 days, one payment