← 返回 sofi 的题目列表React UI Coding: Loan Calculator (with a11y, debounce, caching follow-ups)
类型:online_judge
React UI Coding: Implement a Loan Calculator (with a11y, debounce, caching follow-ups)
Given a React starter codebase, implement a loan calculator component/page. You need to complete UI, interactions, calculation logic, and accessibility improvements.
Functional requirements:
Provide input fields as specified (commonly: principal, APR, term in months/years, down payment/fees if any)
Recalculate and update results when inputs change (real-time or as specified)
Results may include monthly payment, total interest, and total payment (per prompt)
Match the provided styling/mock as closely as possible
Accessibility (a11y): proper labels/aria attributes, keyboard navigation, sensible focus management
Follow-up (verbal):
How would you debounce input-driven calculations/requests?
How would you cache computed/fetched results to avoid repeated work?
Constraints
Online editor environment (e.g., HackerRank)
Implement on top of the provided starter code
Expected behaviors
Changing any input updates the results with correct values
Invalid inputs are handled gracefully
Fully usable via keyboard; screen readers can understand the UI
Layout/styling roughly matches the prompt
Example
Input
principal=100000, APR=6%, term=30y
Output
Monthly payment matches formula; totals consistent