Design the Bill Summary Feature.
MediumImagine you're building a billing system for a cloud service provider. This system needs to generate summarized bills for users, detailing the various services they consumed and their corresponding costs. The complexity lies in the diverse range of services offered (compute, storage, networking, databases, etc.), each with its own pricing model. The billing system must be extensible to accommodate new services and pricing schemes without requiring major code changes. The bill summary must be generated in a thread-safe manner, as multiple billing cycles might run concurrently for different users. We want to create a robust and maintainable system that can adapt to evolving business needs. This problem focuses on the core billing summary generation, not the entire billing pipeline (ingestion, rating, etc.). We are assuming the raw usage data is already available.
Requirements
Interview Simulation
Experience a realistic interview conversation. The interviewer will ask clarifying questions,and you'll reveal your understanding of the requirements.
Let's start by understanding the scope. What are the core functionalities this system needs to provide?
💡 Interview Tip
Identify the Actors (Who uses the system?) and their Use Cases (What are they trying to achieve?). Start with the 'Happy Path' scenarios.