node js coding questions code example
Example 1: node js interview questions
What is Node.js? What is it used for?
Q2. What is Event-driven programming?
Q3. What is Event loop in Node.js work? And How does it work?
Q4. What is REPL in Node.js?
Q5. What is the purpose of module.exports in Node.js?
Q6. What is the difference between Asynchronous and Non-blocking?
Q7. What is Tracing in Node.js?
Q8. How will you debug an application in Node.js?
Q9. Difference between setImmediate() vs setTimeout()
Q10. What is process.nextTick()
vent loop continues.
Q11. What is package.json? What is it used for?
Q12. What is libuv?
libuv is a multi-platform support library with a focus on asynchronous I/O. It was primarily developed for use by Node.js, but it’s also used by Luvit, Julia, pyuv, and others.
When the node.js project began in 2009 as a JavaScript environment decoupled from the browser, it is using Google’s V8 and Marc Lehmann’s libev, node.js combined a model of I/O – evented – with a language that was well suited to the style of programming; due to the way it had been shaped by browsers. As node.js grew in popularity, it was important to make it work on Windows, but libev ran only on Unix. libuv was an abstraction around libev or IOCP depending on the platform, providing users an API based on libev. In the node-v0.9.0 version of libuv libev was removed.
Some of the features of libuv are:
Full-featured event loop backed by epoll, kqueue, IOCP, event ports.
Asynchronous TCP and UDP sockets
Asynchronous file and file system operations
Child processes
File system events
Q13. What are some of the most popular modules of Node.js?
There are many most popular, most starred or most downloaded modules in Node.js. Some of them are:
express
async
browserify
socket.io
bower
gulp
grunt
Q14. What is EventEmitter in Node.js?
All objects that emit events are instances of the EventEmitter class. These objects expose an eventEmitter.on() function that allows one or more functions to be attached to named events emitted by the object.
When the EventEmitter object emits an event, all of the functions attached to that specific event are called synchronously.
Example 2: node js interview questions
what is a monolith server
what does mean by async and sync in javascript https://youtu.be/h0ZUpPiV1ac?t=569
A higher order function which takes function as an argument
"handlebars is a template engine like Jade.
Vash.
EJS.
Mustache.
Dust.js.
Nunjucks.
Handlebars.
atpl"
ES6 features
OOP programming in nodejs
how to allow cors in nodejs server using express and http module and cors module
what is refrential transparency https://www.google.com/search?q=referential+transparency&oq=refrential+tra&aqs=chrome.1.69i57j0i10l7.5812j0j1&sourceid=chrome&ie=UTF-8
What is difference between REST API and RESTful API?