Monday, January 10, 2011

Web developer Interview questions and answers (Technical Round)

1. What is DTD?

Ans: Document Type Definition (DTD) is a set of markup declaration that defines the type of SGML family markup languages.(SGML, XML, HTML).

1. Types of DTD?
Ans: The DTD can contain several different types of declarations:
• Element declarations let you specify what kinds of tags can be used, and what (if anything) can appear inside the contents of the element.
• Attribute declarations define what attributes you can use inside a given element.
• Entity declarations define chunks of fixed text that can be included elsewhere.
• Notation declarations define file types (like JPG and WAV files) so you can refer to non-XML files like image and sound files.
2. What is default DTD in Dream weaver?
Ans: This depends on which type of document you are opening. Dream weaver assigns DTD accordingly.
3. Write an HTML skeleton?
Ans:




Untitled Document










4. What is use of Meta tags?
Ans: Metadata is information about data. Meta elements are typically used to specify
page description, keywords, author of the document, last modified, and other metadata.
The metadata can be used by browsers (how to display content or reload page), search
engines (keywords), or other web services.

4. Which version of JavaScript you are using?
Ans: Now I am using 1.5 for my scripting because most browsers supporting it now.

Whether
----------------------------------------------------------------------------------------------------------------------------
JavaScript version 1.8.1 is the latest version of JavaScript. It depends on browser which version of JavaScript they are supporting. Now most browsers supporting version 1.5 and Mozilla 4 supports

5. What are the HTML (DTD) types?
Ans: Strict, Transitional, frameset.

6. What is difference between strict and transitional DTD?
Ans: This is HTML 4.01 Strict DTD, which excludes the presentation attributes and elements that W3C expects to phase out as support for style sheets matures. Authors should use the Strict DTD when possible, but may use the TransitionalDTD when support for presentation attribute and elements is required.

Elements that are not allowed in Strict DOCTYPEs
• center
• font
• iframe
• strike
• u

Attributes not allowed in Strict DOCTYPEs
• align (allowed on elements related to tables: col, colgroup, tbody, td,tfoot, th, thead, and tr)
• language
• background
• bgcolor
• border (allowed on table)
• height (allowed on img and object)
• hspace
• name (allowed in HTML 4.01 Strict, not allowed on form and img in XHTML 1.0 Strict)
• noshade
• nowrap
• target
• text, link, vlink, and alink
• vspace
• width (allowed on img, object, table, col, and colgroup)
Using a Strict DTD, either HTML 4.01 Strict or XHTML 1.0 Strict, is far more important for the quality of the future web than whether or not there is an X in front of the name. The Strict DTD promotes a separation of structure and presentation, which makes a site so much easier to maintain.

Roger Johansson


8. Difference between
and ?
ans: Div is a block element and span is a inline element.

Most HTML 4 elements permitted within the BODY are classified as either block-level elements or inline elements. Inline elements typically may only contain text and other inline elements. When rendered visually, inline elements do not usually begin on a new line.

9. Block-level elements?

Ans: The following are defined as block-level elements in HTML 4:
Most HTML 4 elements permitted within the BODY are classified as either block-level elements or inline elements. Inline elements typically may only contain text and other inline elements. When rendered visually, inline elements do not usually begin on a new line.
The following are defined as inline elements in HTML 4:
• A - Anchor
• ABBR - Abbreviation
• ACRONYM - Acronym
• B - Bold text
• BASEFONT - Base font change
• BDO - BiDi override
• BIG - Large text
• BR - Line break
• CITE - Citation
• CODE - Computer code
• DFN - Defined term
• EM - Emphasis
• FONT - Font change
• I - Italic text
• IMG - Inline image
• INPUT - Form input
• KBD - Text to be input
• LABEL - Form field label
• Q - Short quotation
• S - Strike-through text
• SAMP - Sample output
• SELECT - Option selector
• SMALL - Small text
• SPAN - Generic inline container
• STRIKE - Strike-through text
• STRONG - Strong emphasis
• SUB - Subscript
• SUP - Superscript
• TEXTAREA - Multi-line text input
• TT - Teletype text
• U - Underlined text
• VAR - Variable
The following elements may be used as either block-level elements or inline elements. If used as inline elements (e.g., within another inline element or a P), these elements should not contain any block-level elements.
• APPLET - Java Applet
• BUTTON - Button
• DEL - Deleted text
• IFRAME - Inline frame
• INS - Inserted text
• MAP - Image map
• OBJECT - Object
• SCRIPT - Client-side script
10. What is inline Elements?

Ans: The following are defined as inline elements in HTML 4:
• A - Anchor
• ABBR - Abbreviation
• ACRONYM - Acronym
• B - Bold text
• BASEFONT - Base font change
• BDO - BiDi override
• BIG - Large text
• BR - Line break
• CITE - Citation
• CODE - Computer code
• DFN - Defined term
• EM - Emphasis
• FONT - Font change
• I - Italic text
• IMG - Inline image
• INPUT - Form input
• KBD - Text to be input
• LABEL - Form field label
• Q - Short quotation
• S - Strike-through text
• SAMP - Sample output
• SELECT - Option selector
• SMALL - Small text
• SPAN - Generic inline container
• STRIKE - Strike-through text
• STRONG - Strong emphasis
• SUB - Subscript
• SUP - Superscript
• TEXTAREA - Multi-line text input
• TT - Teletype text
• U - Underlined text
• VAR - Variable
The following elements may be used as either block-level elements or inline elements. If used as inline elements (e.g., within another inline element or a P), these elements should not contain any block-level elements.
• APPLET - Java Applet
• BUTTON - Button
• DEL - Deleted text
• IFRAME - Inline frame
• INS - Inserted text
• MAP - Image map
• OBJECT - Object
• SCRIPT - Client-side script
11. Latest version of CSS?
Ans: CSS 2.1.

12. What is difference between “==” and “===” in JavaScript?
Ans: "==" operator compares only the values of the variables. "===" operator compares not only the values but also the types?

13. How to write a JavaScript array?
Ans:
var myCars=new Array();
myCars[0]="Apple";
myCars[1]="Mango";
myCars[2]="banana";