KatInterview

Design an EV Fast-Charging Network Backend: Metering, Telemetry, Locator

System DesignModel answer
HardModel answerSystem Designsystem-designiotbilling

Last updated

Design a backend for a fleet of EV fast-charging stalls covering energy-based billing, long-term health telemetry, and a nearby-available-charger search with prices.

You are asked to design the cloud backend for a worldwide network of electric-vehicle fast-charging sites. Every site contains several charging stalls, and each stall has an energy meter and a controller that can talk to the backend over the internet.

The system must satisfy three functional requirements:

  1. Metering and billing. Capture how much energy each charging session delivers and persist it so the customer can be charged correctly.
  2. Stall health telemetry. Collect health metrics and fault information from every stall and retain them in long-term storage.
  3. Charger locator. In the car's display or companion app, the driver taps a spot on the map and sees the closest sites that currently have a free stall, along with the price at each.

Plan for deep follow-up questions on each requirement rather than a single broad diagram. For billing in particular, be ready to discuss request routing, DNS, secure device communication, on-site buffering, and which calls are synchronous versus asynchronous. Budget your time so that all three requirements get a real design.

What to cover

  • State your assumptions and clarifying questions first (scale, how a session is tied to a customer, pricing model, site connectivity, who reads the data).
  • Billing: session lifecycle, data model, stall-to-backend path (device identity, transport security, DNS and routing), local buffering and behavior during outages, idempotent upload, and avoiding double or missing charges.
  • Telemetry: an ingestion path isolated from billing that absorbs bursts, storage tiers with retention and downsampling, query patterns, and fault alerting.
  • Locator: geospatial lookup, how stall status becomes per-site availability, caching, price lookup and its consistency with the billed price, API shape, latency budget, and behavior on a weak connection.
  • Failure handling and observability for each flow.

Hints

Hint 1

Separate the three flows by what matters most to each: billing needs correctness (no loss, no duplicates), telemetry needs throughput and cheap retention, and the locator needs fast reads with bounded staleness.

Hint 2

For billing, assume the stall can lose connectivity mid-session. Think about a durable local log of meter readings, a unique session ID and sequence numbers per reading, and an upload the server can safely receive more than once.

Hint 3

For the locator, do not compute availability at query time from raw stall events. Maintain a per-site availability summary from the status stream, index sites geospatially, and fetch prices from the same source of truth that billing uses.