Your question is Telemetry Stream Processing. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Arity telemetry arrives as a large iterable of vehicle readings. Implement a one-pass filter that keeps only readings from allowed vehicle types, readings within an inclusive speed range, and readings whose timestamp is strictly later than the last accepted reading for that vehicle.
Preserve the original order of accepted records. A record rejected for vehicle type or speed does not update that vehicle's last accepted timestamp. The function should return a list for straightforward evaluation, but its processing must not require sorting or multiple passes over the input.
Implement filter_telemetry(records, allowed_vehicle_types, min_speed, max_speed).
records is an iterable of dictionaries containing vehicle_id as a string, timestamp as an integer, vehicle_type as a string, and speed as a number.allowed_vehicle_types is a set of strings.min_speed and max_speed are numeric bounds, inclusive.def filter_telemetry(records, allowed_vehicle_types, min_speed, max_speed):