Top 8 Profiling Interview Questions
Browse 8 real-world technical and behavioral interview questions about Profiling. Review scenarios, edge cases, and architectural best practices.
CPU saturates on every node minutes after a release that contained forty commits. How do you find the cause?
Stop the bleeding first by rolling back or disabling the suspect path, then find the cause by profiling the saturated process rather than by reading the diff, because a profile names the hot function directly while forty commits offer forty plausible stories. Use this performance analysis answer to show the decision, trade-off, and evidence rather than a memorised definition.
Before you tune anything, how do you decide which queries are worth your time?
Rank by the total time a statement shape consumes across a measured window rather than by the slowest single execution, then check what that time was spent waiting on before touching the SQL. The cheap statement running ten thousand times a minute usually outranks the ten-second report.
How do you tell whether a value escapes to the heap, and how would you find the allocations that are costing you?
Escape analysis moves a value to the heap when the compiler cannot prove its lifetime ends with the frame that created it, and go build -gcflags=-m prints every decision. Which of those allocations matter is a measurement question, answered with a benchmark, an alloc_space profile and benchstat.
A method has been running fast for an hour and then gets slower, with no code change and no extra traffic. What might the runtime be doing?
A JIT compiles against a profile gathered earlier, so its fast code rests on assumptions that can be invalidated: a new receiver type at a call site, a branch taken for the first time, a class loaded that gives an interface a second implementation. The method deoptimises and recompiles from a worse profile. It also connects deoptimisation to the point an interviewer is testing.
A nightly job took 40 minutes last month and takes two hours forty on twice the data. What do you conclude about its complexity, and what would you measure next?
A fourfold cost for a doubled input is consistent with quadratic growth, but two points fit infinitely many curves and a one-off cliff such as spilling out of memory produces the same ratio. Get a series of ratios across several doublings, then confirm the exponent against the code.
How do you resolve unacceptable INP degradation caused by massive, synchronous JavaScript execution blocking the main thread?
Evaluate the candidate's understanding of the JavaScript event loop, rendering pipeline, and modern techniques for yielding to the main thread to improve INP. Use this frontend answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects performance to the point an interviewer is testing.
The business told you a field is always populated, and in production it is null for a third of the rows. How do you work out what is going on and what do you do about it?
Segment the nulls before drawing any conclusion — by date, source system, record type and creating process — because a null rate that clusters is a documented business path nobody mentioned, while one spread evenly is usually a genuine capture defect.
A long-running Python service keeps climbing in memory and never comes back down. How do you work out where the memory went?
CPython frees an object the instant its reference count reaches zero, so steady growth is usually something still holding a reference rather than a leak. The cycle collector reclaims only reference cycles. Measure with tracemalloc first, then use __slots__ or generators to cut per-object and peak cost.