Question 01Answers in Raw Mode
A strong answer follows one request from the accepted socket through llhttp parsing into the JS handler and can say which layer owns what.
Senior
The whole handoff chain, kernel accept queue to libuv to a C parser firing callbacks mid-buffer, and why req is a stream your handler gets before the body finishes.
Staff
Where this pipeline actually stalls under load, accept backlog, parser pauses, header timeouts, and which counters tell you which stage is the problem.
Follow-up chain
- So where does backpressure kick in on this path if a client's uploading a big body faster than your handler reads it?
- And what's actually happening to the TCP connection while you're not reading req?
- Okay, keep-alive means a second request comes down that same socket. What has to get reset between the two?
- Say latency is creeping in somewhere. How do you prove it's the parser adding it and not your handler?
Question 02Answers in Raw Mode
Strong candidates get concrete about connection reuse, agents, socket pools, keep-alive, and know exactly how undici differs from the old http.Agent.
Senior
What an agent really holds, those free and in-use socket lists keyed by host, and why undici's pipelined connection pool acts so differently under concurrency than http.Agent.
Staff
The failures that actually show up at scale, maxSockets queueing and head-of-line stalls on a pooled connection, and how to read the socket counters that give them away.
Follow-up chain
- So with the default agent, is there anything capping how many sockets you open to one host? And what happens once you hit that cap?
- And how does that queue play with your request timeout?
- Node's global fetch doesn't go through http.Agent at all. So what's actually behind it, and how would you tune that pool?
- Why does one slow response on a keep-alive connection hold up the others, and when does that actually bite you?
Question 03Answers in Raw Mode
The strong answer names all three server-side timeouts and ties each one to the specific slow-client attack or leak it exists to bound.
Senior
The three separate clocks, headersTimeout, requestTimeout, and keepAliveTimeout, what each one actually measures, the real default values, and how they stack.
Staff
Why bumping a timeout to paper over a proxy quirk quietly reopens slowloris, and how your own metrics can tell a slow legitimate upload from an attack.
Follow-up chain
- Say a legitimate upload takes four minutes and suddenly it's coming back 408. Which timeout fired, and how do you fix that without turning the protection off?
- What's keepAliveTimeout actually protecting you from, and why does it start to matter once there's a load balancer in front of you?
- And how does that turn into random 502s at the load balancer?
- Slowloris dribbles headers one byte at a time. Which timeout actually catches that, and why isn't server.timeout the answer?
Question 04Answers in Raw Mode
A good answer keeps application-layer multiplexing separate from transport-level head-of-line blocking, and knows which one HTTP/2 fixes and which stays.
Senior
The two layers where head-of-line blocking lives, why HTTP/2 kills one and leaves the other alone, and how per-stream flow control changes what you tune.
Staff
Where HTTP/2 actually pays off in real deployments and where it's neutral or worse, plus the failure a single lossy connection creates that HTTP/1.1 pooling dodges.
Follow-up chain
- Okay, so HTTP/2 puts all these streams on one connection. When a packet gets lost, what's still blocking every single one of them?
- So on a lossy network, could plain HTTP/1.1 with six connections actually beat HTTP/2 on one?
- Say you terminate HTTP/2 at a proxy and it speaks HTTP/1.1 to Node behind it. What did you actually get out of that?
- What's HTTP/2 flow control doing, and how is that different from the windowing TCP already does?
Question 05Answers in Raw Mode
Strong answers place TLS termination from real constraints and can put numbers on what a handshake costs in round trips and CPU.
Senior
The handshake taken apart, its round trips and its asymmetric-crypto cost, why 1.3 gets it done in one RTT, and what session resumption really reuses.
Staff
How to pick termination placement from real constraints, internal encryption, cert management, CPU headroom, and why handshake cost gets measured apart from throughput.
Follow-up chain
- So a full TLS 1.3 handshake fits in one round trip. What's actually happening inside it, and what does 0-RTT resumption get to skip?
- And what's the security catch that makes people nervous about 0-RTT?
- Okay, you terminate TLS at the load balancer. What does your Node app suddenly get wrong about the client, and how do you get that back?
- During a surge of brand-new clients your CPU spikes on handshakes. Why is it new clients specifically, and what would you tune?
Question 06Answers in Raw Mode
A strong answer knows how a request body gets framed on the wire and streamed into Node, and why holding whole bodies in memory will eventually hurt.
Senior
How the body gets framed, Content-Length versus chunked, how req hands it to you as a readable stream, and where the parser passes off backpressure.
Staff
Streaming an upload straight into storage with the size cap enforced mid-read, plus the metrics that spot a memory blowup before it OOMs the process.
Follow-up chain
- With chunked transfer encoding there's no Content-Length at all. So how does the server ever know the body's finished?
- Say you want a 10MB cap on uploads. Where do you actually enforce that, and why isn't checking Content-Length enough?
- And what if a client just lies, declares one Content-Length and keeps sending bytes past it. What happens then?
- Piping req straight to a file works fine until the disk can't keep up with the upload. What's backpressure doing for you there?
Question 07Answers in Raw Mode
Good candidates treat forwarded headers as untrusted until a proxy they control rewrites them, and can walk a WebSocket upgrade through the stack.
Senior
Why X-Forwarded-For stays a client-controlled string until a trusted hop rewrites it, how the trust boundary picks which entry to believe, and what the Upgrade handshake actually does.
Staff
The spoofing and rate-limit-bypass messes you get from trusting forwarded headers the wrong way, and what kills WebSockets at a proxy that buffers or times out.
Follow-up chain
- So a client shows up sending its own X-Forwarded-For header. Why can it now walk straight past your rate limiter, and what's the fix?
- Walk me through the WebSocket upgrade itself. What HTTP actually goes back and forth before that connection turns into a raw socket?
- Say the proxy in front of Node keeps killing idle WebSockets after 60 seconds. Why is it doing that, and how do you keep them alive?
- Now put two proxy hops in front. Which X-Forwarded-For entry is the real client, and how do you pick it without getting burned?
Question 08Answers in Raw Mode
The strong answer keeps dns.lookup, getaddrinfo on the thread pool, apart from dns.resolve, c-ares over the network, and knows Node caches nothing by default.
Senior
The two resolution paths, getaddrinfo on the thread pool against c-ares over the network, and why the one every http request takes can starve fs and crypto.
Staff
How an uncached, thread-pool-bound lookup turns into latency your downstream gets blamed for, and where caching belongs if you don't want to break failover.
Follow-up chain
- So every outbound HTTP request goes through dns.lookup by default. Where does that actually run, and what else is fighting for those threads?
- And how would you actually prove it's DNS adding the latency and not the downstream?
- Node doesn't cache DNS between calls at all. What starts breaking under load, and what are your two ways out?
- When would you deliberately reach for dns.resolve over dns.lookup, knowing it's going to ignore /etc/hosts?
Question 09Answers in Raw Mode
A strong answer reads socket errors as protocol events, knows which side sent the RST, what half-open means, and treats ECONNRESET as having a cause.
Senior
What an RST really is, how a clean FIN close differs from a reset, and how a half-open connection hangs around until some write finally fails.
Staff
How to sort harmless resets from a real fault, why the listen backlog drops connections while your CPU graph looks fine, and what's worth measuring.
Follow-up chain
- What's actually different between a connection that closes with a FIN and one that gets reset with an RST, and which one hands you ECONNRESET?
- Say the client hangs up halfway through your response. What error shows up, and why do you need a handler on res and not just req?
- Give me your definition of a half-open connection. How does one just sit there with neither side noticing, and what finally surfaces it?
- Connections are getting dropped before your handler ever runs. How would the listen backlog cause that, and how do you confirm it's the culprit?
Question 10Answers in Raw Mode
Strong candidates measure framework overhead against a real workload and can point at where Express and Fastify actually spend their time.
Senior
Where the framework's time really goes, route matching, the middleware chain, serialization, and why schema-compiled JSON is Fastify's actual edge over Express.
Staff
When framework overhead is a rounding error next to your real latency and when it genuinely matters, measured on your own workload instead of a hello-world.
Follow-up chain
- So Fastify's headline win isn't really the router, it's serialization. What's it doing there that Express doesn't bother with?
- And what can go wrong with schema-compiled serialization? How do you make sure you're not leaking fields?
- Express middleware is just a straight chain of functions. How does that cost grow, and where does it start to hurt?
- A hello-world benchmark says Fastify's three times faster. Why is that number close to useless for your actual API?