Object Model for a Multi-Tenant Cloud Usage Billing Meter
Last updated: November 29, 2026
Quick Overview
Design the classes for a usage meter that records metered events (vCPU hours, GB stored, API calls) per tenant, applies each service's pricing plan including tiered pricing, and produces a monthly invoice.
IBM
November 29, 20260
0
0 solved
Design the classes for a usage meter that records metered events (vCPU hours, GB stored, API calls) per tenant, applies each service's pricing plan including tiered pricing, and produces a monthly invoice.
IBM Cloud bills many services by metered usage with plans that include free allowances and tiers. This low-level design question checks clean responsibilities, extensibility for new pricing models, and correct money handling.
What the Interviewer Expects
- Separate usage records, pricing plans and invoice generation
- Use a strategy interface so new pricing models plug in
- Use Decimal, never floats, for money
- Aggregate per tenant, service and metric before pricing
- Make the design testable with injected plans
- Discuss idempotency of usage ingestion
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- How would you handle late-arriving usage after an invoice is issued?
- How would you support enterprise discounts applied across services?
- How do you prevent a duplicate event from being billed twice?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Record usage events with tenant, service, metric, quantity and an event ID. Each (service, metric) has a pricing plan: flat per unit, or tiered (for example the first 100 units free, the next 900 at...
High-Level Design
UsageEvent: immutable data record.PricingPlan: abstractprice(quantity) -> Decimal. Implementations:FlatPlan,TieredPlan.PlanCatalog: maps(service, metric)to a plan, injected ...