All jobs / Backend developer / Performance
Backend developer interview question · 0–1 years
A teammate opens a pull request that rewrites a service “for performance”. What do you ask for before you approve it?
The strongest answer
A number: what was slow, measured where the user waits, what the profile or trace says is spending the time, and the same measurement after the change so we can see it helped
Why it works
Exactly — a before, a cause and an after. Without the cause you are optimising the part that was never the problem.
What a good answer covers
- Measure, change, measure again.
- Start where the user waits.
- Profile before you guess.
- Keep the before and after numbers.
Answers that fall short
- Close, but not the strongest: A benchmark showing that the new code is faster than the old code
A micro-benchmark can improve while the endpoint does not; measure where the user waits, not only the function. - Weak: A description of the optimisations — if the changes are sound improvements, measuring is a formality
Plausible changes routinely make things slower. Sound reasoning is not evidence. - Red flag: Nothing — performance work is always worth merging, and we can watch the dashboards after release
Merging an unmeasured rewrite means you cannot tell a regression from a win when the dashboards move.
Who gets asked this
More Performance questions
- The interviewer asks: “The API is idle but requests hang on 'opening a connection.' What's going on?”…
- The interviewer asks: “The API returns 429. What should a client do?” Strongest answer?
- The interviewer asks: “You add Cache-Control to a JSON API. What do you watch for?” Strongest answer?
- The interviewer asks: “Why is OFFSET 100000 slow even with a LIMIT 20?” Strongest answer?
- The interviewer asks: “Where do you enforce rate limits?” Strongest answer?
- The interviewer asks: “This query is slow in production but fine on your laptop. What do you do first?”…
- An endpoint takes 1.5 seconds at p95. The container’s CPU sits at 8% and the CPU profiler shows almost…
- The interviewer asks: “The cache expires and 2,000 requests hit the database at once. How do you prevent…