TOPIC-WISE INTERVIEW PRACTICE

Node.js interview questions and quick answers

The event loop on the server, streams, modules and building APIs with Express.

Review 1,000 questions and short answers on Node.js. Start with real examples below, then search, practise and follow links to full explanations.

1,000 questionsFree revision22 topics
START HERE

Node.js: questions worth revising first

These answers come from AI Tapri's existing question bank and published interview guides. Open each answer and read the linked in-depth guide for examples and context.

01How would you design pagination for an API endpoint that returns thousands of records?

Return a slice per request using limit and page (offset) or, for large changing data, a cursor of the last item seen. Cap the maximum limit and return total or next-page information in the response.

Read the full explanation
02How do you version a REST API, and why would you?

Versioning lets you change the API without breaking existing clients. The common way is a URL prefix such as /api/v1. Other options are a custom header or media type. Avoid breaking changes inside a version.

Read the full explanation
03Write an Express middleware that checks a JWT and protects a route.

Read the Bearer token from the Authorization header, verify it with jwt.verify, attach the claims to req.user and call next. On a missing or invalid token, respond 401 without calling next.

Read the full explanation
04Should you use await inside a for loop or Promise.all for independent tasks?

For independent tasks use Promise.all with map so they run concurrently. await inside a loop runs them one by one, which is right only when each step depends on the last or order and rate limits matter.

Read the full explanation
05What is backpressure in Node.js streams?

Backpressure is when a writable cannot consume data as fast as a readable produces it. The writable signals this, and the reader should pause, otherwise memory fills up with unwritten data.

Read the full explanation
06How does bcrypt store the salt and what does the cost factor mean?

The 60-character bcrypt hash contains the algorithm version, the cost, the 22-character salt and the hash itself, so you store one string. The cost is a power of two: each +1 doubles the work.

Read the full explanation
07What is a common pitfall related to "How would you design pagination for an API endpoint that returns thousands of records"?

Allowing limit=1000000.

Read the full explanation
08How would you explain "How would you design pagination for an API endpoint that returns thousands of records" in an interview?

"I use limit and page for simple admin lists, and cursor-based pagination for large or fast-changing data. I cap the limit, sort by a stable column, and return metadata so the client knows what comes next."

Read the full explanation
YOUR PRACTICE SPACE

Find your next answer.

Pick a topic, search a keyword, or open a question to reveal the answer.

1,000 questions available
NODE.JS

Node.js quick answers

Showing 18 of 1000
982 remaining

Free to practise. No account needed. Made for quick revision, not rote memorisation.

Keep preparing for Node.js

Quick answers help with recall; detailed guides explain the reasoning, examples and common mistakes behind each answer.

More topics to practise