KEMBAR78
Node JS Interview Questions | PDF
0% found this document useful (0 votes)
5 views12 pages

Node JS Interview Questions

In this totally node js interview questions with answers provided to learn about cracked your interview

Uploaded by

vedantg546
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
5 views12 pages

Node JS Interview Questions

In this totally node js interview questions with answers provided to learn about cracked your interview

Uploaded by

vedantg546
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 12
nedes INTERVIEW QUESTIONS THE KEY CONCEPT TO MASTER CED » oT @ a at_se “aa? What is Node.js ? Nodes is a javascript engine used for executing JavaScript code outside the browser commonly used to built scalable backend applications. ” What is the difference between 2 Node.js and JavaScript ? JavaScript is a scripting language, while Node js is a runtime environment that allows JavaScript to run on the server side. al sh (@! Is Node.js single-threaded? Yes, Node js is single-threaded but uses event-driven architecture and non-blocking I/O to handle multiple requests efficiently. = 9 What kind of API function is supported by Qa? ee Node.js? Node.js supports both synchronous (blocking) and asynchronous (non-blocking) API functions. oe —~_ (a8? What is a module in Node.js? A module in Node,js is a block of code that provides specific functionality, which can be reused across different parts of an application. al “as? What is npm and its advantages? npm is the default package manager for Nodejs, offering benefits like dependency management, version control, and a centralized repository. 3rd at ow “‘@ What is middleware? Middleware functions execute between the request and response cycle, performing tasks like logging, authentication, and data processing. = q How does Node.js handle concurrency e despite being single-threaded.? Node.js handles concurrency through asynchronous, non-blocking operations, allowing multiple tasks to run simultaneously within a single thread. @ a alo ee What is control flow in Node.js? Control flow refers to the order in which code statements and functions are executed, managing asynchronous operations and error handling. v x 3). What do you mean by event loop in eR Node.js? The event loop is a mechanism that processes asynchronous tasks in a single thread by continuously checking for and executing callback functions. ato e What are the main disadvantages of Node.js? Disadvantages include its single-threaded nature, preference for NoSQL databases, and rapid API changes that can cause instability. at ow ‘et What is REPL in Node.js? REPL stands for Read, Evaluate, Print, and Loop; it's an interactive environment for executing Node.js code and debugging. @ a alow “@ ? Howto import a module in Node.js? Use the ‘require() function to import external modules, storing the result in a variable for use in the application. E> a What is the difference between Node.js ee and AJAX? Node,js is a server-side runtime environment, while AJAX is a client-side technique for asynchronously updating parts of a web page. al ., ee What is package.json in Node.js? ‘package.json' is a metadata file in Node.js that contains information about the project, such as dependencies, scripts, and version. >‘ What is the most popular Node.js framework ee used these days? The most popular Node.js framework is Express.js, known for its scalability and minimalistic approach to building web applications. @ a ato ‘et What are promises in Node.js? Promises in Node.js are objects that handle asynchronous operations, providing a cleaner alternative to callback functions. % a. What is event-driven programming ei in Node.js? Event-driven programming synchronizes multiple events using event loops and callback functions to simplify program flow. al sh “gi? What is buffer in Node.js? A buffer is a temporary storage space for binary data, allowing Node.js to handle raw data directly. al sh ee What are streams in Node.js? Streams are objects used to handle continuous data flows, allowing for efficient reading and writing of data. ———— _ ® ieee AY Explain crypto module in Node.js ? The crypto module provides cryptographic functionality, such as encryption, decryption, and hashing of data. > a A e What is callback hell? Callback hell refers to the problematic situation caused by deeply nested callbacks, making code difficult to read and maintain. 3 aa Explain the use of timers module in eR Node,js. The timers module allows execution of code after a specified delay or immediately in the next event loop cycle using functions like setTimeout() and setimmediate(). Noo “(@a2al What is the difference between setimmediate() and process.nextTick() methods? process.nextTick() executes callbacks at the start of the next event loop, while setimmediate() executes them at the end of the current event loop. —— ° fk wv, ee What is the difference between setTimeout() ~ and setlmmediate() method? setTimeout() schedules a callback after a specified delay, whereas setimmediate() executes it immediately after I/O events. = 2g What is the difference between spawn() and CE fork) method? Nodejs is a javascript engine used for executing JavaScript code outside the browser commonly used to built scalable backend applications. , al » ez Explain the use of passport module in Node.js. The passport module adds authentication features to applications, supporting various sign-in methods. aly ry What is fork in Node.js? Fork is a method to create child processes that allow parallel execution of tasks in Nodejs. @ a ™ 2 What are the three methods to avoid callback hell? To avoid callback hell, use async/await, promises, or generators. ato» e What is body-parser in Node.js? Body-parser is middleware that parses incoming request bodies in a middleware before handling it in Node.js applications. ato et What is CORS in Node.js? CORS stands for Cross-Origin Resource Sharing, allowing restricted resources on a web page to be requested from another domain. ato “ese? e Explain the tls module in Node.js The tls module provides an implementation of TLS and SSL protocols to establish secure network connections. —— & 2 R “(g3%t What is a cluster in Node.js? A cluster allows Node.js to utilize multiple cores of a machine by creating child processes that share the same server port. al ee How to manage sessions in Node.js Sessions in Node.js can be managed using the express-session module, which stores session data on the server. Explain the types of streams in Node.js. Types of streams include readable, writable, duplex (both), and transform (modifies data) streams. sy ‘ + att “qael_ How can we implement authentication and GP authorization in Node.js? Use packages like Passport for authentication and JWT for managing tokens to implement security in Nodejs applications. o — &§ 9 Explain the packages used for file uploading in Node.js. Multer is a popular middleware used for handling file uploads in Nodejs. Vo = 381 How to handle database connection in Node.js? Database connections in Node.js are managed using drivers like MySQL and libraries like Mongoose for MongoDB. v “e ~ How to read command line arguments in Node.js? Use the process.argv array to access command-line arguments passed when running a Node.js application. ato ee What are child processes in Node.js? Child processes allow Node.js to handle multiple tasks concurrently by creating subprocesses that can run independently. Arn Why Learn Coding ? Quality knowledge by the best faculty Advance knowledge in advance Era The learning is free for everyone We are teaching peoples more than 2Million + Save this File for Later || ao Click Here to Join Us @® Ankush Kushwaha @® Akhilesh Kushwaha

You might also like