Tell me about a time you had to optimize an algorithm to meet strict latency requirements in an embedded system.