Build A Nonce Manager For A High-Volume Transaction Signer

Last updated: November 29, 2026

Quick Overview

Design and implement a per-address nonce manager for a service that signs and broadcasts many EVM transactions concurrently: it must hand out nonces, reuse nonces released when a broadcast fails, resync with the chain, and report gaps that would block later transactions.

Circle
Software Engineering Fundamentals
Software Engineer
Circle
November 29, 2026
Software Engineer
Onsite
Software Engineering Fundamentals
Medium

0

0

0 solved


Design and implement a per-address nonce manager for a service that signs and broadcasts many EVM transactions concurrently: it must hand out nonces, reuse nonces released when a broadcast fails, resync with the chain, and report gaps that would block later transactions.

Relevant to Circle's wallet and treasury infrastructure, where developer-controlled wallets and mint/burn operators send large volumes of transactions from a small set of addresses. The interviewer wants to see you understand that EVM nonces must be contiguous and that a single gap stalls everything behind it.

What the Interviewer Expects
  • Explains why a gap in nonces blocks all later transactions from that address
  • Reuses released nonces lowest-first to close gaps
  • Resyncs from the chain's confirmed nonce and prunes stale state
  • Identifies gaps that need a filler or replacement transaction
  • Discusses concurrency and multi-instance coordination
  • Distinguishes failure before broadcast from a dropped or stuck transaction
Key Topics to Cover
EVM nonces
Min-heaps
Concurrency
Transaction lifecycle
State reconciliation
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • Two service replicas sign for the same address; how do you avoid nonce collisions?
  • A transaction sits in the mempool for 20 minutes because gas spiked; what do you do?
  • How would you persist this state so a restart does not reissue a nonce?
  • How does this change on a chain like Solana that uses recent blockhashes instead of nonces?
Sharpen Your Skills on Codemia

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

Practice System Design Problems
Sample Answer
Requirements
  • sync(address, onchain_nonce): the chain's count of confirmed transactions for the address.
  • reserve(address): returns the nonce to sign with.
  • release(address, nonce): signing or broadcast f...
High-Level Design

Per address keep next_nonce (never issued yet), a min-heap of released nonces, and the set of in-flight nonces. reserve prefers the smallest released nonce so gaps close first. sync drops everyt...


Submit Your Answer
Markdown supported

Related Questions