Design Add, Overwrite, Undo, and Redo for Billing State

Last updated: September 4, 2026

Quick Overview

Design a system that allows users to add, overwrite, and manage billing states with undo and redo functionality.

Reddit
Software Engineering Fundamentals
Software Engineer
Reddit
September 4, 2026
Software Engineer
Technical Screen
Software Engineering Fundamentals
Hard

1

0

8 solved


Design a system that allows users to add, overwrite, and manage billing states with undo and redo functionality.

This question is typically asked during a technical screen to assess a candidate's ability to design robust systems that handle state management effectively. Interviewers are looking for a clear understanding of system design principles, data management, and the ability to implement features that enhance user experience, such as undo and redo functionalities.

What the Interviewer Expects
  • Clearly outline the requirements for each functionality (add, overwrite, undo, redo).
  • Provide a high-level design including data structures and interactions.
  • Discuss how to implement undo and redo mechanisms efficiently.
  • Address potential trade-offs and scaling considerations.
  • Explain how the design can handle concurrent modifications.
Key Topics to Cover
State Management
Data Structures
Undo/Redo Mechanisms
Concurrency
System Design Principles
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
  • How would you handle concurrent modifications to the billing state?
  • What data structure would you choose for managing the history of changes?
  • Can you explain how you would test the functionality of your design?
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

The system should support the following functionalities:

  1. Add Amount: Users can add a specified amount to the billing state.
  2. Overwrite Amount: Users can overwrite the current amount with ...
High-Level Design

To implement these functionalities, we can use a stack data structure to manage the history of changes. Each operation (add or overwrite) will push the previous state onto the stack, allowing us to ea...


Submit Your Answer
Markdown supported

Related Questions