Performance Optimization Interview Questions: Measure, Then Change One Thing
A credible optimization story begins with measurement and ends with verification. The code change is only the middle.
Quick answer
Start with the outcome you need
You want to explain a performance project without relying on vague claims such as “response time improved significantly.”
What to remember
The method is the answer
Asked how you optimised something, weaker candidates list techniques: added a cache, added an index, increased the pool. Those are conclusions with the reasoning removed, and the interviewer cannot tell whether you found the bottleneck or guessed and got lucky.
The answer that scores is a method: what was slow from the user's perspective, how you located the time, what hypothesis you formed, what you changed, and how you confirmed it worked. Every technique belongs inside that frame.
Measure before you touch anything
Say what the target was before you started. Faster is not a target; the ninety-fifth percentile of one endpoint under peak load is.
Be precise about percentiles. An average that improved while the tail got worse is a common outcome and knowing to check separates people who have done this from people who have read about it.
Say where the time actually was. A profile, a trace, a breakdown by stage. The frequent and honest answer is that the time was somewhere nobody expected, and interviewers respond well to that because it is what really happens.
Change one thing and prove it
Changing several things at once and observing an improvement teaches you nothing about which one worked, and leaves you unable to answer the follow-up.
Say what you measured after, under what conditions, and whether the effect held under real traffic rather than only in a benchmark. Benchmarks that did not survive production are a good story, not a bad one.
Say what the change cost. More memory, more complexity, a cache that now needs invalidating, a denormalised table that can drift. An optimisation presented as free is an optimisation whose costs were not examined.
Knowing when to stop
Expect to be asked how you knew it was enough. Optimisation without a stopping condition consumes unbounded engineering time for diminishing user benefit.
The strong answer ties stopping to the requirement: the target was met, the next bottleneck was elsewhere, or the remaining gain no longer justified the complexity.
Have one case where you decided not to optimise. Understanding that a slow path called twice a day is not worth engineering is judgment, and it is scored as such.
Practice checklist
- 01State the performance target as a percentile under a stated load.
- 02Describe how you located the time before naming any change.
- 03Confirm the tail improved, not only the average.
- 04Change one variable per experiment and say how you verified it.
- 05Name what the optimisation cost in memory or complexity.
- 06Prepare one case where you chose not to optimise, and why.
Questions to practice aloud
How did you prove where the bottleneck was?
What alternative optimization did you reject?
Could the improvement be caused by traffic variation?
What regression guard did you add after the change?
Frequently asked questions
What if the win came from a configuration change?+
That is fine and common. What matters is that you found it by measuring rather than guessing, and that you can explain why the default was wrong for your workload.
How specific do the numbers need to be?+
Specific enough to be checkable, and honest where you are approximating. Order of magnitude with a stated method is more credible than a precise figure you cannot explain.
Is profiling tool experience expected?+
Some familiarity helps, but the reasoning transfers. Being able to say what evidence you needed and where you would look for it works even if the specific tool differs.