Implement a GPS tracker (the tracker emits geographic coordinates at arbitrary time intervals) that determines the fastest speed within a given distance or time window (object-oriented design).
Asked in the first interview stage. The task combines object-oriented design with implementation.
Implement fastest_speed(readings, max_distance_km, max_time_seconds). Each reading is [latitude, longitude, timestamp_seconds], ordered by timestamp. For every pair of readings with a positive time difference, consider the pair when its distance is at most max_distance_km or its elapsed time is at most max_time_seconds. Return the greatest average speed in km/h, rounded to six decimal places. Return 0.0 when no pair qualifies.
Examples: [0,0,0] and [0,0.01,60] produce 66.716956 km/h. Identical coordinates produce 0.0.
Constraints: 1 <= len(readings) <= 1000; valid GPS coordinates; timestamps are nondecreasing.
def fastest_speed(readings, max_distance_km, max_time_seconds):