Track Available Balance With Card Holds, Settlements and Expiry

Last updated: November 29, 2026

Quick Overview

Implement a card account that processes authorizations, incremental authorizations, reversals, settlements and credits, where an authorization places a hold that expires after seven days if it never settles. Available balance is the posted balance minus active holds, and a settlement may differ from its authorization or arrive after the hold expired.

Chime
Coding & Algorithms
Software Engineer
Chime
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

0

0

0 solved


Implement a card account that processes authorizations, incremental authorizations, reversals, settlements and credits, where an authorization places a hold that expires after seven days if it never settles. Available balance is the posted balance minus active holds, and a settlement may differ from its authorization or arrive after the hold expired.

An onsite coding round in the style of Chime's card platform work, where the processor sends authorization and clearing messages separately and members see an available balance in the app. The interviewer wants to see you separate posted from held money, handle mismatched settlements (tips, fuel pumps) and pick a structure that makes expiry efficient.

What the Interviewer Expects
  • Distinguish posted balance from available balance
  • Store holds keyed by authorization id
  • Release the hold on settlement and post the actual settled amount
  • Accept settlements with no live hold (force posts after expiry)
  • Explain how to make expiry efficient at scale
  • Test the tip, incremental and expiry paths
Key Topics to Cover
Authorization Holds
Settlement
Hash Map
Expiry
Card Processing
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you make expiry O(log n) instead of scanning every hold?
  • A settlement arrives twice from the processor. How do you avoid posting it twice?
  • How would SpotMe change the decline check here?
  • Which of these events should the member see in their transaction list, and when?
Sharpen Your Skills on Codemia

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

Practice DSA Problems
Sample Answer
Requirements

Operations by day: auth(id, amt) places a hold if available covers it, else declines; incremental(id, amt) grows an existing hold; reverse(id) drops a hold; settle(id, amt) removes the hold (i...

High-Level Design

State is posted (integer cents) and holds: id -> (amount, created_day). Available is posted - sum(holds). Expiry runs lazily at the start of each operation. For an interview-sized input a scan i...


Submit Your Answer
Markdown supported

Related Questions