All questions
Showing of 57What is the V8 engine and how does Node.js use it?
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:
Last attempt -
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.
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 ↓
Explain the concept of non-blocking I/O in Node.js.
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:
Last attempt -
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.
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 ↓
What are callbacks and what is callback hell?
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:
Last attempt -
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.
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 ↓
Explain the difference between require() and import statements.
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:
Last attempt -
- 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
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 ↓
What is the module.exports vs exports difference?
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:
Last attempt -
- 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
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 ↓
What is npm and what are npm scripts?
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:
Last attempt -
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
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 ↓
Explain package.json and package-lock.json.
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:
Last attempt -
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
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 ↓
How do you read and write files in Node.js?
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:
Last attempt -
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');
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 ↓
How do you create a basic HTTP server in Node.js?
What is the difference between http and https modules?
How do you make HTTP requests in Node.js?
What is Express.js and why is it popular?
How do you handle routing in Express.js?
What is the difference between app.use() and app.get()?
How do you handle form data and JSON in Express?
How do you handle environment configuration in Node.js?
Explain the Node.js Event Loop and how it works.
What is the difference between process.nextTick() and setImmediate()?
Explain Promises in Node.js with examples.
What is async/await and how does it improve asynchronous code?
How do you handle errors in asynchronous operations?
What is the difference between Promise.all() and Promise.allSettled()?
How does Node.js resolve modules?
What are Streams in Node.js and when would you use them?
Explain the difference between fs.readFile() and fs.createReadStream().
What is the Buffer class in Node.js?
Explain request and response objects in Node.js HTTP.
What is middleware in Express.js?
How do you handle errors in Express.js?
What are some common debugging techniques in Node.js?
How do you implement caching in Node.js?
What are common security vulnerabilities in Node.js applications?
How do you implement authentication and authorization?
How do you secure API endpoints?
What is input validation and how do you implement it?
How do you implement WebSockets in Node.js?
What is Event Emitter and how do you use it?
How do you implement database connections and ORM in Node.js?
What is testing in Node.js and how do you implement it?
What is middleware pattern and how to create custom middleware?
How do you implement pagination in Node.js APIs?
How do you deploy Node.js applications?
How do you implement real-time features with Server-Sent Events (SSE)?
What is the difference between CommonJS and ES6 modules in Node.js?
How do you handle rate limiting in Node.js applications?
How do you handle uncaught exceptions and unhandled rejections?
How do you optimize performance in Node.js applications?
What is clustering in Node.js and how does it work?
What is the difference between child_process.spawn(), fork(), and exec()?
What is memory management in Node.js?
What are Worker Threads in Node.js?
What are design patterns commonly used in Node.js?
What is the difference between setImmediate(), setTimeout(), and process.nextTick()?
How do you implement graceful shutdown in Node.js?
Explain memory leaks in Node.js and how to prevent them.
What is the N-API and how does it help with native modules?
How do you implement logging and monitoring in production Node.js applications?
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
Node.js cheatsheet
- Node.js Fundamentals01
- Module System02
- Event Loop & Async Patterns03
- File System Operations04
- HTTP/HTTPS Server05
- Express.js Essentials06
- Database Integration07
- Authentication & Security08
- Error Handling09
- Testing10
- Performance Optimization11
- Common Interview Patterns12
- + 5 more inside
- + 11 more inside
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.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsDjango
Python Full-Stack DevelopmentRuby on Rails
Convention over ConfigurationServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQInterviewers also test these - they're common to every stack, whichever one you picked above.
FastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDInterviewers also test these - they're common to every stack, whichever one you picked above.
AI Engineer
LLMs, RAG, Agents, EvalsAI-Powered Developer
Claude Code, Copilot, Agentic WorkflowsCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.