At companies like Stripe or Netflix, interviewers often ask how you would improve a working but slow algorithm. They want to see structured reasoning, not just a faster final answer.
Explain how you would optimize an existing algorithm to improve performance. In your answer, address:
Focus on a practical engineering approach: start from baseline complexity, profile or reason about hot spots, propose targeted improvements, and discuss trade-offs. You do not need to cover low-level compiler or hardware tuning unless it directly affects the algorithmic design.