0% found this document useful (0 votes)
270 views

Top 40 Web Development Interview Questions and Answers

Uploaded by

Manasa P
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
270 views

Top 40 Web Development Interview Questions and Answers

Uploaded by

Manasa P
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Placement handbook of

WEB DEVELOPMENT
TOP 40 MCQ'S WITH ANSWERS

www.mobiprep.com
TOP 40 WEB DEVELOPMENT MCQ’s WITH ANSWERS

1. Choose the correct statement.


a. In traditional XHTML close tag for some elements is optional but not encouraged
b. In both traditional XHTML and HTML close tag for some elements is not optional
c. In traditional HTML close tag for some elements is optional but not encouraged
d. In both traditional XHTML and HTML close tag for some elements is optional

Explanation: In XHTML all elements must always be closed and empty elements also be closed. HTML is
case insensitive and thus closing tags for some elements including empty elements is optional and is
ignored by browsers.

2. Which of the following is not a difference between HTML and XHTML?


a. Charset in both html and xhtml is “text/html”
b. Charset in html is “text/html” where as in xhtml it is “application/xml+xhtml”
c. Tags and attributes are case-insensitive in HTML but not in XHTML
d. Special characters must be escaped using character entities in XHTML unlike HTML

Explanation: HTML is case insensitive while XHTML is case sensitive. In XHTML, special characters can be
escaped using character entites but not in HTML. Charset in HTML is “text/html” where as it is
“application/xml+xhtml” for XHTML.

3. Which one of the following is an open source JavaScript library that enables styling for HTML5
elements in versions of Internet Explorer before IE 9?
a. HTML5
b. HTML5 Shiv
c. HTML5 Shim
d. HTML5 Sham

Explanation: HTML5 Shiv is a JavaScript workaround, to enable styling of HTML5 elements in versions of
Internet Explorer prior to version 9, which do not allow unknown elements to be styled without
JavaScript. HTML 5 defines the properties and behaviors of web page content.

4. Which property is used to detect the browser’s user agent and code based on the pertinent
cases?
a. return
b. navigator.user
c. navigator
d. navigator.userAgent

Explanation: An old strategy was to look at the property navigator.userAgent to detect the browser’s
user agent and code based on the pertinent cases.

5. Which of the following is an open source JavaScript library that allows support for different
levels of experiences based on the capabilities of each browser?
a. Modernizr
b. Geolocation
c. Navigator
d. Google API

Explanation: Modernizr is an open source JavaScript library that allows support for different levels of
experiences based on the capabilities of each browser using a simple feature detection model.

Page 1 of 9 www.mobiprep.com
TOP 40 WEB DEVELOPMENT MCQ’s WITH ANSWERS

 Geo-location: the identification of geographic location of an object.


 Navigator: object contains information about the browser.
 Google API: set of application programming interface which allow communication with Google
Services & integration to other services.

6. Which protocol is supported by Android browsers?


a. HTTPS
b. HLS
c. RTMP
d. FTP

Explanation: HTTPS i.e. Hypertext Transfer Protocol Secure is used on internet. HLS, Hypertext Transfer
Protocol Live Streaming, is supported by android browsers. RTMP stands for Real-Time Messaging
Protocol, FTP stands for File Transfer Protocol.

7. Which of the following is not a HTML5 tag?


a. <video>
b. <source>
c. <track>
d. <slider>

Explanation: <video> tag is used to display video clips in HTML5. Multiple media resources for media
elements is specified by <source> tag. Text track for media elements i.e. <audio> & <video> is provided
by <track> tag in HTML5. There is no such thing as slider tag in HTML5.

8. What will happen if height and width of video are not set while video loads?
a. Pageflickers
b. page does not load
c. page crash
d. page closes

Explanation: If height and width are not set, the browser does not know the size of the video. The effect
will be that the page will change (or flicker) while the video loads.

9. Which of the following browser does not support wav file format?
a. Opera
b. Firefox
c. Chrome
d. Internet Explorer

Explanation: Audio file format named wav is not supported by internet explorer out of Opera, Firefox,
chrome and internet explorer.

10. In HTML Audio/Video DOM __________ returns a TextTrackList object representing the
available text tracks.
a. readyState
b. startDate
c. videoTracks
d. textTracks

Page 2 of 9 www.mobiprep.com
TOP 40 WEB DEVELOPMENT MCQ’s WITH ANSWERS

Explanation: The current ready state of video/audio is set by readyState. StartDate sets current date
representing current time offsets. VideoTrack returns video track list representing available video tracks.
The textTracks property returns a TextTrackList object. Each available text track is represented by a
TextTrack Object.

11. The __________ attribute effectively renders the iframe as an inline include, which allows the
parent document’s CSS to affect the contents of the iframe.
a. allow-forms
b. seamless
c. Embed
d. allow-scripts

Explanation: Embed attribute attach external content at a specified point in document. The seamless
attribute is a boolean attribute. When present, it specifies that the iframe should look like it is a part of
the containing document (no borders or scrollbars). Allow-forms re-enables from submission. Scripts are
re-enabled by allow-scripts.

12. In the processing of information, the server does not use which of the following language:
a. C#
b. JAVA
c. C++
d. VB.net

Explanation: When we enter a new value through form it goes to the server for processing information
and this information is processed using languages C#, PHP, JAVA or VB.net. The database can also store
the information.

13. Form validation traditionally was performed by:


a. PHP
b. HTML
c. JavaScript
d. jQuery

Explanation: Form validation is checking if the form has been filled correctly. Traditionally it has been
performed by JavaScript but now HTML5 is introducing validation. Hence browser does all the work of
validation. Validation reduces the amount of work for the server

14. Which one has the most potential for minification (removing unnecessary elements and
rewriting code to reduce file size.)?
a. JavaScript
b. CSS
c. HTML
d. PHP

Explanation: Among the four languages JavaScript, PHP, HTML and CSS, JavaScript has the most
potential for minification. In JavaScript whitespaces and comments are removed. Variable names can
also be shortened.

15. For creating single line text box for searching queries, we use the type:
a. placeholder

Page 3 of 9 www.mobiprep.com
TOP 40 WEB DEVELOPMENT MCQ’s WITH ANSWERS

b. search
c. url
d. hidden

Explanation: For creating a single line text box for searching queries we use the type=”search”.

16. Metadata does not define:


a. character set
b. links
c. scripts
d. color

Explanation: Metadata define character set, title of the document, links, styles, scripts and other meta
information. E.g. <!doctype html> <html> <title> The Code </title> <meta charset= “UTF-8”> </head>
<body>

17. What is the path for an image located in same folder as the current page?
a. <img src= “pic.jpg”>
b. <img src= “../pic.jpg”>
c. <img src= “images/pic.jpg”>
d. <img src= “/images/pic.jpg”>

Explanation:

 Option a) indicates that pic.jpg is located in same folder as current page.


 Option b) indicates that pic.jpg is located in current folder.
 Option c) is located in images folder at root of current web.
 Option d) indicates that pic.jpg is located in folder one level up from current folder.

18. Relative URLs are used to:


a. link other pages within the same site
b. link the same page with other sites
c. link other pages with other sites
d. does not link

Explanation: Relative URLs are used for linking other pages within the same site. These are the
shorthand version of absolute URLs. These URLs are helpful when building a site on a computer as one
can create links between pages without having set up for hosting or domain name.

19. Which element is used for creating links?


a. <a>
b. <p>
c. <li>
d. <ol>

Explanation: <a> element is used for creating links. We can click anything written between opening <a>
tag and closing </a> tag. E.g. <a href= “http://www.gmail.com”> GMAIL </a>. The text written between

Page 4 of 9 www.mobiprep.com
TOP 40 WEB DEVELOPMENT MCQ’s WITH ANSWERS

<a> and </a> is called link text. <p></p> defines paragraph. <li> specifies list of item. <ol> is ordered list
which can be either numerically or alphabetically.

20. Which of the following can’t be the value of list-style-type?


a. square
b. circle
c. ellipse
d. disc

Explanation: list-style-property is used for defining the style of list item marker. Its value can be square,
circle, disc or none. For setting list item marker to be bullet we use the value disc. It is the default value.
For setting list item marker to a circle we used the circle, for setting it to be square we set the value
square. If we set the value none, list items will not be marked.

21. What timestamp property denotes?


a. time at which WIFI is used
b. the time at which data of the location is retrieved
c. the time at which callback function is evoked
d. current time

Explanation: The time at which data of the location is retrieved denoted by timestamp property. This
also provides the date. Timestamp is a read-only property.

22. How many standard color names do HTML supports?


a. 120
b. 130
c. 140
d. 100

Explanation: In HTML one can use a color name to specify a color e.g. Tomato, Orange, Dodger Blue,
Medium Sea Green, Gray, Slate Blue, Violet, Light Gray etc. For colored fonts, we used text-decoration
property to set the color of the text.

23. Which of the following is not set with font-style property?


a. font-style: normal
b. font-style: italic
c. font-style: oblique
d. font-style: capitalize

Explanation: Text-transform: capitalize, capitalizes the first letter of each word whereas font-style set
font as normal, italic, oblique. We use text-transform: uppercase and text-transform: lowercase to
change the text from lowercase to uppercase and from uppercase to lowercase respectively.

24. Which of the following elements in HTML5 defines video or movie content?
a. <media>

Page 5 of 9 www.mobiprep.com
TOP 40 WEB DEVELOPMENT MCQ’s WITH ANSWERS

b. <video>
c. <movie>
d. <audio>

Explanation: The media to which linked document is optimized is given by <media> tag. The HTML5
video element specifies a standard way to embed a video in a web page. As like <video> elements,
<audio> element contains additional files or streams like music, recording, etc.

25. Which of the following property is used to determine which drag operation was desired?
a. Dragend
b. getData
c. dropEffect
d. captureData

Explanation: When the user finishes dragging an element, dragend is occurred. During the drop event,
you should retrieve that data that was dropped from the event and insert it at the drop location. One can
use the dropEffect property to determine which drag operation was desired.

26. Which of the following is true if the property value of a name-value pair added by an element
with an itemprop attribute is a Meta element?
a. The value is the item created by the element
b. The value is the value of the element’s value attribute, if it has one, or the empty string
otherwise
c. On getting, if the element has a date time content attribute, the IDL attribute must return that
content attribute’s value.
d. The value is the element’s text Content.

Explanation: When the property value of a name-value pair added by an element with an itemprop
attribute which is a Meta element then the value is the value of the element’s value attribute, if it has
one or the empty string otherwise, the “itemprop” attribute is a global attribute which adds properties to
item.

27. Which of the following is an HTML specification used to add more information to HTML tags.
a. Macro data
b. Micro data
c. Mini data
d. Modify data

Explanation: The Microdata spec provides a standardized syntax for additional semantic markup to your
web pages to enhance the machine readability of your web pages. The planning for distribution center
operation is offered by minidata. Macrodata and Modifydata are not any terms related to HTML5.

28. The microdata model consists of groups of name-value pairs known as:
a. Item
b. Property
c. Value
d. URL

Page 6 of 9 www.mobiprep.com
TOP 40 WEB DEVELOPMENT MCQ’s WITH ANSWERS

Explanation: The microdata model consists of groups of name-value pairs known as items. Each group is
known as an item. Each item can have item types, a global identifier and a list of name-value pairs. A
Uniform Resource Locator, called URL, termed as web address and is used for a reference to a web
resource for finding its location. Property is information about a particular id or else attribute.

29. Favicon stands for:


a. Fave icon
b. Favorite icon
c. Both Fave icon and Favorite icon
d. Fav icon

Explanation: A favicon which is also known as a shortcut icon, Fave icon and also a Favorite icon. It is
associated with a particular website or a web page. Favicon is a graphical representation for a site.

30. Which attribute is used for favicon?


a. Icon
b. title
c. rel
d. head

Explanation: Favicon is associated with a particular website or a web page. Favicon is a graphical
representation for a site. The “rel” attribute is used for favicon generation.

31. In CSS, h1 can be called as:


a. Selector
b. Attribute
c. Value
d. Tag

Explanation: HTML element h1 is used in CSS for styling then it is also called a selector. Attributes are the
special words which control the element’s behaviour. To show the start and end of HTML element, tag is
used.

32. Which CSS property is equivalent for the attribute <center>:


a. Color
b. Margin
c. Align
d. Font

Explanation: The attribute <center> in html aligns the text in center. In CSS, this is equivalent to align
property which can align text to right, left or center as per the value. Margin property sets the margin for
an element. Color property is used to set/assign colour to element. Font property is for
increasing/decreasing the font of text.

33. Which of the following unit represent the viewport’s width?


a. vh
b. vmin
c. vw
d. ch

Page 7 of 9 www.mobiprep.com
TOP 40 WEB DEVELOPMENT MCQ’s WITH ANSWERS

Explanation: Self-explanatory.

34. Which of the following color has this value #ff0000?


a. Blue
b. Green
c. Red
d. Yellow

Explanation: ff worth of red, and no green or blue

35. Which of the following CSS property sets the opacity level for an element?(35)
a. Opacity
b. Transparency
c. Transparent
d. all of the mentioned

Explanation: The opacity property defines the transparency-level, where 1 is opaque, 0.5 is translucent,
and 0 is completely transparent.

36. Identify the CSS property that specifies the length of the space used for the tab character.
a. Size
b. tab-size
c. tab-space
d. all of the mentioned

Explanation: The tab-size CSS property is used to customize the width of a tab.

37. Which of the following CSS framework is used to create a responsive design?
a. Larawell
b. Bootstrap
c. Rails
d. Django

Explanation: Bootstrap is a free and open-source collection of tools for creating websites and web
applications. It contains HTML- and CSS-based design templates for typography, forms, buttons,
navigation and other interface components, as well as optional JavaScript extensions. It aims to ease the
development of dynamic websites and web applications.

38. Which property is used to add space inside the text field?
a. Padding
b. Margin
c. Number
d. Password

Explanation: Padding property is used to add space inside the text field, when we have many inputs after
each other we can also add some margin to add more space outside.

39. Which of the following property defines a shadow effect for text?
a. box-shadow
b. img-shadow
c. text-shadow

Page 8 of 9 www.mobiprep.com
TOP 40 WEB DEVELOPMENT MCQ’s WITH ANSWERS

d. none of the mentioned

Explanation: The shadow effects are applied in the order specified and may overlay each other, but they
will never overlay the text itself. Each shadow effect must specify a shadow offset horizontally and
vertically and may optionally specify a blur radius and a shadow color.

40. Which of the following css property should be used to make a responsive image?
a. Float
b. max-width
c. margin-right
d. all of the mentioned

Page 9 of 9 www.mobiprep.com

You might also like