Skip to main content

Junior

A junior answer names the rule and the bug it prevents.

What does the Node.js event loop do, and what blocks it?

One thread runs your JavaScript. I/O is handed to the system, and the callback or promise runs later. A long synchronous loop blocks every other callback on that process, including requests that are ready.

How do CommonJS and ES modules differ?

CommonJS loads with require and exports with module.exports, synchronously. ES modules use import and export, and the graph is static. Set the package type so a .js file is not guessed. Mixing the two at a boundary needs a deliberate interop.

How do you read a request body without trusting it?

Accept only the content type you expect, and reject a body past a size limit before parsing it. JSON.parse on untrusted text can throw. Catch that and respond as a client error. Do not buffer an unbounded upload in memory.

How should a service read environment variables?

process.env is a map of strings. Read it in one module, check the keys the process cannot start without, and exit if one is missing. Do not scatter fallback secrets through route handlers.

How do async errors reach an Express error handler?

next(err) enters the error middleware. A throw inside an async function rejects a promise. Express 4 does not forward that rejection unless the route is wrapped. Express 5 does. Name the version in the answer, and make both paths reach one handler.

How does Node find an imported package?

It walks parent directories from the importing file, looking in node_modules. A dependency of a dependency may be nested or hoisted. A lockfile makes two installs resolve the same tree.

Mid

A mid-level answer names the mechanism and a failure mode.

When should a handler use a stream instead of a buffer?

Use a stream when the payload may be larger than you want in memory, such as a file proxy or a large response. Connect the readable to the writable and handle errors on the pipeline. Backpressure is the writable telling the readable to pause.

What keeps a Node process alive after the script's last line?

An open handle, such as a server, a timer, or a socket, keeps the loop running. A timer or a pool that was never closed is why a one-shot script hangs. In a server those handles are the job. In a script, close them.

When do you add processes, and when do you add worker threads?

Extra processes each have an event loop and a heap, which is how request work uses more cores. Worker threads share a process and can share memory, which fits CPU work off the request loop. Requests usually scale by process. A CPU task can use a worker.

How do you make a create endpoint safe to retry?

A retry must not create a second record. Accept an idempotency key, store the first success, and return that result when the key is repeated. A unique constraint in the database is the guard. A check-then-insert in memory is not, because two requests can pass the check together.

What is the difference between calling next with an error and rejecting a promise?

next(err) is an explicit hop into error middleware. A rejected promise from an async route is a different path, and on Express 4 it can become an unhandled rejection instead of that middleware. Wrap the route, or run a version that forwards rejections, and log the same way in both cases.

How do timeouts stop a slow client from holding a worker?

Set timeouts for headers, the body, and idle keep-alive sockets so a client that connects and stalls releases the process. The server timeout has to be longer than the upstream calls the handler makes, or the server will cancel work that would have succeeded.

Senior

A senior answer names the tradeoff, the failure, and what to measure.

How do you trace a memory leak in a Node process?

Take heap snapshots under load and see which objects are retaining the growth. Typical retainers are a cache with no cap, an event listener added on every request, and a closure that keeps the request. Confirm the heap climbs across garbage collections, not only inside one request.

What does a graceful shutdown do, in order?

On SIGTERM, stop accepting connections, let in-flight requests finish until a deadline, close database pools and other clients, then exit. If the deadline hits, exit anyway. The process should not depend on a later forced kill as its only stop.

How should a library avoid blocking the event loop with CPU work?

Do not run a long synchronous calculation on the thread that serves requests. Offer an API that uses a worker pool, or document that the caller must move the work. Cap the input. Yielding with setImmediate still shares the loop and is a last resort.

What is the difference between aborting a fetch and ignoring its response?

Pass an AbortSignal into fetch and the request cancels when the signal fires. Dropping the promise still uses the socket, and a late handler can apply a stale body. Thread the same signal through the work that follows the response.

How do you design a module so a test can replace the database?

Pass the database, or a small interface around it, as an argument. A module that imports a singleton and calls it directly forces the test to patch the module graph. An argument makes the dependency obvious and replaceable.

How does backpressure work when a file is piped to a socket?

If the socket is slower than the disk, a buffer with no limit grows. pipe and stream.pipeline pause the readable when the writable is full. Use pipeline so an error destroys every stream in the chain instead of leaving one open.

Check that the candidate can code without AI

These questions show how a candidate talks about Node.js. They do not show the candidate writing the next change with no assistant. How to tell if a developer can code without AI explains the watched session.

What the candidate shows us is proctored tests, watched by a real person: a coding test with no AI allowed, a 2-hour build project with AI allowed, the Fire Drill (a live pair-programming session on a real-world problem), an English test, a thinking-skills test and a typing test. It also covers recorded reference checks. The menu is on Proctored tests. You pay for the tests you order. A real person watches.

When the answers are strong, Hire backend developers. Arca.ph is a network of remote engineers. Your own AI agent, such as Grok, Claude, or ChatGPT, searches and sorts that network. On the marketplace, the fee is a one-time 15% fee of first-year pay, only on hire, with a 3-month free replacement. Done for you is 35% of first-year pay, charged once on hire. Details are on pricing and how it works.

FAQ

How should these questions be used in an interview?

Ask two or three questions from the level you are hiring, then ask what would break. A useful interview is a conversation about a real constraint. It is not a recital of every question on this page. Use the watched coding check before you decide to hire.

What is the difference between a junior answer and a senior answer?

A junior answer names the rule and the common bug. A mid-level answer names the mechanism and one failure mode. A senior answer names a tradeoff, a failure they have seen, and what they would measure. Hire for the work the role will own, not for a perfect score on every question.

How do I check that the candidate can code without AI?

Questions do not show the candidate writing code. What the candidate shows us is proctored tests, watched by a real person: a coding test with no AI allowed, a 2-hour build project with AI allowed, the Fire Drill (a live pair-programming session on a real-world problem), an English test, a thinking-skills test and a typing test. It also covers recorded reference checks. The guide How to tell if a developer can code without AI explains the watched session.

Where do I look for engineers after the interview?

Open the backend developer hire page linked on this page. Node.js is one of the stacks listed for that role. Your own AI agent searches and sorts the Arca.ph network. You choose who to test and who to interview. Profiles are free to view once you sign up and sign the Arca.ph Client Agreement.

What does Arca.ph charge when I hire?

Arca.ph is a network of remote engineers. Your own AI agent, such as Grok, Claude, or ChatGPT, searches and sorts that network. On the marketplace, the fee is a one-time 15% fee of first-year pay, only on hire, with a 3-month free replacement. Done for you is 35% of first-year pay, charged once on hire.

Get started.

Profiles are free to view once you sign up and sign the Arca.ph Client Agreement.