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
November 29, 20260
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
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- 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 ProblemsSample 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
- Monthly rate r = APR / 12.
- Level payment = P * r / (1 - (1 + r)^-n), rounded to the cent. If r = 0, payment = P / n.
- Walk the months: interest = round(balance * r), principal = payment - inte...
Submit Your Answer
OneMain Financial Software Engineer Interview Guide
Interview process, tips, and preparation timeline