Top 3 Pprof Interview Questions
Browse 3 real-world technical and behavioral interview questions about Pprof. Review scenarios, edge cases, and architectural best practices.
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.
How do goroutines leak, and how would you find a leak in a running service?
A goroutine leak in Go happens when a goroutine blocks forever on a send, receive, network call or abandoned worker path. Find it with goroutine counts and pprof, then add cancellation to every blocking operation. Use this goroutines answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects channels to the point an interviewer is testing.
Memory keeps climbing in a Go service under load. How do you find out why, and what can you actually tune?
Take a heap profile and compare two taken minutes apart, because the shape of the growth tells you whether it is a leak, a cache with no bound, or simply the collector letting the heap grow. The two real knobs are GOGC and GOMEMLIMIT, and reducing allocation matters more in Go than in a generational runtime.