Track Per-Chain USDC Circulating Supply From Mint And Burn Events

Last updated: November 29, 2026

Quick Overview

Given an ordered stream of (chain, kind, amount) events where kind is mint or burn, compute circulating USDC supply per chain and in total, and report any event that is invalid, such as a burn larger than that chain's supply.

Circle
Coding & Algorithms
Software Engineer
Circle
November 29, 2026
Software Engineer
Online Assessment
Coding & Algorithms
Easy

0

0

0 solved


Given an ordered stream of (chain, kind, amount) events where kind is mint or burn, compute circulating USDC supply per chain and in total, and report any event that is invalid, such as a burn larger than that chain's supply.

A short online-assessment style task grounded in how Circle reports USDC supply across many chains and compares it against reserves. The interviewer looks for clean aggregation, defensive handling of impossible events, and integer amounts.

What the Interviewer Expects
  • Uses a hash map keyed by chain with integer base units
  • Detects burns that would make a chain's supply negative instead of silently going below zero
  • Reports anomalies with enough context (index, chain, reason) to investigate
  • Handles unknown event kinds and non-positive amounts
  • Keeps a single pass over the events
Key Topics to Cover
Hash maps
Aggregation
Data validation
Stablecoin supply
Single-pass algorithms
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 extend this to check that total supply never exceeds attested reserves?
  • Events arrive out of order across chains; does that change the per-chain check?
  • How would you make this incremental for a live dashboard instead of a batch recompute?
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
  • Each event is (chain, kind, amount) with amount in integer base units and events in order per chain.
  • Output: supply per chain, total supply, and a list of anomalies.
  • An anomaly should not be...
High-Level Design

Keep a defaultdict(int) of supply per chain. Mints add, burns subtract after checking there is enough supply on that chain. Anything invalid is skipped and recorded with its index so an operator can...


Submit Your Answer
Markdown supported

Related Questions