Website Development Interview Questions and Answers

Q1 : What web developer should know?
A : A good web developer should know

  • HTML
  • CSS
  • SQL
  • PHP/Ruby/Python
  • JQuery
  • JavaScript

Q2 : In HTML what tag can be used for a multi-line text input control?
A : For multi-line text input control, you can use the “textarea tag”.

Q3 : How XHTML is different from HTML?
A :

  • XHTML requires that all tags should be in lowercase
  • XHTML requires that all tags should be closed properly
  • XHTML requires that all attributes are enclosed in double quotes
  • XHTML forbids inline elements from containing block level elements

Q4 : List out few ways you can reduce page load time?
A : You can do following things to reduce the page load time

  • Reduce image size
  • Remove unnecessary widgets
  • HTTP compression
  • Placing CSS at the top and script reference at the bottom or in external files
  • Reduce lookups
  • Minimize redirects
  • Caching,

Q5 : Explain how can you refer to CSS file in the web page?
A : You can refer to the .CSS file in the webpage by using the <link> tag.  It should be kept between <head></head>tag. For example <linkhref=”/css/mystyle.css” type=”text/css” rel=”stylesheet”/>

Q6 : What are the new form elements introduced in HTML5?
A : The new form elements introduced in HTML5 are:

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

Q7 : Explain in CSS, how can you make a form element’s background color change when the user is entering text? Does this work in all browsers?
A : Yes, you can change the default look of form elements by styling their HTML tags: input, select and textarea but it won’t work for all browsers.

Q8 : What are various elements that Provide Better Structuring In HTML5?
A : 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.

Q9 : What is SVG and why do you use it?
A : 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.

Q10 : What is your preferred development environment?
A : This question is not about checking if you are perfect for the same environment as the organisation works but to measure if you are flexible to work in any environment. So, give them a hint that you are able to adapt to any environment with the core skills that you have.

Q11 : What is a Canvas? And what is its Default Border Size?
A : 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.

Q12 : What is HTML5 Web Storage?
A : 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 only the web page which gets the data stored can access it.

Q13 : What are the different types of pop-up boxes available in JavaScript? Explain them.
A : There are three types of pop-up boxes:

  1. Alert – it just displays a message with an OK button.
  2. Confirm – it pops up a confirmation message window with OK and Cancel button.
  3. Prompt – it pops up a dialog box asking user input followed confirmation buttons.

Q14 : By which mechanism in JavaScript can you detect the operating system on a client machine?
A : The operating system on a client system can be known by using the JavaScript property navigator.appVersion.<p “text-align:=”” justify;”=””>The above web developer interview questions and answers will help you to get an understanding of the type of questions you can expect in such interviews. However, if you need to gain expert-level skills to clear the technical round of interviews in any organisation, you should enrol in a certification course. Naukri Learning offers you a variety of online web development courses which you can enrol in and get certified to improve your chances of clearing an interview and getting a career boost.

Q15 : What is the difference between LocalStorage and SessionStorage Objects?
A :  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.

Q16 : What is the difference between ‘==’ and ‘===’ operators?
A :  Though both of them belongs to the comparison operator category, the ‘==’ operator checks the value whereas, the ‘===’ operator checks both the value and the type.

Q17 : What is the difference between ID and Class selector?
A : ID selector finds and modifies the style to any single element while Class selector can do to any number of elements.

Q18 : What Are The New DocType And Charset In HTML5?

A : 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″>

Q19 : What Are The Various Elements HTML5 Has Added For Media Content?
A : 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.

Q20 : How Does Canvas Differ From SVG?
A : Here are a few points elaborating the differences between Canvas and SVG.
1. Canvas depends on the resolution whereas SVG doesn’t.

2. Canvas does not allow event handlers whereas SVG does provide the support for event handlers.

3. Canvas is ideal for graphic-intensive games whereas SVG doesn’t intend for gaming.

4. It works well for small rendering areas whereas SVG may perform better for large rendering areas like Google map.

Q21 : Which are the new APIs provided by HTML5?
A : The new APIs are media API, text track API, application cache API, data transfer API, user interaction API, command API, constraint validation API and history API.

Q22 : What is the difference between null value and undefined value?
A : Undefined means a variable has been declared but has not yet been assigned a value. On the other hand, null is an assignment value.

Q23 : What is long polling?
A : Long polling is a web application development pattern used to emulate pushing data from the server to the client.  When the long polling is used, the client sends a request to the server, and the connection remains intact until the server is ready to send data to the client. The connection will be closed only after the data is sent back to the client or connection timeout occurs.

Q24 : Explain what is DTD (Document Type Declaration)? Mention what is the difference between CDATA and PCDATA in DTD?
A : A DTD means Document Type Definition (DTD) which defines the structure, legal elements and attributes of an XML document.

  • PCDATA: A PCDATA is a Parsed Character Data. XML parsers usually parse all the text in an XML document.
  • CDATA: While CDATA is an Unparsed Character Data, the term CDATA is used about text data that should not be parsed by the XML parser.

Q25 : What is the correct way to include JavaScript into your HTML?
A : The correct way to include JavaScript into your HTML is by using inline event handlers or inline code.