Start your terminal to use beginner mode.
Scenario
An IoT sensor monitoring system has collected temperature and humidity data, but some readings are missing due to network issues or sensor failures. The data needs to be cleaned by interpolating the missing values.
Task
Write a Python script at /home/interview/interpolate_data.py using pandas that reads /home/interview/sensor_data.csv, interpolates missing values in the temperature and humidity columns using time-based interpolation, and saves the result to /home/interview/interpolated_data.csv. Round the interpolated values to 1 decimal place.
Note: The data has irregular time intervals. Use time-based interpolation which accounts for the actual time between readings.
Data Structure
timestamp: DateTime of the readingsensor_id: Sensor identifier (no missing values)temperature: Temperature in Celsius (contains missing values)humidity: Humidity percentage (contains missing values)
Example
Input with missing values:
timestamp,sensor_id,temperature,humidity
2026-02-13 10:00:00,S001,22.5,65.0
2026-02-13 10:07:30,S001,,
2026-02-13 10:15:45,S001,23.1,67.5
Expected output with interpolated values:
timestamp,sensor_id,temperature,humidity
2026-02-13 10:00:00,S001,22.5,65.0
2026-02-13 10:07:30,S001,22.8,66.2
2026-02-13 10:15:45,S001,23.1,67.5
Terminal requires a larger screen
Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.
Linux Terminal Environment
Write and execute your solution in the terminal below.
Track
| Question | Difficulty | Company | Access |
|---|
VMware