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
Software Engineering Fundamentals
Software Engineer
IBM
November 29, 2026
Software Engineer
Onsite
Software Engineering Fundamentals
Medium

0

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
object-oriented design
strategy pattern
tiered pricing
money handling
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 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 Problems
Sample 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: abstract price(quantity) -> Decimal. Implementations: FlatPlan, TieredPlan.
  • PlanCatalog: maps (service, metric) to a plan, injected ...

Submit Your Answer
Markdown supported

Related Questions