Design Add, Overwrite, Undo, and Redo for Billing State
Company: Reddit
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: hard
Interview Round: Technical Screen
Overview: Design billing-state commands that progress from additive updates to absolute overwrites and reversible history. The answer defines before-and-after command records, undo and redo stacks, branch invalidation, fixed-precision money, persistent audit events, optimistic concurrency, idempotency, complexity, and edge-case tests.