Photo from Unsplash (

JavaScript is changing every year. There are always new libraries, new frameworks and new things around it. Every year new developers are coming to learn this language and the jobs are increasing so as the interviews.

This post contains some practical and commonly asked coding problems that can be found in any technical interviews. So be not surprised while facing them.

Remove duplicate element from an array

Using Array.filter method, check each element's index is equal to the indexOf value of the array.

Or in ES6 using set:

Reverse a string without native methods

Given a string, print the reverse of the string (ex: javascript becomes tpircsavaj).

Without native methods:

Q1. What is Vue.js? What are the advantages of it?

Vue is a progressive framework used to building user interfaces.The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or existing projects.

Following are the advantages of using Vue.js.

  • Small in size — The size of this framework is 18 to 21KB and it takes no time for the user to download and use it.
  • Easy to Understand — One of the reasons for the popularity of this framework is that it is quite easy to understand. The user…

Q1. What is MongoDB and Why we need MongoDB?

MongoDB is the most famous NoSQL open source database management system. It is written in C++ language and developed by MongoDB Inc.

MongoDB is a document oriented database which means it stores the data in BSON format which is a binary representation of JSON and it contains more data types than JSON.

Q1. What are the differences between null and undefined?

In JavaScript, undefined means, the value of the variable is not yet defined. And typeof undefined is also "undefined". We are getting undefined in JavaScript in some ways, like: declaring a variable without assigning any value to it, store a function return value to a variable but the function does not return anything, return statement does not return any values, a function parameter does not passed and the global variable undefined.

null means empty or non-existent value which is used to indicate “no value”. …

Q1. How React works? How Virtual-DOM works in React?

React creates a virtual DOM. When state changes in a component it firstly runs a “diffing” algorithm, which identifies what has changed in the virtual DOM. The second step is reconciliation, where it updates the DOM with the results of diff.

The HTML DOM is always tree-structured — which is allowed by the structure of HTML document. The DOM trees are huge nowadays because of large apps. Since we are more and more pushed towards dynamic web apps (Single Page Applications — SPAs), we need to modify the DOM tree incessantly…

Q1. What is ES or ECMAScript or ES6?

When JavaScript was developed, the name itself was chosen for marketing reasons since Java was getting popular around the time. But to standardize the language and its specification, it was submitted to ECMA international (European Computer Manufacturers Association), a body for standardization of information and communication technology. Eventually the language standardized in ECMA is called ECMAScript of ES. The first edition was released on June 1997.

The ES6 is the sixth edition of the language and was released on June 2015. It was initially known as ECMAScript 6 (ES6) and later renamed…

Q1. What is Angular 4 and how it differs from Angular 1.x?

Angular 4 is a Javascript framework built around the concept of components, and more precisely, with the Web Components standard in mind. It was rewritten from scratch by the Angular team using Typescript (although we can use it with ES5, ES6, or Dart as well).

Angular 4 is a big change for us compared to 1.x. Because it is a completely different framework than 1.x, and is not backward-compatible. Angular 4 is written entirely in Typescript and meets the ECMAScript 6 specification. The main differences are:

  • Angular 4…

Q1. What is TypeScript? Why should we use it?

TypeScript is a typed superset of JavaScript that compiles to plain JavaScript which runs on any browser or JavaScript engine.

TypeScript offers support for the latest JavaScript features and also has some additional features like static typing, object oriented programming and automatic assignment of constructor.

Q2. What are Types in TypeScript?

The type represents the type of the value we are using in our programs. TypeScript supports simplest units of data such as numbers, strings, boolean as well as additional types like enum, any, never.

In TypeScript, we are declaring a…

Q1. What is Node.js? What is it used for?

Node.js is a run-time JavaScript environment built on top of Chrome’s V8 engine. It uses an event-driven, non-blocking I/O model. It is lightweight and so efficient. Node.js has a package ecosystem called npm.

Node.js can be used to build different types of applications such as web application, real-time chat application, REST API server etc. However, it is mainly used to build network programs like web servers, similar to PHP, Java, or ASP.NET. Node.js was developed by Ryan Dahl in 2009.

Q2. What is Event-driven programming?

Event-driven programming is building our application…

Q1. What are all the properties in Directive Definition Object?

Some of them are,

restrict - Restrict an element to one of the four types 'EAMC'.

replace - Boolean value. If true the directive element (such as, <my-directive>) will be replaced with the template elements.

template - A string or a function that returns a string, that could be compiled into HTML elements. This template will be attached to the DOM.

templateUrl - A url in string or a function that returns the url. It will be fetched by the Angular compiler and will be attached to DOM.


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store