Credit On-Chain Token Deposits to Customer Deposit Addresses

Last updated: November 29, 2026

Quick Overview

Given decoded token transfer logs from several chains, a map of deposit addresses to customers and a token registry with decimals, compute each customer's credited balance per token exactly once and list deposits that need manual review.

Bridge
Coding & Algorithms
Software Engineer
Bridge
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


Given decoded token transfer logs from several chains, a map of deposit addresses to customers and a token registry with decimals, compute each customer's credited balance per token exactly once and list deposits that need manual review.

Bridge gives customers deposit and liquidation addresses on chains like Ethereum, Base and Solana, and an indexer turns token transfers into credits. The screen checks exactly-once crediting from at-least-once data, decimal handling, and awareness that chains differ in small but costly ways.

What the Interviewer Expects
  • Deduplicate on (chain, tx_hash, log_index), not tx_hash alone
  • Convert raw integer amounts with each token's decimals using exact arithmetic
  • Ignore transfers to addresses that are not ours, but flag unsupported tokens sent to ours
  • Normalize address case per chain instead of globally
  • Return amounts in a form that cannot lose precision
Key Topics to Cover
blockchain indexing
deduplication
decimal precision
multi-chain
exactly-once crediting
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 do you avoid crediting a deposit that is later reorganized out of the chain?
  • A customer sends USDT to an address set up for USDC. What should the product do?
  • How would you shard this indexer across chains and keep it restartable?
  • How do you defend against dust or spoofed token contracts that mimic USDC's symbol?
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 transfer has chain, tx hash, log index, recipient, token contract and a raw integer amount. One transaction can contain several transfers (a batch payout to us), so the unique key is the log, not...

High-Level Design

Normalize identifiers, build the dedupe key, look up the recipient in our address map (skip if not ours), look up the token by contract address rather than symbol (anyone can deploy a token called USD...


Submit Your Answer
Markdown supported

Related Questions