You need to measure where an application spends CPU time in production without restarting it. How?
AdvancedScenarioMigrations, performance and fleet operations
Answer
Situation read → Sampling profiler with low overhead.
What I'd do →
sudo perf top -p <PID>
sudo perf record -F 99 -g -p <PID> -- sleep 30
sudo perf report --stdio | head -50
Generate a flame graph (perf script | stackcollapse-perf.pl | flamegraph.pl > out.svg). For runtimes: py-spy record -p PID, async-profiler for Java. eBPF tools: profile-bpfcc -F 99 30.
Why → Sampling at 99 Hz has negligible overhead and shows hot code paths.
Interview tip → Mention that missing symbols (no frame pointers / no debuginfo) make stacks unreadable.
More on Migrations, performance and fleet operations
You must migrate 2 TB of application data from an old server to a new one with less than 5 minutes of downtime. How?IntermediateThe new server has different UIDs for the same users than the old one. What breaks during migration and how do you handle it?IntermediateA server is "slow" according to users. What is your first 60 seconds of investigation?BeginnerYour team must capacity-plan for a server whose disk grows 4% per week. How do you predict when it fills?IntermediateYou need to replace a physical server with a VM without changing its IP or hostname. Plan the cutover.IntermediateMemory usage on a server shows 95% used but the app is fine. A manager is worried. How do you explain and verify?Beginner