50 Web Developer Interview Questions (2019 Edition)

In this tutorial, we’ve listed down 50 web developer interview questions covering HTML5, CSS3, and JavaScript. These are the three primary skills where the companies will evaluate the candidates appearing for the interviews.

Front end web development requires a solid understanding of many languages. And the scale of questions asked during the interviews could go past beyond your expectations. So you must extend your preparation and cover all the leading web technologies such as HTML/CSS/JavaScript/AngularJS/Node.js.

However, there are several factors like Work experience, Flexibility, Attitude that influence the selection process. Hence, feel free to research for a resume template where you can competently portray these influencing factors. Everything else rests upon you and the way you deliver.

In this post, you’ll find 10 Questions on HTML5, 20 Questions on CSS3, and 20 Questions on JavaScript. By the way, one more important topic which you won’t like to miss out gets covered in the below blog post.

Let’s explore the essential Web developer interview questions.

50 Web Developer Interview Questions for Sure Success

Web Developer Interview Questions – Part1

HTML5 Interview Questions

Q-1. What are the new DocType and Charset in HTML5?

The DocType element communicates the HTML version to the browser. It usually appears in the first line of code of an HTML page. Unlike the earlier versions/standards of HTML, DocType has got a simplified format in HTML5.

<!doctype html>

The CharSet is a new meta tag attribute in HTML5 which configures the character encoding.

<meta charset=”UTF-8″>


Q-2. What all new Form elements got introduced in HTML5?

Here is the list of new form elements available in HTML5.

  • <datalist> – It specifies a list of options for input controls.
  • <keygen> – This tag generates an encryption key.
  • <output> – It defines the result of an expression.


Q-3. Which of the HTML5 elements support media content?

Following HTML5 elements supports media content.

  • <audio> – It specifies sound content.
  • <video> – It links to a video.
  • <source> – This tag specified the source of video and audio links.
  • <embed> – It acts as a container for external applications.
  • <track> – This element defines tracks for video and audio.


Q-4. What are various elements that provide better structuring in HTML5?

Following HTML5 elements focus on improving the structuring.

  • <article> – This element allows to specify an article.
  • <aside> – It allows to view content other than the page content.
  • <bdi> – It lets a part of text getting formatted in a different direction from other text.
  • <command> – It displays a button element which processes a command upon user action.
  • <details> – It adds additional details that a user can show or hide.
  • <dialog> – It initializes a dialog box or popup window.
  • <figure> – This element can show illustrations, diagrams, photos, and code listings.
  • <figcaption> – It adds a caption for the image specified by a <figure> element.
  • <footer> – This tag appends a footer to a document.
  • <header> – This tag inserts a header into a document.
  • <hgroup> – If a page includes multiple headings, then this tag groups them into a set of <h1> to <h6> elements.


Q-5. What is SVG and why do you use it?

SVG is an acronym for Scalable Vector Graphics as recommended by W3C.

  • Its purpose is to display the vector-based graphics over the Web.
  • The graphics use an XML format.
  • SVG graphics are of higher quality and does not lose it even when resized.
  • All elements and attributes of SVG support animation.


Q-6. What does Canvas mean in HTML? And what is its default border size?

Canvas is an HTML5 element which can draw graphics on the fly with the help of JavaScript. The <canvas> element can only contain graphics. It supports a no. of methods for drawing paths, boxes, circles, text, and images.

By default, It has no border. However, it allows using CSS to change the border style.


Q-7. How does Canvas differ from SVG?

Here are a few points elaborating the differences between Canvas and SVG.

  • Canvas depends on the resolution whereas SVG doesn’t.
  • It does not allow event handlers whereas SVG does provide the support for event handlers.
  • Canvas is ideal for graphic-intensive games whereas SVG doesn’t intend for gaming.
  • It works well for small rendering areas whereas SVG may perform better for large rendering areas like Google map.


Q-8. Does HTML5 provide drag and drop facility? How do you set an image as draggable?

To set an image as draggable, initialize the draggable attribute with true.

<img draggable="true">


Q-9. What is HTML5 Web Storage?

HTML5 brought this new ability to store web pages within the browser cache. This web storage is not only faster than the cookies but secured too. It is capable of storing a large amount of data without compromising the performance of the website.

Also, note that the cached data is not must for every server request. Instead, it gets utilized only when the page asks for it. And the web page which receives the data stored can access it.


Q-10. What is the difference between localStorage and sessionStorage objects?

Following points describes the differences between the localStorage and sessionStorage objects.

  • The <localStorage> object doesn’t have an expiry for the stored data whereas the <sessionStorage> object keeps it only for a single session.
  • The <localStorage> object doesn’t have a provision to delete the data upon closing of browser window whereas the <sessionStorage> object clears it simultaneously with the window closing down.

Back to top

Web Developer Interview Questions – Part2.

CSS3 Interview Questions.

Q-1. How does CSS3 differ from CSS?

CSS3 is the most recent version of CSS. It has introduced a bunch of new tags to give a better user experience. Some of the features are rounded corners, animation, custom layout, and media queries.


Q-2. How does CSS3 support responsive web designing?

CSS3 has come up with a media query feature. It supports RWD (Responsive Web Design) and does help in making a website responsive.


Q-3. What is a CSS selector?

A CSS selector is an expression following the CSS rules and used to select the element we want to style. And CSS selector syntax means how we write or use those selectors in the CSS editor.

Please note that a CSS selector can help you find or select HTML elements based on their name, id, class, attribute, and more.


Q-4. What are the different types of CSS?

Below are the different types of CSS.

  • Embedded – It adds the CSS styles using the <style> attribute.
  • Inline – It adds the CSS to the HTML elements.
  • Linked/External – It adds an external CSS file to the HTML document.


Q-5. What is an ID selector?

The ID selector uses the “ID” attribute of the target HTML element to select it. The constraint to work is that the ID should be unique within a page so that the selector can point it out correctly.

To build an ID selector expression, start with a hash (#) character, followed by the id of the element.

Here is an example which selects a paragraph element using its ID.

#sample {padding: 10px;}

<p id="selector">...</p>


Q-6. What does the class selector mean?

In CSS, a class selector is an expression which begins with a full stop (“.”) and followed by the name of a class. The class attribute could be a space-separated list of items, and one of those must match with the class name specified in the selector.

Here is an example which selects a div and modified its style.

.sampleclass {font-family: Ariel; font-size: 10; background: green;}

<div class="sampleclass">....</div>


Q-7. What is the difference between an ID selector and the Class selector?

An ID Selector finds and modifies the style to only a single element whereas a class selector may apply to any no. of HTML elements.


Q-8. What is Grouping in CSS3?

Grouping makes it possible to apply the same style to multiple HTML elements (Classes/Tag/ID) within a single declaration. It happens by specifying all the selectors separated by commas.

#page p, ul { padding-top: 10px; margin: 0; }


Q-9. What are Child Selectors in CSS?

A child selector looks up for the child of some element. To form a child selector, we need two or more selectors separated by “greater than” symbol.

Let’s take an example. We have a <ul> tag inside a paragraph. Here, <ul> is the child of the paragraph element. So, to apply the CSS styles, we can use the following syntax.

p > ul { font-size:15px; }


Q-10. How do you make border rounded with CSS3?

Yes, in CSS3, there is a <border-radius> property which allows creating an element with rounded corners. We can apply the same style to all the sides and make the corners round.

The <border-radius> property has four individual properties <border-top-left-radius>, <border-top-right-radius>, <border-bottom-left-radius> and <border-bottom-right-radius>.


Q-11. What is Webkit in CSS3? And why is it used?

Webkit is a core software component which is responsible for rendering HTML and CSS in browsers like Safari and Chrome. There are other similar rendering engines like Gecko for Mozilla, Presto for Opera, and Edge for IE.

To enable Webkit on a web page, it requires prefixing the <-webkit> keyword with CSS values.

Here is an example of CSS using the Webkit feature.

.box_shadow {
-webkit-box-shadow: 0px 0px 5px 0px #ffffff;
box-shadow: 0px 0px 5px 0px #ffffff;


Q-12. How do you enable Pagination using CSS3?

Making use of a <ul-li> structure, we can allow Pagination with CSS3.

<div class="main_container">
<div class="pagination">
<li><a href="#"></a></li>
<li><a href="#"></a></li>
<li class="active"><a href="#"></a></li>
<li><a href="#"></a></li>


Q-13. What are transitions in CSS3?

CSS3 transitions help to create a super easy and fast animation effect. They not only give us control to change the value of a property but also let it proceed slowly for the given duration.

We can use the following CSS properties.

transition, transition-delay, transition-duration, transition-property, and transition-timing-function.


Q-14. What is CSS Box Model and what are its components?

The CSS Box Model represents a box that confines every HTML element such as a text box, a menu or a button. It has primarily four core components.

  • Margin – It refers to the topmost layer of the box.
  • Border – The padding and content options work around the Border. Changing the background color can also affect the Border.
  • Padding – It defines spacing around the box.
  • Content – It represents the actual content to be shown.


Q-15. What are media queries in CSS3 and why do you use them?

Media queries are one of the latest features of CSS3 used to define responsive styles for devices of different shapes and sizes.

They are the powerful CSS tool which makes it easy to create responsive design for tablets, desktop, mobiles devices. They can help to adjust the Height, Width, Viewport, Orientation, and Resolution.

@media screen and (min-width: 480px) {
    body {
        background-color: #ffffff;


Q-16. What are Pseudo-Classes in CSS?

A Pseudo-Class is a CSS technique to set the style when the element changes its state.

For example

  • Edit the style upon mouse hover event.
  • Set the style when an element gets focus.
  • Apply different styles for visited/unvisited links.
selector:pseudo-class {


Q-17. What is the use of float property in CSS?

With the help of float property, we can control the position and layout of elements on a web page.

For example, it can define the placement of a <div> either to the right or left side.

Also, to note that it doesn’t interfere with the elements appearing before.

div  {
    float: left;

Q-18. Which property do you use to modify the face of a font in CSS?

First of all, please note that both the terms <@font-face> and <font-family> refers to changing the font of an HTML element. However, there is a slight difference between the two.

1. The <@font-face> is a CSS rule that facilitates the use of custom fonts on a web page.
2. The <font-family> is a CSS property which specifies the font for a web element.

Also, to change the font or face of a font, we need to set the <font-family> property. Please see the below example.

@font-face {
    font-family: myCustomFont;
    src: url(sansation_light.woff);

body {
  font-family: 'myCustomFont', Fallback, Ariel;


Q-19. How do you add comments in CSS?

It is just the same in CSS as we do in JavaScript. Place the comments inside the enclosing /* and */.


Q-20. What is Z-index and how does it work?

The z-index is a CSS property which defines the stack order of web elements. Higher order elements will appear before any lower order element.

Note – The z-index only applies to the positioned elements. For example, position:absolute, position:relative, or position:fixed.

div {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: -1;

Back to top

Web Developer Interview Questions – Part3

JavaScript Interview Questions

Q-1. What are the core data types available in JavaScript?

Below is the list of data types available in JavaScript.

  • Number
  • Object
  • String
  • Boolean
  • Function
  • Null
  • Undefined


Q-2. What is difference between <window.onload> and <onDocumentReady>?

The <onload> event doesn’t invoke until the page gets finished loading of CSS and images. It could cause a significant delay in rendering of the web page.

As a web developer, we have to ensure the page should load as quick as possible. The event <onDocumentReady> lets us only wait for the DOM to initialize instead of delaying any action required.


Q-3. What is the difference between undefined value and null value?

<undefined> Vs. <null> value

1. A variable will have <undefined> value if it has a declaration but not assigned any value.
2. A variable will yield a <null> value if assigned with null.
3. <undefined> is a type itself whereas <null> is an object.
4. <undefined> value is set via JavaScript engine whereas null value is set directly in the code.

Q-4. How do you change the style/class on any element from JavaScript?

Following JavaScript will modify the style/class of an HTML element.

document.getElementById(“input”).style.fontSize = “10”;
document.getElementById(“button”).className = “classname”;


Q-5. What is namespacing in Javascript and where is it used?

Using global variables is a bad practice in most programming languages including JavaScript. But sometimes, it is not possible to avoid global variables. So JavaScript introduces the concept of namespacing which ties down a part of the code and register it with a unique name.

A namespace is just an object in JavaScript that acts as a container for methods, properties, and other types. It encourages modularity and reusability in a web application.

Q-6. How does JavaScript handle automatic type conversion?

As per ECMA Script standard, JavaScript is dynamic as well as weakly typed language with first-class functions which means – “A JavaScript function can accept other functions as arguments.”

Also, it does support auto-type conversion. Whenever an operator or a statement doesn’t get a value of the expected type, then the conversion takes place automatically.


Q-7. What are different types of popup boxes available in JavaScript?

JavaScript allows the following types of dialog boxes.

  • Alert – It just has a <Ok> button to proceed.
  • Confirm – It pops up a window showing up <Ok> and <Cancel> buttons.
  • Prompt – It gives a dialog asking for user input followed by showing <Ok>/<Cancel> buttons.


Q-8. What is the difference between <alert()> and <confirm()> popup boxes?

The <alert()> method displays a message in a popup box and has only one <Ok> button.

But the <confirm()> method asks for confirmation from the user so that it can get the opinion of visitors. It has two buttons, i.e., <Yes> and <No>.

In short, <alert()> popup is to display the messages to the users whereas the <confirm()> dialog is useful for knowing the choices of the visitors.


Q-9. What is Scope in JavaScript?

The general meaning of scope is the accessibility of functions and variables in an application. Usually, we use them in two ways, i.e., Local and Global.

a) Local Scope

If we declare a function or variable inside a function, then we can access it only inside that function.

// code here can not use myLocalVar

function myFunction() {
    var myLocalVar = "I'm Local";

    // code here can use myLocalVar

b) Global Scope

Declaring a variable anywhere on the page would mean that we can access it from any of the functions on that page.

var myGlobalVar = "I'm Global";

// code here can use myGlobalVar

function myFunction() {

    // code here can use myGlobalVar 



Q-10. What types of comments does JavaScript support?

There are two ways to insert comments in JavaScript code.

For single line comment, we can use // (double forward slash).

For multiline comment, we enclose comments using /* */.






Q-11. How do you distinguish between an undefined and undeclared variable?

Undefined refers to a variable which has declaration but not initialized yet. However, an undeclared variable is one which has a reference in the code without being declared.


var iExistButUndefined;
      alert(iExistButUndefined); // undefined
      alert(iMNotDeclared); // accessing an undeclared variable


Q-12. What are == and === operators in JavaScript and how do they differ?

== – Equal to operator

=== – Equal value and equal type operator

Both of the above operators belong to the Comparison Operator Category. However, the equality operator <==> only checks for the value whereas the strict equality operator <===> checks for the values as well as types.


Q-13. What relates JavaScript with ECMA Script?

ECMA Script is another technical name for JavaScript as it is also known as LiveScript. The current JavaScript that you may see running in browsers is ECMA Script revision 6.


Q-14. What is the mechanism to submit a form using Javascript?

We can call the following method to submit a form using JavaScript.


0 -> index of the form

Note – if we have more than one form, then the first one stays at index 0, next is at index 1 and so on.


Q-15. What is the mechanism to detect the operating system on the client machine?

The following JavaScript property gives back the operating system version on the client machine. It returns the OS version string.



Q-16. What is the function of delete operator in JavaScript?

The delete operator clears all the variables and objects used on the web page. But it leaves the variables declared using the var keyword as is.


Q-17. What is the use of <this> keyword in JavaScript?

The <this> keyword refers to the current object in the program. It is usually available inside a method for referencing the current variable or current object.


Q-18. What does the <typeOf> operator do in JavaScript?

The <typeof> operator give back the type of a variable in the form of a string.


Q-19. How do you make generic objects in JavaScript?

JavaScript provides a new operator to produce generic objects.

Follow the below example creating a generic object.

var obj = new object();


Q-20. What does the “defer” attribute do in JavaScript?

The <defer> attribute is primarily of boolean type. It delays executing a javascript until the page completes the parsing process.

Below is the example of JavaScript code deferring a sample script.

<script src="/mysample.js" defer></script>

Back to top

Recommended Posts:

+ 100 AngularJS Interview Questions

+ 30 JavaScript Interview Questions

+ 30 HTML Interview Questions

Summary – Essential Web Developer Interview Questions

Preparing for a web developer interview isn’t as easy as it seems to be. If you wish to succeed, then it will require at least a moderate level of understanding of all related areas.

And that’s what we kept thinking in our mind until we came up with the 50 essential web developer interview questions spanning across three core web technologies HTML5, CSS3, and JavaScript.

In the end, we like to thank you for stopping by and wish you were able to take back some knowledge and enough confidence to face challenges head-on.