Compute Daily Round-Up Savings From Debit Card Purchases
Last updated: November 29, 2026
Quick Overview
Given a member's transactions as (date, kind, amount_in_cents), compute how many cents an automatic round-up savings feature would move to savings each day, rounding every debit purchase up to the next whole dollar. Refunds, transfers and whole-dollar purchases contribute nothing.
Chime
November 29, 20260
0
0 solved
Given a member's transactions as (date, kind, amount_in_cents), compute how many cents an automatic round-up savings feature would move to savings each day, rounding every debit purchase up to the next whole dollar. Refunds, transfers and whole-dollar purchases contribute nothing.
A warm-up in the style of a Chime phone screen, built around the automatic savings feature that rounds debit card purchases up to the nearest dollar. The interviewer checks that you handle money as integer cents, filter the right transaction types, and ask about edge cases before coding.
What the Interviewer Expects
- Represent money in integer cents, never floats
- Ask which transaction kinds qualify and what happens on a whole-dollar purchase
- Use modular arithmetic for the round-up amount
- Aggregate per day with a dictionary
- Test empty input, refunds and exact-dollar amounts
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 apply a per-day cap on round-ups?
- A purchase is refunded two days later. Should its round-up be clawed back?
- How would you batch the transfers to savings instead of moving money per purchase?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input is a list of (date, kind, cents) tuples. Only kind == "purchase" with a positive amount qualifies. The round-up is the distance to the next whole dollar, so 10.00 ...
High-Level Design
One pass. For each qualifying purchase compute r = cents % 100; if r is non-zero the round-up is 100 - r. Accumulate into a defaultdict(int) keyed by date. No sorting is needed because the out...