Modules interview questions

18 real Modules questions from the Node.js bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is CommonJS?

Junior
  1. A.exports is just a reference to module.exports, so reassigning exports breaks the link
  2. B.Node's original module system using require() and module.exports, loaded synchronously
  3. C.the absolute directory path of the current CommonJS module
  4. D.Node resolves a bare specifier by walking up parent node_modules directories
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.CommonJS — the absolute directory path of the current CommonJS module
  2. B.CommonJS — Node's original module system using require() and module.exports, loaded synchronously
  3. C.CommonJS — the entry file a package exposes when it is required by name
  4. D.CommonJS — exports is just a reference to module.exports, so reassigning exports breaks the link
Reveal the answer + AI explanation — free account

4. What is ES modules in Node?

Mid
  1. A.the entry file a package exposes when it is required by name
  2. B.Node's original module system using require() and module.exports, loaded synchronously
  3. C.the absolute directory path of the current CommonJS module
  4. D.import/export support enabled via .mjs or "type":"module", loaded asynchronously
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Mid
  1. A.ES modules in Node — Node resolves a bare specifier by walking up parent node_modules directories
  2. B.ES modules in Node — the entry file a package exposes when it is required by name
  3. C.ES modules in Node — Node's original module system using require() and module.exports, loaded synchronously
  4. D.ES modules in Node — import/export support enabled via .mjs or "type":"module", loaded asynchronously
Reveal the answer + AI explanation — free account

7. What is module.exports vs exports?

Mid
  1. A.import/export support enabled via .mjs or "type":"module", loaded asynchronously
  2. B.Node's original module system using require() and module.exports, loaded synchronously
  3. C.the entry file a package exposes when it is required by name
  4. D.exports is just a reference to module.exports, so reassigning exports breaks the link
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Mid
  1. A.module.exports vs exports — Node resolves a bare specifier by walking up parent node_modules directories
  2. B.module.exports vs exports — Node's original module system using require() and module.exports, loaded synchronously
  3. C.module.exports vs exports — exports is just a reference to module.exports, so reassigning exports breaks the link
  4. D.module.exports vs exports — the absolute directory path of the current CommonJS module
Reveal the answer + AI explanation — free account

10. What is require resolution?

Mid
  1. A.the absolute directory path of the current CommonJS module
  2. B.the entry file a package exposes when it is required by name
  3. C.Node's original module system using require() and module.exports, loaded synchronously
  4. D.Node resolves a bare specifier by walking up parent node_modules directories
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Mid
  1. A.require resolution — Node resolves a bare specifier by walking up parent node_modules directories
  2. B.require resolution — exports is just a reference to module.exports, so reassigning exports breaks the link
  3. C.require resolution — the absolute directory path of the current CommonJS module
  4. D.require resolution — Node's original module system using require() and module.exports, loaded synchronously
Reveal the answer + AI explanation — free account

13. What is __dirname?

Junior
  1. A.the absolute directory path of the current CommonJS module
  2. B.Node's original module system using require() and module.exports, loaded synchronously
  3. C.exports is just a reference to module.exports, so reassigning exports breaks the link
  4. D.Node resolves a bare specifier by walking up parent node_modules directories
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Junior
  1. A.__dirname — exports is just a reference to module.exports, so reassigning exports breaks the link
  2. B.__dirname — the absolute directory path of the current CommonJS module
  3. C.__dirname — the entry file a package exposes when it is required by name
  4. D.__dirname — import/export support enabled via .mjs or "type":"module", loaded asynchronously
Reveal the answer + AI explanation — free account

16. What is package.json main?

Junior
  1. A.the entry file a package exposes when it is required by name
  2. B.import/export support enabled via .mjs or "type":"module", loaded asynchronously
  3. C.exports is just a reference to module.exports, so reassigning exports breaks the link
  4. D.Node resolves a bare specifier by walking up parent node_modules directories
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Junior
  1. A.package.json main — Node resolves a bare specifier by walking up parent node_modules directories
  2. B.package.json main — the entry file a package exposes when it is required by name
  3. C.package.json main — import/export support enabled via .mjs or "type":"module", loaded asynchronously
  4. D.package.json main — exports is just a reference to module.exports, so reassigning exports breaks the link
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice Modules free