Generate a Fixed-Rate Installment Loan Amortization Schedule in Cents

Last updated: November 29, 2026

Quick Overview

Given a principal, an APR and a term in months, return the monthly amortization schedule (payment, interest, principal, remaining balance) for a fixed-rate personal installment loan, with every amount rounded to the cent and the balance ending at exactly zero.

OneMain Financial
Coding & Algorithms
Software Engineer
OneMain Financial
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Easy

0

0

0 solved


Given a principal, an APR and a term in months, return the monthly amortization schedule (payment, interest, principal, remaining balance) for a fixed-rate personal installment loan, with every amount rounded to the cent and the balance ending at exactly zero.

OneMain's core product is a fixed-rate, fixed-term personal loan, so a warm-up that touches real servicing math fits the phone screen. The interviewer is checking that you know the annuity payment formula, refuse to use binary floats for money, and handle the rounding residue on the last payment instead of leaving a stray cent on the books.

What the Interviewer Expects
  • Derive or recall the level payment formula P*r / (1 - (1+r)^-n) with r = APR/12
  • Use Decimal or integer cents, not float, and state the rounding rule (half up)
  • Compute interest on the running balance each month, principal is payment minus interest
  • Absorb the rounding residue in the final payment so the balance is exactly 0.00
  • Handle the zero-APR edge case without dividing by zero
Key Topics to Cover
amortization
decimal arithmetic
rounding
annuity formula
loan servicing
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • Real servicing at OneMain accrues simple interest daily, not monthly. How does the schedule change if a customer pays five days late?
  • How would you show the customer the total cost of credit and the finance charge required on a disclosure?
  • If an origination fee is financed into the loan, how does that change APR versus the note rate?
  • How would you test this against a reference calculator for thousands of term and rate combinations?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Inputs: principal (for example 5000.00), APR (0.24), term in months (12). Output: one row per month with payment number, payment, interest, principal, and remaining balance. All money to the cent. The...

High-Level Design
  1. Monthly rate r = APR / 12.
  2. Level payment = P * r / (1 - (1 + r)^-n), rounded to the cent. If r = 0, payment = P / n.
  3. Walk the months: interest = round(balance * r), principal = payment - inte...

Submit Your Answer
Markdown supported

Related Questions