Whenever you're ready, walk me through how you'd approach this.
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.