Category Archives: Techbeamers

Regression Testing – Learn Pros and Cons, Challenges and Steps for Execution

Today, we’ll learn “What is Regression testing?” and “Why is it important?“. Regression testing is an incremental testing approach which confirms the new changes didn’t break the system or its components in spite of they are still in development. This method is incremental in nature because every change or introduction of a new feature adds up a new set of test cases to the regression testing scope.

The developers may not find it conducive as not only they have to fix issues reported via regression but also maintain a sync with the QA on changes impacting the system behavior. However, it also poses a challenge for the testers too for selecting cases that are more relevant, realistic, and repetitive.

read more

Regression Testing – Learn Pros and Cons, Challenges and Steps for Execution

Today, we’ll learn “What is Regression testing?” and “Why is it important?“. Regression testing is an incremental testing approach which confirms the new changes didn’t break the system or its components in spite of they are still in development. This method is incremental in nature because every change or introduction of a new feature adds up a new set of test cases to the regression testing scope.

The developers may not find it conducive as not only they have to fix issues reported via regression but also maintain a sync with the QA on changes impacting the system behavior. However, it also poses a challenge for the testers too for selecting cases that are more relevant, realistic, and repetitive.

read more

Top 30 Node.js Interview Questions with Answers

Are you a MEAN stack developer and have an interview lined up? Don’t worry, just read the top 30 Node.js interview questions we’ve outlined in this post.

We’ve tried our best to keep the answers easy to understand and simple to remember. All of our questions are thoroughly researched and have a potential to surface in most Node.js interviews.

However, you would also prepare yourself for AngularJS interview questions as it is the next most important skill you’ll need to become an ideal MEAN stack developer. In out next posts, we’ll also cover other areas where you need to centralize your focus.

Let’s now begin to read to the most important Node.js interview questions and answers.

Top 30 Node.js Interview Questions & Answers.

Top 30 Node.js Interview Questions with Answers

Prepare for Node.js Interview.

Q-1. What is Node.js?


Node.js is a JavaScript runtime or platform which is built on Google Chrome’s JavaScript v8 engine. This runtime allows executing the JavaScript code on any machine outside a browser (this means that it is the server that executes the Javascript and not the browser).

Node.js is single-threaded, that employs a concurrency model based on an event loop. It doesn’t block the execution instead registers a callback which allows the application to continue. It means Node.js can handle concurrent operations without creating multiple threads of execution so can scale pretty well.

It uses JavaScript along with C/C++ for things like interacting with the filesystem, starting up HTTP or TCP servers and so on. Due to it’s extensively fast growing community and NPM, Node.js has become a very popular, open source and cross-platform app. It allows developing very fast and scalable network app that can run on Microsoft Windows, Linux, or OS X.

Following are the areas where it’s perfect to use Node.js.

  • I/O bound Applications
  • Data Streaming Applications
  • Data Intensive Real-time Applications (DIRT)
  • JSON APIs based Applications
  • Single Page Applications

At the same time, it’s not suitable for heavy applications involving more of CPU usage.

Q-2. What are the key features of Node.js?


Let’s look at some of the key features of Node.js.

  • Asynchronous event driven IO helps concurrent request handling – All APIs of Node.js are asynchronous. This feature means that if a Node receives a request for some Input/Output operation, it will execute that operation in the background and continue with the processing of other requests. Thus it will not wait for the response from the previous requests.
  • Fast in Code execution – Node.js uses the V8 JavaScript Runtime engine, the one which is used by Google Chrome. Node has a wrapper over the JavaScript engine which makes the runtime engine much faster and hence processing of requests within Node.js also become faster.
  • Single Threaded but Highly Scalable – Node.js uses a single thread model for event looping. The response from these events may or may not reach the server immediately. However, this does not block other operations. Thus making Node.js highly scalable. Traditional servers create limited threads to handle requests while Node.js creates a single thread that provides service to much larger numbers of such requests.
  • Node.js library uses JavaScript – This is another important aspect of Node.js from the developer’s point of view. The majority of developers are already well-versed in JavaScript. Hence, development in Node.js becomes easier for a developer who knows JavaScript.
  • There is an Active and vibrant community for the Node.js framework – The active community always keeps the framework updated with the latest trends in the web development.
  • No Buffering – Node.js applications never buffer any data. They simply output the data in chunks.

Q-3. Explain how do we decide, when to use Node.js and when not to use it?


When should we use Node.js?

It’s ideal to use Node.js for developing streaming or event-based real-time applications that require less CPU usage such as.

  • Chat applications.
  • Game servers.

Node.js is good for fast and high-performance servers, that face the need to handle thousands of user requests simultaneously.

Good for a collaborative environment.

It is suitable for environments where multiple people work together. For example, they post their documents, modify them by doing check-out and check-in of these documents.

Node.js supports such situations by creating an event loop for every change made to the document. The “Event loop” feature of Node.js enables it to handle multiple events simultaneously without getting blocked.

Advertisement servers.

Here again, we have servers that handle thousands of request for downloading advertisements from a central host. And Node.js is an ideal solution to handle such tasks.

Streaming servers.

Another ideal scenario to use Node.js is for multimedia streaming servers where clients fire request’s towards the server to download different multimedia contents from it.

To summarize, it’s good to use Node.js, when you need high levels of concurrency but less amount of dedicated CPU time.

Last but not the least, since Node.js uses JavaScript internally, so it fits best for building client-side applications that also use JavaScript.

When to not use Node.js?

However, we can use Node.js for a variety of applications. But it is a single threaded framework, so we should not use it for cases where the application requires long processing time. If the server is doing some calculation, it won’t be able to process any other requests. Hence, Node.js is best when processing needs less dedicated CPU time.

Q-4. What IDEs can you use for Node.js development?


Here is the list of most commonly used IDEs for developing node.js applications.


It is a free, cloud-based IDE that supports, application development, using popular programming languages like Node.js, PHP, C++, Meteor and more. It provides a powerful online code editor that enables a developer to write, run and debug the app code.

JetBrains WebStorm.

WebStorm is a lightweight yet powerful JavaScript IDE, perfectly equipped for doing client-side and server-side development using Node.js. The IDE provides features like intelligent code completion, navigation, automated and safe refactorings. Additionally, we can use the debugger, VCS, terminal and other tools present in the IDE.

JetBrains InteliJ IDEA.

It is a robust IDE that supports web application development using mainstream technologies like Node.js, Angular.js, JavaScript, HTML5 and more. To enable the IDE that can do Node.js development we have to install a Node.js plugin. It provides features, including syntax highlighting, code assistance, code completion and more. We can even run and debug Node.js apps and see the results right in the IDE. It’s JavaScript debugger offers conditional breakpoints, expression evaluation, and other features.

Komodo IDE.

It is a cross-platform IDE that supports development in main programming languages, like Node.js, Ruby, PHP, JavaScript and more. It offers a variety of features, including syntax highlighting, keyboard shortcuts, collapsible Pane, workspace, auto indenting, code folding and code preview using built-in browser.


It is a popular cloud-based IDE for web development using Java, PHP, C++ and more. You can easily avail the features of Eclipse IDE using the Node.js plug-in, which is <nodeclipse>.


It is an open source application built with the integration of HTML, JavaScript, CSS, and Node.js. It works on top of Electron framework to develop cross-platform apps using web technologies. Atom comes pre-installed with four UI and eight syntax themes in both dark and light colors. We can also install themes created by the Atom community or create our own if required.

Q-5. Explain how does Node.js work?


A Node.js application creates a single thread on its invocation. Whenever Node.js receives a request, it first completes its processing before moving on to the next request.

Node.js works asynchronously by using the event loop and callback functions, to handle multiple requests coming in parallel. An Event Loop is a functionality which handles and processes all your external events and just converts them to a callback function. It invokes all the event handlers at a proper time. Thus, lots of work is done on the back-end, while processing a single request, so that the new incoming request doesn’t have to wait if the processing is not complete.

While processing a request, Node.js attaches a callback function to it and moves it to the back-end. Now, whenever its response is ready, an event is called which triggers the associated callback function to send this response.

Let’s take an example of a grocery delivery.

Usually, the delivery boy goes to each and every house to deliver the packet. Node.js works in the same way and processes one request at a time. The problem arises when any one house is not open. The delivery boy can’t stop at one house and wait till it gets opened up. What he will do next, is to call the owner and ask him to call when the house is open. Meanwhile, he is going to other places for delivery. Node.js works in the same way. It doesn’t wait for the processing of the request to complete (house is open). Instead, it attaches a callback function (call from the owner of the house) to it. Whenever the processing of a request completes (the house is open), an event gets called, which triggers the associated callback function to send the response.

To summarize, Node.js does not process the requests in parallel. Instead, all the back-end processes like, I/O operations, heavy computation tasks, that take a lot of time to execute, run in parallel with other requests.

Q-6. Explain REPL in Node.js?


The REPL stands for “Read Eval Print Loop”. It is a simple program that accepts the commands, evaluates them, and finally prints the results. REPL provides an environment similar to that of Unix/Linux shell or a window console, in which we can enter the command and the system, in turn, responds with the output. REPL performs the following tasks.

  • READ
    • It Reads the input from the user, parses it into JavaScript data structure and then stores it in the memory.
    • It Executes the data structure.
    • It Prints the result obtained after evaluating the command.
    • It Loops the above command until the user presses Ctrl+C two times.

    Q-7. Is Node.js entirely based on a single-thread?


    Yes, it’s true that Node.js processes all requests on a single thread. But it’s just a part of the theory behind Node.js design. In fact, more than the single thread mechanism, it makes use of events and callbacks to handle a large no. of requests asynchronously.

    Moreover, Node.js has an optimized design which utilizes both JavaScript and C++ to guarantee maximum performance. JavaScript executes at the server-side by Google Chrome v8 engine. And the C++ lib UV library takes care of the non-sequential I/O via background workers.

    To explain it practically, let’s assume there are 100s of requests lined up in Node.js queue. As per design, the main thread of Node.js event loop will receive all of them and forwards to background workers for execution. Once the workers finish processing requests, the registered callbacks get notified on event loop thread to pass the result back to the user.

    Q-8. How to get Post Data in Node.js?


    Following is the code snippet to fetch Post Data using Node.js.

    app.use(express.bodyParser());'/', function(request, response){

    Q-9. How to make Post request in Node.js?


    Following code snippet can be used to make a Post Request in Node.js.

    var request = require('request');
    { form: { key: 'value' } },
    function (error, response, body) {
    if (!error && response.statusCode == 200) {

    Q-10. What is Callback in Node.js?


    We may call “callback” as an asynchronous equivalent for a function. Node.js makes heavy use of callbacks and triggers it at the completion of a given task. All the APIs of Node.js are written in such a way that they support callbacks.

    For example, suppose we have a function to read a file, as soon as it starts reading the file, Node.js return the control immediately to the execution environment so that the next instruction can be executed. Once file read operation is complete, it will call the callback function and pass the contents of the file as its arguments. Hence, there is no blocking or wait, due to File I/O. This functionality makes Node.js as highly scalable, using it processes a high number of requests without waiting for any function to return the expected result.

    Q-11. What is Callback Hell?


    Initially, you may praise Callback after learning about it. Callback hell is heavily nested callbacks which make the code unreadable and difficult to maintain.

    Let’s see the following code example.

    downloadPhoto('', displayPhoto)
    function displayPhoto (error, photo) {
    if (error) console.error('Download error!', error)
    else console.log('Download finished', photo)
    console.log('Download started')

    read more

50 Most Important AngularJS Interview Questions for 100% Success

Got an AngularJS interview lined up? Don’t worry, just read the 50 most important AngularJS interview questions we’ve outlined in this post.

We’ve made sure the answers are easy to understand and simple to remember. Hopefully, this exposure will make you better prepared for the interview.

But don’t forget that success not only depends on your technical skills but your behavior matters too. Hence, if you want to be a cut above the rest, then prepare in advance, practice more, and perform well.

Let’s now move to the AngularJS Q&A section.

50 Most Important AngularJS Interview Questions.

AngularJS Interview Questions & Answers.

50 Latest AngularJS Interview Questions and Answers

AngularJS Interview Questions.

Q-1. What is AngularJS?


  • It has been developed by one of the biggest technology giants Google. It is a JavaScript framework that helps you to create dynamic Web applications.
  • It supports to use HTML as the template language and enables the developer to create extended HTML tags that help to represent the application’s components clearly. These tags make the code efficient by reducing the lines of code that a
  • developer may require to write when using JavaScript.
  • It is open-source and is licensed under the Apache License version 2.0.
  • It helps to develop an easy to maintain architecture that can be tested at client side code.

Q-2. What are the key features of AngularJS?


Here is the list of AngularJS features that makes it the hottest tech for web dev.

  • Data-binding – Handles synchronization of data across model, controllers, and view.
  • Scope – Object representing the model, acts as a glue layer between controller and view.
  • Controllers – JS functions bound to the scope object.
  • Services – Substitutable objects that are wired together using dependency injection. e.g. $location service.
  • Filters – Formats the value of an expression for displaying to the user. e.g. uppercase, lowercase.
  • Directives – These are extended HTML attributes start with the “ng-” prefix. e.g. ng-app directive used to initialize the angular app.
  • Templates – HTML code including AngularJS specific elements and attributes.
  • Routing – It’s an approach to switch views.
  • MVC pattern – A design pattern made up of three parts.
    • Model – Represents data, could be static data from a JSON file or dynamic data from a database.
    • View – Renders data for the user.
    • Controller – Gives control over the model and view for collating information to the user.
    Deep linking – Enables the encoding of the application state in the URL and vice versa. Dependency injection – A design pattern to let the components injected into each other as dependencies.

    Q-3. Explain the reasons that compel a web developer to choose AngularJS for his Web Development Project?


    Following are some of the key reasons to choose AngularJS as you web development framework:

    • It uses MVC design pattern which allows segregating an application into different components (called Model, View, and Controller) thus making it easy to maintain.
    • It allows extending the HTML by attaching directives to your HTML markup. This provides the capability to define new powerful templates having new attributes, tags, and expressions.
    • It allows you to create your own directives and also make reusable components. Directives help the developer to concentrate on creating logic, thus enabling them to work efficiently.
    • It supports two-way data binding i.e. enables automatic synchronization of data between model and view components. Thus, any update in the model gets reflected in the view automatically. And there is no need to add any Javascript code or event listeners to reflect the data changes.
    • It encapsulates the behavior of your application in controllers which gets instantiated with the help of dependency injection.
    • It supports built-in services that perform the common tasks for web applications. For example, it provides $http service to communicate with REST service.
    • It makes the development and testing of the application’s JavaScript code easy.
    • Also, AngularJS has a mature community to help the developers. It has wide support over the internet.

    Q-4. List down the popular AngularJS IDE Plugins/Extensions for web development?


    Here is a list of IDE Plugins and Extensions which can enhance the way you code with AngularJS:

    • Sublime Text
    • WebStorm
    • Eclipse
    • Netbeans
    • Visual Studio 2012/2013 Express or higher
    • TextMate
    • Brackets
    • ATOM

    Q-5. Explain the steps involved in the boot process for AngularJS?


    Whenever a web page loads in the browser, following steps execute in the background.

    • First, the HTML file containing the code gets loaded into the browser. After that, the JavaScript file mentioned in the HTML code gets loaded. It then creates a global object for angular. Now, the JavaScript which displays the controller functions gets executed.
    • In this step, AngularJS browses the complete HTML code to locate the views. If a view is found, it is linked it to the corresponding controller function.
    • In this step, AngularJS initiates the execution of required controller functions. Next, it populates the views with data from the model identified by the controller. With this the page is ready.

    Q-6. What browsers do AngularJS support?


    AngularJS works fine with the latest versions of Safari, Chrome, Firefox, Opera 15+, and IE9+ (Internet Explorer).
    It also supports various mobile browsers like Android, Chrome Mobile, iOS Safari, and Opera Mobile.

    Note: Versions 1.3 and later of AngularJS dropped support for Internet Explorer 8.

    Q-7. What are the security features provided by AngularJS?


    AngularJS provides built-in protection from the following security flaws.

    • It prevents cross-side scripting attacks: Cross-site scripting is a technique where anyone can send a request from client side and can get the confidential information easily.
    • It prevents HTML injection attacks.
    • It prevents XSRF protection for server side communication: It can be handled by “Auth token” mechanism. When the user logins for the first time a user id and password is sent to the server and it will, in turn, return an auth token. Now, this token does the authentication in the future transactions.

    Q-8. What are the web application security risks that a web developer should avoid while doing development using AngularJS?


    Following are the most critical web application development flaws that a developer should take care of:

    • Injection attack.
    • Broken Authentication and Session Management.
    • Cross-Site Scripting (XSS)
    • Insecure direct object references.
    • Security misconfiguration.
    • Sensitive Data Exposure.
    • Missing Functions Level Access Control.
    • Cross Site Request Forgery (CSRF).
    • Using components that possess vulnerabilities.
    • In-validated redirects and forwards.

    Q-9. Explain what are directives? Mention some of the most commonly used directives in AngularJS application?


    AngularJS extends the behavior of HTML and DOM elements with new attributes called Directives. It directs the AngularJS’s HTML compiler ($compile) to attach a special behavior to that DOM element. This AngularJS component starts with prefix “ng”.

    Following is the list of AngularJS built-in directives.

    • ng-bind – The ng-bind directive tells AngularJS to replace the content of an HTML element with the value of a given variable, or expression.
      If there is any change in the value of the given variable or expression, then the content of the specified HTML element will also be updated accordingly. It supports one-way binding only.
    • ng-model – This directive is used to bind the value of HTML controls (input, select, text area) to application data. It is responsible for binding the view into the model, which other directives such as input, text area, and select require. It supports two-way data binding.
    • ng-class – This directive dynamically binds one or more CSS classes to an HTML element. The value of the ng-class directive can be a string, an object, or an array.
    • ng-app – Just like the “Main()” function of Java language, this directive marks the beginning of the application to AngularJS’s HTML compiler ($compile). If we do not use this directive first, an error gets generated.
    • ng-init – This is used to initialize the application data so that we can use it in the block where it is declared. If an application requires local data like a single value or an array of values, this can be achieved using the ng-init directive.
    • ng-repeat – This repeats a set of HTML statements for defined number of times. The set of HTML statements will be repeated once per item in a collection. This collection must be an array or an object.

    We can even create our own directives too and use them in our AngularJS Application.

    Q-10. What are expressions in AngularJS?


    AngularJS binds data to HTML using Expressions. It can be written inside double braces: {{ expression}} or inside a directive as ng-bind=”expression”. AngularJS solves the expression and returns the result exactly where that expression is written.

    AngularJS expressions are much like JavaScript expressions: it can contain literals, operators, and variables.

    For example –

    {{ 2 + 2 }} (numbers)
    {{Name + " " + email}} (string)
    {{ Country.Name }} (object)
    {{ fact[4] }} (array)

    Q-11. What are Filters? Explain different filters provided by AngularJS?


    An AngularJS Filter changes or transforms the data before passing it to the view. These Filters work in combination with AngularJS expressions or directives. AngularJS uses pipe character (“|”) to add filters to the expressions or directives. For example:

    <p> {{ bid | currency }} </p>

    The above example is an expression enclosed in the curly braces. The filter used in this expression is currency. Also important to note that filters are case-sensitive.

    AngularJS provides following filters to transform data.

    • currency – It is used to format a number to a currency format.
    • date – It is required to format a date to a specified format.
    • filter – It chooses a subset of items from an array.
    • json – It formats an object to a JSON string.
    • limitTo – Its purpose is to create an array or string containing a specified number of elements/characters. The elements are selected, either from the beginning or the end of the source array or string. This depends on the value and sign (positive or negative) of the limit.
    • lowercase – This filter converts a string to lower case.
    • number – It formats a number as a text.
    • orderBy – It enables to sort an array. By default, sorting of strings happens alphabetically. And sorting of numbers is done numerically. It also supports a comparator function where we can define what will be counted as a match or not.
    • uppercase – This filter converts a string to upper case.

    Q-12. What are angular prefixes $ and $$?


    To prevent accidental name collisions within the code, AngularJS prefixes the names of public objects with $ and the names of private objects with $$.

    It is recommended that $ or $$ prefix should not be used in the code otherwise.

    Q-13. What are different ways to invoke a directive?


    There are four different ways to invoke a directive in an angular application which are as follows.

    1) As an attribute:

    <span my-directive></span>

    2) As a class:

    <span class="my-directive: expression;"></span>

    3) As an element:


    4) As a comment:

    <!-- directive: my-directive expression -->

    Q-14. What is Singleton pattern? How does Angular use it?


    A singleton pattern is an approach that we adopt to limit the instantiation of a Class to have only one object. In Angular, the dependency injection and the services implement the singleton pattern.

    Technically, if we call the “new Class()” two times without following the singleton pattern, the outcome will be two objects of the same class. Whereas a singleton enabled class will create the object first time and return the same object onwards.

    Q-15. What is $scope in AngularJS?


    It is an application object. And behaves as the owner of the apps variables and functions. Scope object has access to both View and controller. Thus it works as a medium of communication between both of them. This object contains both data and functions. We can use it to access model data of the controller.

    Following are the key characteristics of the scope object.

    • It provides observers to watch for all the model changes.
    • Provides the ability to propagate model changes through the application as well as outside the system to other associated components.
    • Scopes can be nested in such a way that they can isolate functionality and model properties.
    • Provides an execution environment in which expressions are evaluated.

    Q-16. What is “$rootScope” in AngularJS?


    Every AngularJS application has a “$rootScope” that is the top most scope created on the DOM element. An app can have only one $rootScope which will be shared among all its components. It contains the ng-app directive. Every other scope is its child scope. It can watch expressions and propagate events. Using root scope we can set the value in one controller and read it from the other controller.

    Q-17. Explain the concept of scope hierarchy? How many scopes can an application have?


    Every AngularJS application consists of one root scope but may have several child scopes. As child controllers and directives create new child scopes, they get attached to the application. These new scopes get added as children of their parent scope. Similar to DOM, they also create a hierarchical structure.

    Q-18. What is SPA (Single page application) in AngularJS?


    Single-Page Applications (SPAs) are web applications that fit on a single HTML page. It dynamically updates the web page as the user performs actions on the app.

    SPAs use AJAX and HTML to create quick and responsive web apps. A single page load extracts all the web app code (JS, HTML, CSS).

    Thus the user navigates to different parts of the application quickly as it happens without refreshing the whole page.

    Key Characteristics of Single-Page Applications are as follows.

    • Its UI is fast and responsive. Also, the Back/Forward buttons present in the UI work properly.
    • IT contains more JavaScript code than actual HTML as compared to other applications.
    • Dynamic data loading occurs from the server-side. The API uses restful web service with JSON format.
    • It allows to pre-load and cache all the app pages. Thus fewer data download requests are made towards the server.
    • Applications written in AngularJS are cross-browser compliant. It automatically handles the JavaScript code suitable for each browser.
    • Even if the user has lost the internet connection, then also the SPA can work. As all the pages load in the starting itself.

    Q-19. What is the difference between <$scope> and scope?


    It is mandatory to use <$scope> while defining a controller. However, the “scope” will be used to create a link function for the custom directive. Both of them refer to “scope” object in AngularJS. The difference between them is that <$scope> uses dependency injection whereas “scope” does not.

    Factory methods like controller, filter, service etc receive its arguments via dependency injection (DI). In DI, the order of passing the arguments does not matter. For example, a controller may be defined as (let’s define $scope as the first parameter in this case):

    myApp.controller(‘MyController’, [‘$scope’, function($scope, $http) {
    //rest of the code goes here }

    OR ( if $scope is the second parameter)

    myApp.controller(‘MyController’, [‘$scope’, function($http, $scope) {
    //rest of the code goes here }

    read more

Quick Steps to Install MySQL on Windows 7 and Things to Do Next

MySQL is free, open source, and easily available for download. It is usually the first choice of most Web developers for learning SQL and database. Many large websites and hosting companies rely on using MySQL as their backend. Here we are outlining the simple steps to install MySQL on Windows 7.

Not only does it support multiple platforms but allows quick integration with a no. of programming languages like Java, C#, and Python. In our last tutorial, we’d laid down the steps to install MySQL on Ubuntu platform. If Linux is the alternate operating system you use, then it’s worth reading this tutorial to get a head-start on using MySQL.

read more