Articles

Some frequently asked NodeJS interview questions for Junior Javascript Developer

by Mayank K. mayankseo


Node.js is a single-threaded but highly scalable system that utilizes JavaScript as its scripting language. It uses asynchronous, event-driven I/O instead of separate processes or threads. It is able to achieve high output via single-threaded event loop and non-blocking I/O. Here we have listed few frequently asked NodeJS interview questions for Junior Javascript Developer

1. Using the event loop what are the tasks that should be done asynchronously?

a)   I/O operations

b) Heavy computation

c)  Anything requiring blocking

2. Why node.js is quickly gaining attention from JAVA programmers?

Node.js is quickly gaining attention as it is a loop based server for JavaScript. Node.js gives user the ability to write the JavaScript on the server, which has access to things like HTTP stack, file I/O, TCP and databases.

3. What are the two arguments that async.queue takes?

The two arguments that async.queue takes

a) Task function

b) Concurrency value

Read More Interview Related questions

4. What is an event loop in Node.js ?

To process and handle external events and to convert them into callback invocations an event loop is used. So, at I/O calls, node.js can switch from one request to another .

5. Mention the steps by which you can async in Node.js?

By following steps you can async Node.js

a) First class functions

b) Function composition

c) Callback Counters

d) Event loops

6. What are the pros and cons of Node.js?

Pros:

a) If your application does not have any CPU intensive computation, you can build it in Javascript top to bottom, even down to the database level if you use JSON storage object DB like MongoDB.

b) Crawlers receive a full-rendered HTML response, which is far more SEO friendly rather than a single page application or a websockets app run on top of Node.js.

Cons:

a) Any intensive CPU computation will block node.js responsiveness, so a threaded platform is a better approach.
b) Using relational database with Node.js is considered less favourable

7. How Node.js overcomes the problem of blocking of I/O operations?

Node.js solves this problem by putting the event based model at its core, using an event loop instead of threads.

8. What is the difference between Node.js vs Ajax?

The difference between Node.js and Ajax is that, Ajax (short for Asynchronous Javascript and XML) is a client side technology, often used for updating the contents of the page without refreshing it. While,Node.js is Server Side Javascript, used for developing server software. Node.js does not execute in the browser but by the server.

9. What are the Challenges with Node.js ?

Emphasizing on the technical side, it’s a bit of challenge in Node.js to have one process with one thread to scale up on multi core server.

10. What does it mean “non-blocking” in node.js?

In node.js “non-blocking” means that its IO is non-blocking.  Node uses “libuv” to handle its IO in a platform-agnostic way. On windows, it uses completion ports for unix it uses epoll or kqueue etc. So, it makes a non-blocking request and upon a request, it queues it within the event loop which call the JavaScript ‘callback’ on the main JavaScript thread.


Above we have listed few questions on Node js. If you are Javascript Developer and looking to prepare more questions you can visit our website https://www.onlineinterviewquestions.com




Sponsor Ads


About Mayank K. Advanced   mayankseo

177 connections, 2 recommendations, 400 honor points.
Joined APSense since, October 23rd, 2018, From DELHI, India.

Created on Nov 16th 2018 05:50. Viewed 806 times.

Comments

No comment, be the first to comment.
Please sign in before you comment.