Skip to content
Learn Netverks
Company prep Darktrace
Senior (5–8 years) System design Hard

Design a payment ledger with idempotent operations

Reported in Darktrace European engineering loops. Critical design topic focused on correctness under retries and failures.

Role
Payments Engineer
Location
Stockholm, Sweden

Context for Darktrace candidates:

Build a ledger service for credit/debit entries where duplicate requests must not double-charge.

Try answering aloud first

Cover trade-offs, structure, and a concrete example before revealing the baseline response.

Spoiler-free prep mode

How to frame this at Darktrace: Connect your answer to measurable impact, clarity of thought, and trade-offs the team cares about. Below is a strong baseline response you can adapt with your own project examples.

Use append-only immutable ledger entries with strong transaction guarantees. Every write request carries an idempotency key stored with operation result so retries return the same outcome safely.

Model balance as derived state from ledger entries or periodic snapshots, never as an unsafe mutable single field. Ensure each posting has a corresponding inverse strategy for reversals rather than destructive updates.

Design for reconciliation by exposing immutable audit trails, sequence numbers, and daily settlement reports. Mention exactly-once is hard in distributed systems, so idempotency plus at-least-once processing is the practical approach.

Comments (0)

Share how this question came up in your loop, or add tips for others preparing.

Log in to comment on this question.