Effective-Dated State Late Fee Rules With Borrower-Favorable Resolution

Last updated: November 29, 2026

Quick Overview

Implement a late fee calculator where each state has effective-dated rules (minimum grace period, percentage cap, optional dollar cap) and each loan's note has its own grace period and fee terms. Charge the fee that is most favorable to the borrower among what the note allows and the law permits.

Valon
Software Engineering Fundamentals
Software Engineer
Valon
November 29, 2026
Software Engineer
Technical Screen
Software Engineering Fundamentals
Medium

0

0

0 solved


Implement a late fee calculator where each state has effective-dated rules (minimum grace period, percentage cap, optional dollar cap) and each loan's note has its own grace period and fee terms. Charge the fee that is most favorable to the borrower among what the note allows and the law permits.

ValonOS encodes compliance logic alongside loan data, and late fees are a classic place where the note, state law and investor guides all disagree. The interviewer is looking at how you model rules as data, pick the rule in force on the right date, and make every decision explainable for an audit.

What the Interviewer Expects
  • Model rules as versioned data, not branching code
  • Select the rule in force on the due date
  • Combine note and law: longer grace, lower fee, all caps applied
  • Use integer cents and basis points
  • Return an explanation string for auditability
  • Write tests at rule boundaries
Key Topics to Cover
Rules engines
Effective dating
Compliance
Auditability
Testing
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • Should the rule be chosen by the due date or by the date the fee is assessed?
  • How would you add a rule that forbids late fees during a forbearance plan?
  • How do you roll out a rule change that applies retroactively?
  • How do you prevent pyramiding, charging a late fee because an earlier late fee is unpaid?
Sharpen Your Skills on Codemia

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

Practice System Design Problems
Sample Answer
Requirements

Inputs: state rules (state, effective_from, min grace days, max percent in bps, optional dollar cap), loan note terms (grace days, fee bps, optional minimum fee), monthly P&I in cents, due date, and r...

High-Level Design

Rules live in a table keyed by (state, effective_from) so compliance can add a new version without a deploy. pick_rule chooses the newest version on or before the due date. The calculator is a pure ...


Submit Your Answer
Markdown supported

Related Questions