Simulate SpotMe Overdraft Decisions Across Card and ACH Debits
Last updated: November 29, 2026
Quick Overview
Process a member's events in order (card purchases, ACH debits, deposits and limit changes) where card purchases may overdraw the balance down to a fee-free overdraft limit but ACH debits may not. Return each decision, the final balance, and how much of the deposits went to repaying the overdraft.
Chime
November 29, 20260
0
0 solved
Process a member's events in order (card purchases, ACH debits, deposits and limit changes) where card purchases may overdraw the balance down to a fee-free overdraft limit but ACH debits may not. Return each decision, the final balance, and how much of the deposits went to repaying the overdraft.
A technical screen question modeled on Chime's SpotMe, which lets eligible members overdraw on debit card purchases up to a personal limit with no fee and repays it from the next deposit. The interviewer is looking for a clean state machine, correct boundary checks, and sensible behavior when the limit drops below what is already owed.
What the Interviewer Expects
- Clarify which transaction types can use the overdraft
- Model balance as signed integer cents where negative means overdraft owed
- Get the boundary right (spending exactly to the limit is allowed)
- Handle a limit decrease without forcing immediate repayment
- Track repayment separately from the deposit total
- Write tests that cover declines and limit changes
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
- How would you add optional tips that members pay when SpotMe covers them?
- Card authorizations and settlements arrive separately. How does that change the check?
- How would you make this safe when two card authorizations arrive concurrently?
- What would you log for each decline so support can explain it to the member?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Events are (kind, cents) with kinds card, ach_debit, deposit, set_limit. A card purchase is approved if the balance after it is at least -limit. An ACH debit is approved only if the balanc...
High-Level Design
Keep balance as one signed integer. The amount owed is max(0, -balance), so repayment does not need its own state, only its own counter for reporting. Each spend kind maps to a floor: -limit for...