Question 01Answers in Raw Mode
A strong answer reaches for a CPU profile and a flame graph to see where the time really goes, instead of guessing and optimizing on gut feel
Senior
How you grab a CPU profile without taking the process down, what width and depth in a flame graph really tell you, and how to spot event-loop starvation hiding behind on-CPU work.
Staff
Profiling safely in production, why an I/O-wait problem won't even show up in the profile, and how you back the fix with a proper before-and-after measurement.
Follow-up chain
- Okay, you've got a CPU profile open. When you look at the flame graph, what's the width of a frame actually telling you, and what about the stacking?
- Say the flame graph shows your handler is cheap, but requests are still slow. Where's that time hiding?
- How would you pull a CPU profile off a live production process without taking it down?
- So you found the hot function and optimized it. How do you prove that actually helped?
Question 02Answers in Raw Mode
A strong answer picks event-loop delay as the metric that moves first when a Node process goes bad, and measures it as a histogram instead of an average
Senior
Why event-loop delay beats CPU at predicting the latency users feel, how `monitorEventLoopDelay` builds its histogram, and what it means when p99 lag starts climbing.
Staff
How to pick a threshold that catches real stalls without crying wolf, tying lag spikes back to the synchronous code behind them, and why 'add more CPU' almost never fixes it.
Follow-up chain
- How is it that CPU can look totally healthy while the event loop is stalled and requests are piling up?
- Okay, so what kind of code actually causes a lag spike like that, and how do you track down which handler it was?
- Why bother with a histogram for event-loop delay? What's wrong with just reporting the average?
- Where would you actually set the alert threshold for lag? And what's the danger in picking one fixed number?
Question 03Answers in Raw Mode
A strong answer keeps RSS, heapUsed, and external memory straight, and can chase a production leak without ever bouncing the process
Senior
What RSS, heapUsed, and external each actually measure, why a Buffer leak will never show up in heapUsed, and how you tell a growing retained set from normal churn.
Staff
How to capture comparable heap snapshots off a live process, read the diff for the retaining path, and tell a real leak apart from GC that just hasn't run yet.
Follow-up chain
- Say heapUsed is flat but RSS just keeps growing. What's leaking there, and where do you go looking?
- How would you confirm that's Buffers or native memory and not just heap fragmentation?
- How do you actually take a heap snapshot on a production process? And what's the cost you have to plan around?
- Memory climbed for an hour and then dropped off sharply. Was that a leak? How would you tell?
Question 04Answers in Raw Mode
A strong answer ties GC pauses to the latency-tail spikes and reaches for allocation rate as the first lever, long before any GC tuning flag
Senior
Why the generational design keeps minor GC cheap while major GC is the pause that hurts, how that pause turns into tail latency, and why allocation rate drives all of it.
Staff
How to measure GC pause time against your SLO, cut allocation pressure before you touch a single flag, and tell when a heap-size change helps and when it just hides the problem.
Follow-up chain
- So why is it the major GCs that hurt your latency tail, when the minor ones mostly don't?
- And what is it in your code that decides how often a major GC has to run?
- Say a teammate wants to bump --max-old-space-size to fix the spikes. When does that actually help, and when are you just trading up to a bigger pause later?
- How would you actually put a number on GC's share of your latency instead of guessing at it?
Question 05Answers in Raw Mode
A strong answer thinks in percentiles and histograms instead of averages, and can explain why the tail is what users actually feel
Senior
What an average quietly erases, why a high-fan-out request lives in the tail, and why you can't just average percentiles across your hosts.
Staff
How histograms let you aggregate latency correctly, why one slow dependency ends up dominating a fanned-out request, and which percentile you actually hold yourself to.
Follow-up chain
- Say a request fans out to 20 backends and has to wait for all of them. Why does one backend's p99 end up being the typical experience for the whole request?
- Okay, so how do you cut down that tail amplification without going and making every backend faster?
- Why can't you just take the p99 from each of your ten instances and average them?
- So which percentile do you actually put the SLO on, and how do you defend that choice?
Question 06Answers in Raw Mode
A strong answer knows the ways a load test lies, skipped warmup, coordinated omission, closed-model backpressure, and designs the test around all three
Senior
Why warmup, connection reuse, and your choice of load model all bend the numbers, and what coordinated omission quietly does to the tail latency you report.
Staff
How to build a test that actually reproduces production, open model, realistic connection reuse, corrected latency, then find the knee where the service really falls over.
Follow-up chain
- So what exactly is coordinated omission, and which way does it skew your latency numbers?
- And how do you run a load test that doesn't fall into that trap?
- Walk me through open model versus closed model. How does that choice change what an overload test even measures?
- Why is skipping warmup such a problem for a Node service in particular? What does it do to the test?
Question 07Answers in Raw Mode
A strong answer picks the cache layer by its consistency and invalidation behavior, and knows a stampede can make a cache hurt more than it helps
Senior
The three axes that actually matter, placement, consistency, and invalidation, plus why an in-process cache drifts per instance and how a hot key's expiry turns into a stampede.
Staff
How you stop stampedes with a lock or early recompute, pick a placement that fits your consistency needs, and why hit rate and origin load only make sense measured together.
Follow-up chain
- So an in-process cache and a shared Redis behave differently on consistency. What actually breaks with the in-process one once you're running a fleet?
- Given all that, when would you still pick a per-instance in-process cache?
- Say a really popular key expires and every instance goes to recompute it at the same time. What's that called, and how do you stop it?
- Everyone says invalidation is the hard part. What makes it harder than just setting a TTL and moving on?
Question 08Answers in Raw Mode
A strong answer explains how `AsyncLocalStorage` carries context across async boundaries and what that machinery actually costs at runtime
Senior
How `AsyncLocalStorage` gets context across awaits with zero manual threading, the `async_hooks` machinery underneath, and where that per-operation cost really comes from.
Staff
How to decide what's worth tracing and at what sampling rate once you know the runtime cost, carry context across service boundaries, and measure the overhead you actually added.
Follow-up chain
- So without threading a trace ID through every function signature, how does AsyncLocalStorage get the context to code way down in an async call chain?
- And where does the runtime overhead of that mechanism actually come from?
- Now the trace has to cross a network call into another service. What actually travels across, and how?
- You can't afford to trace everything. So how do you sample without throwing away the traces you actually need?
Question 09Answers in Raw Mode
A strong answer treats logging as a performance surface, structured output, async transport, sampling, and can say why pino is fast where a naive logger isn't
Senior
Why unstructured logs stop being queryable at volume, what synchronous logging does to your event loop, and the design choices that keep pino cheap on the hot path.
Staff
How to keep logging off the hot path, sample high-volume logs without losing the ones you'll need, and the ugly failure where a slow log destination stalls the whole process.
Follow-up chain
- Once you've got real volume, why is a structured JSON log line worth so much more than a nicely formatted human string?
- And what does pino actually do to keep the cost of producing that line off the request path?
- console.log can write synchronously in some cases, right? How does that end up stalling your event loop?
- Say you're logging way too much to store it all. How do you sample without throwing away the logs you actually need?
Question 10Answers in Raw Mode
A strong answer builds capacity from measured per-core throughput and makes the scale-out versus optimize call from where the bottleneck actually sits
Senior
Why one Node process means one core for your JavaScript, how you actually measure requests-per-core, and what really caps a single instance's throughput.
Staff
How to plan capacity from measured headroom plus a safety margin, decide scale-out versus optimize by where the bottleneck lives, and spot the case where more instances make it worse.
Follow-up chain
- So one Node process runs your JavaScript on one core. What does that actually mean for how you use a multi-core machine?
- And how do you go about measuring that requests-per-core number the whole capacity plan hangs on?
- Say the event loop is the bottleneck on one instance. Why might adding instances do nothing for you, or even make things worse?
- You've got the option to either optimize the code or just add instances. How do you make that call?