Problem statement
Design the object model and metering APIs for a smart electricity meter that accumulates consumption, prices it under a time-of-use tariff, and closes billing periods.
Operating context. One meter measures a single household supply. A metrology sensor emits a stream of interval readings (for example, watt-hours consumed in the last few seconds). The meter accumulates these into registers, and prices consumption against a tariff whose rate depends on the time of day (peak, shoulder, off-peak) and possibly the day type (weekday vs weekend). At the end of a billing period the meter snapshots the registers, produces a period bill, and rolls over cleanly to the next period. It also detects a stuck-or-reversed reading as a tamper signal. Everything runs in-process on the meter.
Out of scope. The utility head-end/back-office and its network protocols (the WAN uplink), the display firmware, prepayment/top-up token handling, disconnect-relay hardware, and cryptographic signing of exported readings.
What to produce. The class hierarchy (meter, reading, register/accumulator, tariff, rate schedule, billing period), the public API each class exposes, and the state transitions of a billing period. Be explicit about: how the tariff is a pluggable Strategy so a new rate plan drops in without touching accumulation, how period rollover is atomic (no reading is double-counted or lost across the boundary), and how the register update stays O(1) per reading.
Requirements
This assessment is a Premium feature.
The statement above is free to read. The functional and non-functional requirements, and the graded canvas that scores your design against them, come with Premium.
Topics
- System Design LLD
- Oop Solid
- Patterns Strategy
- Concurrency Locks
- Iot Metering