ORIGINAL COMPANY-CONTEXT PRACTICE
Reconcile a charging session after connectivity loss
Original practice scenario: A hypothetical charging service receives start, meter and stop messages from stations that occasionally disconnect. Design a session record that remains explainable after retries.
Written for independent practice using company context; this is not a verified question from a company interview.
A REASONED APPROACH
Model answer.
Use a stable session identity and distinguish physical observations from billing or authorization state. Message delivery can be repeated without representing additional energy or a new session.
Work through it
- Record station, connector, session and sequence identifiers with meter readings and timestamps; validate monotonicity within a meter generation and retain anomalous readings.
- Define session transitions and recoverable pending states when authorization, physical stop and server acknowledgment arrive in different orders.
- Reconcile final meter evidence against accepted readings, deduplicate retransmissions and flag unresolved sessions instead of inventing an endpoint reading.
Tradeoffs to discuss
- Waiting for final station evidence improves completeness but delays settlement; provisional views need a clear later-reconciliation policy.
Common pitfalls
- A station reboot can reset a meter counter, so a lower reading is not automatically negative consumption.
- Specify units and timestamp conventions, and keep manual corrections traceable to the observations they supersede.