How would you maintain backward compatibility when the unit of a sensor data column changes from millimeters to centimeters? How do you handle schema version control?
💡 Model Answer
When a sensor unit changes, I treat the column as a new version rather than overwriting the existing data. First, I add a metadata field (e.g., unit or version) to each record or maintain a separate schema registry entry. I then create a transformation layer that reads the unit flag and converts values to a canonical unit (e.g., millimeters) for downstream consumers, preserving the original value for audit. For backward compatibility, I keep the old column in the schema and mark the new column as the primary source. I use a versioned schema registry (like Confluent Schema Registry) to publish both versions and enforce compatibility rules. When consuming data, clients can specify the desired version or rely on the transformation layer. This approach ensures that legacy applications continue to work while new systems can use the updated unit. I also document the change in release notes and schedule a phased rollout with feature flags to monitor impact.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers — invisible to screen sharing.
Get Assisting AI — Starts at ₹500