Your question is Optimized Firmware With Safety. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
How do you write highly optimized low-level firmware in C or C++ while managing memory manually and avoiding memory leaks or race conditions?