LearnThatStack Ace your next interview
Backend Development

Node.js.

Start free Change topic Change
Practice · Questions

All questions

Showing of 57
Beginner 16
01

What is the V8 engine and how does Node.js use it?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

V8 is Google's open-source JavaScript engine written in C++. It compiles JavaScript directly to native machine code before executing it, making it very fast.

Node.js uses V8 to:

  • Parse and execute JavaScript code
  • Handle memory management and garbage collection
  • Provide JavaScript runtime capabilities on the server
  • Interface with system-level operations through libuv

V8 features include just-in-time (JIT) compilation, hidden class optimization, and efficient garbage collection.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

Explain the concept of non-blocking I/O in Node.js.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Non-blocking I/O means that I/O operations (like reading files, database queries, network requests) don't stop the execution of other code. Instead of waiting for an operation to complete, Node.js continues executing other code and handles the I/O result when it's ready.

// Non-blocking example
const fs = require('fs');

console.log('Start reading file');
fs.readFile('large-file.txt', (err, data) => {
    console.log('File read complete');
});
console.log('This executes immediately');

// Output: Start reading file, This executes immediately, File read complete

This allows Node.js to handle thousands of concurrent connections efficiently.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What are callbacks and what is callback hell?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Callbacks are functions passed as arguments to other functions, executed when an asynchronous operation completes. Callback hell occurs when multiple nested callbacks make code difficult to read and maintain.

// Callback hell example
getData((err, data) => {
    if (err) throw err;
    processData(data, (err, processed) => {
        if (err) throw err;
        saveData(processed, (err, result) => {
            if (err) throw err;
            console.log('Data saved successfully');
        });
    });
});

Solutions include Promises, async/await, and modularizing code into smaller functions.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

Explain the difference between require() and import statements.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
  • require(): CommonJS module system, synchronous loading, runtime evaluation
  • import: ES6 module system, static analysis, compile-time evaluation
// CommonJS (require)
const fs = require('fs');
const { readFile } = require('fs');

// ES6 Modules (import)
import fs from 'fs';
import { readFile } from 'fs';

// Dynamic import
const module = await import('./dynamic-module.js');

Key differences:

  • require() can be called conditionally; import must be at top level
  • import allows tree-shaking for smaller bundles
  • require() is synchronous; import can be asynchronous
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

What is the module.exports vs exports difference?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
  • module.exports: The actual object that gets returned when module is required
  • exports: A reference to module.exports, convenient for adding properties
// Method 1: Using exports (shorthand)
exports.add = (a, b) => a + b;
exports.subtract = (a, b) => a - b;

// Method 2: Using module.exports
module.exports = {
    add: (a, b) => a + b,
    subtract: (a, b) => a - b
};

// Method 3: Exporting a single function
module.exports = (a, b) => a + b;

// Wrong: This breaks the reference
exports = { add: (a, b) => a + b }; // Won't work
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

What is npm and what are npm scripts?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

npm (Node Package Manager) is the default package manager for Node.js, used to install, manage, and share JavaScript packages.

npm scripts are commands defined in package.json that can be executed using npm run <script-name>:

{
  "scripts": {
    "start": "node server.js",
    "dev": "nodemon server.js",
    "test": "jest",
    "build": "webpack --mode production",
    "lint": "eslint .",
    "prestart": "npm run build"
  }
}

Benefits:

  • Standardized project commands
  • Environment-specific configurations
  • Lifecycle hooks (pre/post scripts)
  • Cross-platform compatibility
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

07

Explain package.json and package-lock.json.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

package.json: Contains project metadata, dependencies, and scripts

{
  "name": "my-app",
  "version": "1.0.0",
  "dependencies": {
    "express": "^4.18.0"
  },
  "devDependencies": {
    "nodemon": "^2.0.15"
  }
}

package-lock.json: Locks exact versions of dependencies and their sub-dependencies for reproducible builds

  • Ensures consistent installs across environments
  • Contains integrity hashes for security
  • Maps exact dependency tree structure
  • Should be committed to version control
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

08

How do you read and write files in Node.js?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Node.js provides both synchronous and asynchronous methods for file operations:

const fs = require('fs');

// Asynchronous (recommended)
fs.readFile('input.txt', 'utf8', (err, data) => {
    if (err) throw err;
    console.log('File content:', data);
});

fs.writeFile('output.txt', 'Hello World', (err) => {
    if (err) throw err;
    console.log('File written successfully');
});

// Synchronous (blocking)
try {
    const data = fs.readFileSync('input.txt', 'utf8');
    fs.writeFileSync('output.txt', data.toUpperCase());
} catch (err) {
    console.error('Error:', err);
}

// Promise-based
const fsPromises = require('fs').promises;
const data = await fsPromises.readFile('input.txt', 'utf8');
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

09

How do you create a basic HTTP server in Node.js?

Part of Pro
10

What is the difference between http and https modules?

Part of Pro
11

How do you make HTTP requests in Node.js?

Part of Pro
12

What is Express.js and why is it popular?

Part of Pro
13

How do you handle routing in Express.js?

Part of Pro
14

What is the difference between app.use() and app.get()?

Part of Pro
15

How do you handle form data and JSON in Express?

Part of Pro
16

How do you handle environment configuration in Node.js?

Part of Pro
Intermediate 29
17

Explain the Node.js Event Loop and how it works.

Part of Pro
18

What is the difference between process.nextTick() and setImmediate()?

Part of Pro
19

Explain Promises in Node.js with examples.

Part of Pro
20

What is async/await and how does it improve asynchronous code?

Part of Pro
21

How do you handle errors in asynchronous operations?

Part of Pro
22

What is the difference between Promise.all() and Promise.allSettled()?

Part of Pro
23

How does Node.js resolve modules?

Part of Pro
24

What are Streams in Node.js and when would you use them?

Part of Pro
25

Explain the difference between fs.readFile() and fs.createReadStream().

Part of Pro
26

What is the Buffer class in Node.js?

Part of Pro
27

Explain request and response objects in Node.js HTTP.

Part of Pro
28

What is middleware in Express.js?

Part of Pro
29

How do you handle errors in Express.js?

Part of Pro
30

What are some common debugging techniques in Node.js?

Part of Pro
31

How do you implement caching in Node.js?

Part of Pro
32

What are common security vulnerabilities in Node.js applications?

Part of Pro
33

How do you implement authentication and authorization?

Part of Pro
34

How do you secure API endpoints?

Part of Pro
35

What is input validation and how do you implement it?

Part of Pro
36

How do you implement WebSockets in Node.js?

Part of Pro
37

What is Event Emitter and how do you use it?

Part of Pro
38

How do you implement database connections and ORM in Node.js?

Part of Pro
39

What is testing in Node.js and how do you implement it?

Part of Pro
40

What is middleware pattern and how to create custom middleware?

Part of Pro
41

How do you implement pagination in Node.js APIs?

Part of Pro
42

How do you deploy Node.js applications?

Part of Pro
43

How do you implement real-time features with Server-Sent Events (SSE)?

Part of Pro
44

What is the difference between CommonJS and ES6 modules in Node.js?

Part of Pro
45

How do you handle rate limiting in Node.js applications?

Part of Pro
Expert 12
46

How do you handle uncaught exceptions and unhandled rejections?

Part of Pro
47

How do you optimize performance in Node.js applications?

Part of Pro
48

What is clustering in Node.js and how does it work?

Part of Pro
49

What is the difference between child_process.spawn(), fork(), and exec()?

Part of Pro
50

What is memory management in Node.js?

Part of Pro
51

What are Worker Threads in Node.js?

Part of Pro
52

What are design patterns commonly used in Node.js?

Part of Pro
53

What is the difference between setImmediate(), setTimeout(), and process.nextTick()?

Part of Pro
54

How do you implement graceful shutdown in Node.js?

Part of Pro
55

Explain memory leaks in Node.js and how to prevent them.

Part of Pro
56

What is the N-API and how does it help with native modules?

Part of Pro
57

How do you implement logging and monitoring in production Node.js applications?

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for Node.js? Send them this set.
Pro · $10/mo

49 of 57 Node.js answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git