Describe a time when you had to write software that interacted directly with physical hardware or sensors; how did you handle latency and data loss?