Server Runtimes & Process Management
The runtimes and supervisors that actually keep a backend process alive — Node, Bun, Deno, .NET — plus the process managers wrapped around them. Interviewers ask because 'it works on my laptop' and 'it survives production' are different problems, and the gap lives here.
on this pageshowhide
explore
- Node.js143 questions
- Scheduling Model20 questions
- Module Formats and Loading19 questions
- Streams and Byte Buffers21 questions
- Filesystem and Network I/O24 questions
- Multi-Core Execution20 questions
- Reliability and Diagnostics27 questions
- Bundled Tooling12 questions
- Bunempty
- Bun Runtime APIsempty
- Bun Toolchainempty
- Denoempty
- .NET36 questions
- IL, JIT and AOT6 questions
- Managed Heap & GC Modes6 questions
- BCL & Core Libraries6 questions
- Thread Pool & Parallelism6 questions
- Worker & Console Hosts6 questions
- Benchmarks and Tracing6 questions
- .NET Frameworkempty
- pm2empty
- Octane18 questions
- Worker Server Choices6 questions
- State Leaks Between Requests6 questions
- Concurrent Tasks & Ticks6 questions
questions
197 · 3 sectionsIn Node.js, how do Buffer.from(string, encoding) and buf.toString(encoding) convert between text and bytes, and why can a string's length differ from Buffer.byteLength()?
basics
~20 sBuffer.from(str, enc) encodes a string into bytes and buf.toString(enc) decodes bytes back, both defaulting to utf8; base64 and hex render bytes as text. A string's length counts UTF-16 code units, while Buffer.byteLength() counts encoded bytes.
What does Node's cluster module do, and how does one entry script know whether it is running as the primary or a worker?
basics
~20 sNode's cluster module runs one script as a primary that calls cluster.fork() and as worker processes that share its server ports. cluster.isPrimary, derived from an environment variable the primary sets for each worker, tells the script which role it has.
In Node.js, what type does every value in process.env have, and why does a check like if (process.env.CACHE_ENABLED) misfire?
basics
~10 sEvery process.env value is a string, or undefined when the variable is unset. CACHE_ENABLED=false yields the non-empty string 'false', which is truthy, so the branch runs; parse and compare values explicitly.
In Node.js, how does the error-first callback convention work, and what rules must a callback-style API and its caller follow?
basics
~20 sA Node.js callback API calls its last argument as callback(err, result): err is an Error on failure and null on success. The caller checks err first and returns; the API calls back exactly once, always asynchronously.
In Node.js, what does registering process.on('uncaughtException') change about a crash, and why is it unsafe to keep serving afterwards?
basics
~20 sA process 'uncaughtException' listener replaces Node's default of printing the stack trace and exiting with code 1, so the process keeps running. Its state is now unknown, so the handler should log synchronously, clean up and exit non-zero.
In .NET, what runs the delegate you pass to Task.Run, and how does a thread pool thread differ from one created with new Thread?
basics
~20 sTask.Run queues the delegate to the process's single managed thread pool, where a reused worker thread runs it. Pool threads are background threads the runtime creates and retires itself; new Thread gives you a dedicated foreground thread that you own.
In .NET, why should an invoicing service record payment and due instants as DateTimeOffset rather than DateTime, and what does DateTime.Kind fail to capture?
basics
~20 sA DateTime carries only a Kind flag (Utc, Local or Unspecified), and equality ignores it, so values from different zones mix silently. DateTimeOffset stores the UTC offset and compares by instant, though an offset is not a time zone.
In .NET, what does the C# compiler put into an assembly, and when does the JIT turn a method into machine code?
basics
~20 sThe C# compiler emits IL, a CPU-independent instruction set, plus metadata describing every type, member signature and reference. At run time the JIT compiles each method to native code on its first call, and later calls in that process reuse it.
In .NET, what are garbage-collection generations 0, 1 and 2, and how does an object move from one to the next?
basics
~20 sThe .NET GC puts new small objects in gen 0; an object that survives a gen 0 collection is promoted to gen 1, and one that survives a gen 1 collection to gen 2, which only a full (gen 2) collection reclaims.
In .NET, how do Parallel.ForEach and Parallel.ForEachAsync differ for an image-resizing job, including each one's default degree of parallelism?
basics
~20 sParallel.ForEach blocks the caller, runs an Action<T> per item on pool threads plus the calling thread, and sets no upper bound on parallelism by default. Parallel.ForEachAsync (.NET 6) returns a Task, awaits a ValueTask-returning body and defaults to Environment.ProcessorCount.
Which Laravel Octane features work only on Swoole or Open Swoole, and what happens to each if the app runs on FrankenPHP or RoadRunner?
basics
~20 sConcurrent tasks, ticks and intervals, the octane cache store and Swoole tables need Swoole or Open Swoole. Elsewhere Octane::concurrently runs tasks one after another, the octane store is a per-worker array, ticks never fire and Octane::table() throws.
In Laravel Octane, what do octane:install and the OCTANE_SERVER variable decide, and how does octane:start choose which server to launch?
basics
~10 soctane:install asks for FrankenPHP, RoadRunner or Swoole, sets up what that server needs, publishes config/octane.php and writes OCTANE_SERVER to .env. octane:start launches --server if given, otherwise config('octane.server'), on 127.0.0.1:8000.
Under Laravel Octane, how often do service providers' register() and boot() methods run, and why is reading request() or auth()->user() inside boot() a bug?
basics
~20 sUnder Octane, providers' register() and boot() run once per worker, at boot. The request then is a synthetic GET built from app.url and nobody is logged in, so whatever boot() reads from request() or auth() is wrong for real requests.
After deploying new code to a Laravel Octane server, why do you run octane:reload, and when do you need a full restart instead?
basics
~20 sOctane workers keep the old code in memory, so a deploy is ignored until they restart; octane:reload restarts them gracefully inside the running server. Options fixed at start - port, worker count, max_execution_time, the driver - need a stop and start.
After moving a Laravel banking API to Octane, some responses show the previous customer's accounts; which Octane-specific state is carrying them over, and how do you fix it?
basics
~20 sOctane clones one booted app per request, but instances resolved at boot or warmed, and static properties, are shared by every request on the worker. A singleton or static cache that memoizes the current customer serves them to the next request.