KatInterview

Investigate Autonomous Fleet Charging Failure and Degradation

System DesignModel answer
MediumModel answerSystem Designsystem-designdata-engineeringroot-cause-analysis

Last updated

Analyze noisy charging logs, define unbiased reliability metrics, formulate root cause logic in SQL, and design a debugging playbook for slow-charging sessions.

Problem Context

You are a Lead Data Engineer at an autonomous mobility company. Operations has reported a spike in charging alerts across the fleet. You are provided with telemetry records streaming from charging sessions with the following fields:

  • session_id (string): Unique identifier for the charging attempt
  • robot_id (string): Unique identifier for the robot
  • start_time (timestamp): Start of the charging attempt
  • end_time (timestamp, nullable): End of the attempt (frequently null for sudden failures)
  • charge_added_wh (float, nullable): Total electrical energy transferred in Watt-hours
  • avg_voltage_v (float): Average recorded voltage
  • status (string): 'SUCCESS', 'FAILED', or 'TIMEOUT'

Due to hardware disconnects, data drops, and sensor corruption, end_time is missing for many ungracefully aborted sessions, and charge_added_wh is occasionally null.

Requirements

  1. Metrics Framework:

    • Propose an unbiased Charging Reliability Rate metric that handles missing duration/energy telemetry without skewing results against units that fail early.
    • Explain how you differentiate real-time critical safety alerts from batch analytical metrics.
    • Detail a strategy for handling streaming data delays and out-of-order logs at scale (10,000+ daily sessions).
  2. Root Cause Analysis (Robot vs. Charger vs. Environment):

    • Assuming charging docks are shared by multiple robots (and vice versa), describe how to isolate whether failures stem from robot-side battery degradation, charger-side pad issues, or site-level environmental factors.
    • Provide a SQL snippet or algorithmic framework demonstrating how to compare cross-docking failure rates while controlling for base traffic volume.
  3. Performance Bottleneck Playbook:

    • Define a plan to investigate a fleet subset exhibiting "Slow Charging" (energy transfer rate below baseline).
    • Outline key diagnostic signatures to distinguish among thermal throttling, software power caps, and high-resistance physical contact issues.

Hints

Hint 1

Identify missing schema elements early (e.g., station_id, temperature, state of charge) and state how you would join them.

Hint 2

Use session attempts as the denominator rather than elapsed duration to prevent early-failure bias.

Hint 3

Leverage the crossed structure of robots docking at multiple stations to construct leave-one-out failure rate comparisons in SQL.