Loading

Quipoin Menu

Learn • Practice • Grow

node-js / Module Caching
mcq
Direction: Choose the correct option

Q1.

Does Node.js cache modules after the first `require()`?
A. No, they are reloaded each time
B. Only local modules are cached
C. Yes, modules are cached
D. Only core modules are cached
Direction: Choose the correct option

Q2.

If a module exports an object, and you modify it in one file, will another file see the changes?
A. No, each require gets a copy
B. Yes, because the cached object is shared
C. Only if using `global`
D. It depends
Direction: Choose the correct option

Q3.

How can you force a module to be reloaded (bypass cache)?
A. Use `require.reload()`
B. Restart the process
C. Delete the entry from `require.cache`
D. It's not possible
Direction: Choose the correct option

Q4.

Where is the module cache stored?
A. `global.cache`
B. `require.cache`
C. `process.cache`
D. `module.cache`
Direction: Choose the correct option

Q5.

What is a benefit of module caching?
A. Faster subsequent requires and singleton pattern
B. Prevents memory leaks
C. Allows dynamic code loading
D. Reduces file size