Your question is Legacy Service Refactor for Performance. 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).
Describe a scenario where you had to refactor a legacy service for better performance.
Explain the original bottleneck, how you diagnosed it, which architectural or implementation changes you made, and how you measured the result. Address backward compatibility, rollout safety, observability, and any tradeoffs. For an ML-backed service, discuss online inference, feature access, model versioning, and training-serving consistency where relevant.