By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Question What is MEAN stack? MEAN stack is an open-source technology that includes four JavaScript-based technologies including MongoDB, ExpressJS, AngularJS, Node.js (MEAN). By learning and mastering MEAN stack, you can enjoy the perks of a host of domains for developing web apps and dynamic websites. MEAN vs MERN MEAN and MERN technology stack are quite similar. Therefore, a lot of companies also ask interview questions for mern stack developers along with mean stack development. MERN is the abbreviation for MongoDB, Express, React and Node. This stack is named after the collection of technologies that it comprises – MongoDB, Express, Node.js, and React.js. MERN stack is popularly used by software developers across the world to build apps on Java script. MongoDB works as the document database, whereas Express works as the Node.js web framework, React.js is the client side data framework, and Node.js is the Javascript server. MERN stack facilitates building scalable full-stack applications. The following are some of the most popular MERN stack developer interview questions that you can expect in interviews: What is the difference between MERN Stack and MEAN Stack development? MERN and MEAN are full stack frameworks. However, there are a few key differences between the two. MEAN stack includes Angular.js whereas MERN stack has React.js. MEAN is a JavaScript development stack, and MERN is an open-source JavaScript library. While MEAN uses the regular DOM, MERN stack uses virtual DOM. What are pure components in MERN Stack? Pure components in the MERN stack can be understood as normal components. The only difference is that pure components deal with shouldComponentUpdate method. The key task of pure components is to perform a comparison on props and state whenever props or state change. What are the key features of Node.js? Node.js is an open-source server environment built on Chrome's JavaScript runtime. It is used to build applications that can be run outside a client's browser. Some of the most common applications built with Node.js are chat applications, online video streaming platforms. The key feature of Node.js include: Single-threaded- Node.js works on a single thread to handle multiple client requests. Asynchronous- A single thread deals with the client's request for a server. Once a request is handled, another request is dealt with. This facilitates non-blocking of requests. Scalability- Node.js asynchronous feature makes it highly scalable. Question How are child threads handled in Node.js? Nose.js is essentially a single-thread process and does not involve child threads. Developers do not have to worry about thread management in Node.js. However, there are certain tasks like asynchronous I/O where the developers are exposed to child threads. Such threads do not executive JavaScript code applications. Also, the main loop doesn't get blocked. This is why thread management is not an issue in Node.js. However, if developers need thread support, they can use the ChildProcess module. Question 1. What is the purpose of MongoDB? MongoDB is a document-oriented database manager designed for storing high volumes of data. It saves data in binary JSON format and implements the concept of collection and documentation. MongoDB is a cross-platform, NoSQL database equipped with high performance, high scalability, and flexibility that allow for seamless querying and indexing. Question 2. What is the purpose of ExpressJS? ExpressJS is a web application framework designed to support and host Node.js projects. It is an open-source framework available under MIT license. ExpressJS manages the workflow between the front-end and the database and facilitates a smooth and secure transfer of data. It boasts of excellent error handling and web design functionality to optimize the web development process. Question 3. What purpose does AngularJS serve? AngularJS is an open-source front-end web application development framework that is maintained by Google. It allows Web Developers to use HTML as their template language and extend HTML syntax to represent the components of a web app clearly and precisely. Question 4. What is the function of Node.js? Node.JS is an open-source, cross-platform, single-threaded JavaScript framework that is used for developing server-side and networking applications. It is the backbone of the MEAN stack. Apart from JavaScript, Node.js also used C and C++ programming languages. Node.js is equipped with an integrated web server that facilitates the smooth deployment of the MongoDB database and its cloud application. Question 5. Name the IDEs that are commonly used for Node.JS development? The most popular IDE's that can be used for Node.JS development include: Atom Cloud9 Eclipse Komodo IDE JetBrainsWebStorm JetBrains IntelliJ IDEA Question 6. What is Mongoose? Mongoose is an Object Document Mapper (ODM), which means that by using Mongoose, you can define objects with a strongly-typed schema that can be further mapped to a MongoDB document. It offers a schema-based solution for modeling application data. Mongoose comes with built-in typecasting, validation, query building, business logic hooks, and many more out-of-the-box features. Question 7. Define DATA modeling? Data modeling is a term used in the context of Mongoose and MongoDB. As the name suggests, data modeling refers to the process of creating a data model for the data at hand so it can be stored in a database. A data model is a conceptual representation of data objects, the relation among different data objects, and the rules that define those relations. Data modeling helps to represent the data visually while also enforcing business rules, regulatory compliances, and government policies on the data. It is implemented to ensure consistency in naming conventions, default values, semantics, security, and quality of the data. Question 8. What is REPL In Node.Js? REPL or 'Read Eval Print Loop' is a simple program that can accept commands, evaluate them, and prints the results. What REPL does is to create an environment that is similar to a Unix/Linux shell or a Window console, wherein you can enter command and system, and it will respond with the output. Here are the functions that REPL performs: READ – This reads the input provided by the user, parses it into JavaScript data structure, and stores it in the memory. EVAL – This executes the data structure. PRINT – This prints the outcome generated after evaluating the command. LOOP – This loops the above command until the user presses Ctrl+C twice. 9. Define Scope in JavaScript. In JavaScript, each function has a scope, which is essentially a collection of variables and rules defining how their unique name accesses those variables. You can access a function's scoped variables only through the code inside that function. While variables contained in a particular scope must have unique names, a scope can exist within another scope. In this case, the code of the innermost scope can access the variables contained in either of the scopes. Question 10. State the difference between linear search and binary search. A linear search considers a list's item's one by one without jumping sequence. So, in terms of complexity, it classifies as an O(n)search wherein the time taken to search the list increases proportionally to the increase in the list. Contrary to this, a binary search starts in the middle of a list. This search aims to see whether the item value is greater than or less than the desired value. This further determines the position of the value in the list – whether it will be in the first part or second part of the list. In terms of complexity, it classifies as an O(log n)search where the number of search operations grows relatively slowly than the list. This is mainly because the search space is broken into half in each operation. While binary search requires you to sort the input data first, a linear list doesn't have any such prerequisites. Question 11. Highlight the difference between Node.js, AJAX, and jQuery. Node.js, AJAX, and jQuery are all advanced implementation of JavaScript. However, they have a fair share of differences. Node.js is a server-side platform that is used for developing client-server applications while AJAX, a.k.a. Asynchronous Javascript and XML is a client-side scripting technique that is primarily used for rendering the contents of a page without refreshing it. AJAX is used mainly to showcase dynamic content. jQuery is a JavaScript module that complements AJAX, DOM traversal, and looping. It is loaded with many useful functions to aid JavaScript development. Question 12. Define Dependency Injection. Dependency Injection is a software design concept that allows you to use or inject a service in ways that are independent of any client consumption. By doing so, you essentially prevent the client from modifying dependencies when the underlying service changes. The primary purpose of dependency injection is to separate the creation of clients' dependencies from their behavior, thereby letting you design loosely coupled programs. In a loosely coupled program, the components usually consume functionality defined by interfaces without having any prior knowledge of which implementation classes are being used. Dependency injection allows you to modify or tweak the behavior of an application by altering the components that implement the interfaces defining an application's features. Question 13. Define Containerization. Containerisation is an alternative to traditional hypervisor-based machine virtualization involving the encapsulation of an application in a container within its own operating environment. In containerization, instead of cloning an operating system for individual virtual machines, it is shared by the different containers. By loading an application in a virtual machine, you can run the app on any suitable physical machine without having to worry about dependencies. Question 14. Define a Test Pyramid. How can you actualize a Test Pyramid when discussing HTTP APIs? Usually, full-stack web apps are large and complex. They are designed to expand their functionalities to serve hundreds of different requirements of millions of users. Consequently, as the size of a full-stack codebase and the number of users grow, the cost of dealing with bugs also escalates. This, however, can be successfully mitigated by applying the concept of the test pyramid to your codebase. The test pyramid approach implies a radical way of thinking as to how different kinds of automated tests can and should be used to create a balanced portfolio. It emphasizes that the number of low-level UnitTests should be much more than high-level BroadStackTests running through a GUI. When discussing HTTP APIs, you can actualize a test pyramid by following the steps mentioned below: Incorporate plenty of low-level unit tests for your model. Include fewer joining tests used for determining how your models collaborate with each other. Include fewer acknowledgment tests used for testing genuine HTTP endpoints.
Question 15. What purpose do Indexes serve in MongoDB? In MongoDB, indexes are used to support and facilitate the efficient execution of queries. Without indexes, MongoDB has to perform a collection scan wherein it has to scan every document in a collection and select the appropriate documents that match the query statement. However, if each query has an appropriate index assigned to it, MongoDB can use the index to limit the number of documents it has to inspect. Question 16. What is the difference between Classes and Interfaces in TypeScript? Classes and interfaces are structures that promote both object-oriented programming and also type-checking in TypeScript. While a class is a blueprint from which you can create a group of objects sharing the same configuration (properties and methods), an interface is a group of related properties and methods that describe an object. However, an interface does not provide implementation or initialization for the objects. Typically, a class defines what an object should look like and act like, and accordingly, it creates and implements a blueprint by initializing the class properties and defining methods. Classes are present throughout all the phases of a code. An interface, on the other hand, is a virtual structure that exists only within the context of TypeScript. The TypeScript compiler uses interfaces exclusively for type-checking. Question 17. Define 'Decorators' in TypeScript. In TypeScript, a Decorator refers to a special kind of declaration that is usually attached to a class declaration, method, accessor, property, or parameter. Decorators are functions that take their target as an argument. They allow you to run arbitrary code around the target execution or even replace the target with a new definition altogether. Question 18. What is meant by 'Callback' in Node.js? In Node.js, a callback is an asynchronous equivalent for a function. Node.js heavily relies on callbacks that are called at the culmination or completion of a given task. For instance, let's assume a function that is designed for reading files may start reading files and immediately return the control to the execution environment to facilitate the execution of the next instruction. Once the file I/O is complete, the callback function is set in motion and pass the content of the file as a parameter. This makes sure that there's no blocking or waiting for the file I/O. It is this feature that makes Node.js highly scalable since it can process a high number of requests without waiting for the results of any function. All Node APIs are written in ways that they can support callbacks. Question 19. Define Cross-site Scripting (XSS). Cross-site Scripting (XSS) is a client-side code injection attack wherein the malicious scripts are executed in a web browser by including malicious code in a legitimate web page or web application. It can also occur when an individual clicks on untrusted links that can pass cookies and other sensitive information to attackers. The attack happens when you visit a webpage or a web app that executes malicious code. Hence, the webpage or web app becomes a vehicle to deliver malicious scripts to the browser of a user. The most commonly used vehicles for cross-site scripting attacks are forums, message boards, and even web pages that encourage users to comment. Question 20. Define AOT and mention its benefits. Angular applications contain HTML templates alongside the standard components. Since the browser cannot directly understand these components and HTML templates, Angular apps must be compiled first before you can run them in a browser. The Angular ahead-of-time (AOT)compiler converts the Angular HTML and TypeScript code into JavaScript code during the build phase before the browser can download and runs the code. By compiling the Angular application in the build stage, you encourage the faster launch of Angular apps in the browser. The benefits of using AOT compiler are: By using AOT, the browser can download a pre-compiled version of the application. The browser downloads executable code so that it can render the Angular application immediately, without waiting for the app to compile first. Thanks to AOT, the compiler inlines external HTML templates and CSS style sheets within the application JavaScript, thereby eliminating separate AJAX requests for source files. During the build stage itself, the AOT compiler detects and reports any template binding errors. Since AOT compiles HTML templates and components into JavaScript files before serving them to clients, there remain no more templates to read and even no risky client-side HTML/JavaScript evaluation. This reduces the possibilities of injection attacks. Question 21. What is a Grid System in CSS? In CSS, a grid system is a structure that is used for stacking content both vertically and horizontally in a consistent and manageable manner. Grid systems have two core components – rows and columns. Some of the most used grid systems include Simple, Pure, Flexbox, Bootstrap, and Foundation.
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.