# Design a cloud usage metering system: system design interview question

> Cloud usage totals with repeated reports, late usage, historical corrections, and a history that explains each bill.

Source: https://sysround.com/questions/design-cloud-usage-metering-system
Updated: 2026-11-05


Difficulty: hard. Levels: Senior, Staff+.

## How the interviewer opens it

"Design a service that measures customer use of compute, storage, and network resources for bills. The service must handle late and repeated reports and preserve a history that explains each bill."

## What to clarify first

- Meters and measurement authority
- Source report contract
- Scale and traffic concentration
- Read and write mix
- Latency
- Consistency and durability
- Late reports and retries
- Monthly cutoff
- Audit and corrections
- Scope limits

## Scope of a strong answer

Core requirements:

- Collect compute, storage, and network usage from internal resource services
- Count each valid report once despite retries and late arrival
- Provide hourly usage totals and fixed monthly bill inputs
- Preserve source evidence, historical additions, and corrections for audit

Usually out of scope:

- Prices, discounts, tax, and payments
- Invoice delivery
- Low-level hypervisor and packet instrumentation
- Regional disaster recovery

## What interviewers probe

### Repeated or missing reports

Retries can add usage twice. A lost report can reduce a bill without an obvious error.

### Usage across time boundaries

A total across an hour boundary does not reveal variable usage on either side. Different services can also report the same transfer.

### Late usage and closed bills

The monthly cutoff cannot prove completeness. Backlogs and late reports separate usage time from bill time.

### Historical usage and corrections

An omitted measurement has no original fact to reference. Corrections must preserve evidence and cannot count the same consumption twice.

## Common mistakes

- The design trusts queue delivery alone to prevent duplicate charges.
- The design treats a repeated identity as harmless without checking its payload.
- The design divides variable usage across hours in proportion to elapsed time.
- The design assumes a large customer uses many sources.
- The design requires an existing fact for every historical correction.
- The design changes closed bill inputs after a correction.

## The bar by level

- **Senior:** Defines exact hourly quantities, identity conflicts, cutoff positions, and safe replay. Supports historical additions without an existing fact. Specifies correction idempotency, provenance, and bill assignment.
- **Staff+:** Establishes measurement authority and evidence for completeness. Prevents historical additions from overlapping archived facts or pending reports. Handles concentrated traffic and quantifies retention costs. Defines reproducible close results and correction authority.

Practice this question with an AI interviewer: https://sysround.com/practice/new?problem=cloud-usage-metering


---
SysRound (https://sysround.com) is an AI practice tool for system design interviews. It has a voice or typed AI interviewer and a shared whiteboard. At the end, you get feedback on each skill and a model answer. The AI feedback can be wrong.
