interview questions - vibrant publishers
TRANSCRIPT
You'll Most Likely Be Asked
© 2014, By Vibrant Publishers, USA. All rights reserved. No part of this publication
may be reproduced or distributed in any form or by any means, or stored in a
database or retrieval system, without the prior permission of the publisher.
HTML5 Interview Questions
ISBN-10: 1466332220
Library of Congress Control Number: 2011938556
ISBN-13: 978-14-66332-22-5
Please email feedback / corrections (technical, grammatical or spelling) to
This publication is designed to provide accurate and authoritative information in
regard to the subject matter covered. The author has made every effort in the
preparation of this book to ensure the accuracy of the information. However,
information in this book is sold without warranty either expressed or implied. The
Author or the Publisher will not be liable for any damages caused or alleged to be
caused either directly or indirectly by this book.
Vibrant Publishers books are available at special quantity discount for sales
promotions, or for use in corporate training programs. For more information please
write to [email protected]
To access the complete catalogue of Vibrant Publishers, visit
www.vibrantpublishers.com
3 Forms 17
INDEX 85
4 General Events 27
8 Cache Manifest 59
1 Basics 7
2 Input Types 11
9 HR Questions 65
6 Table 35
7 General Elements and Attributes 39
Table of Contents
5 Media Elements and Events 31
HTML5 Interview
Questions Review these typical interview questions and think about how you
would answer them. Read the answers listed; you will find best
possible answers along with strategies and suggestions.
8 HTML5 Interview Questions You’ll Most Likely Be Asked
1: Describe any two new features of HTML5.
Answer:
HTML 5 comes up with many new features including
video/audio elements for media playback and better support
for local offline storage.
2: What does a <hgroup> tag do?
Answer:
It is used for heading sections. Header tags used are from <h1>
to <h6>. The largest is the main heading of the section, and the
others are sub-headings.
3: Which video formats are used for the video element?
Answer:
Ogg, MPEG4, WebM
4: How can we embed video in HTML5?
Answer:
<video src="movie.ogg" controls="controls"></video>
5: Which video format is supported by IE?
Answer:
IE supports MPEG4 and WebM.
6: Name the audio formats supported in HTML5.
Answer:
Ogg Vorbis, MP3, WAV
HTML5 Interview Questions You’ll Most Likely Be Asked 9
7: What will the following code do?
<audio src="song.ogg" controls="controls"></audio>
Answer:
It will play the audio file named song.ogg.
8: How will you define canvas with reference to HTML5?
Answer:
It is a rectangular area, where we can control every pixel.
9: Give an example of adding canvas in HTML5?
Answer:
<canvas id="myCanvas" width="200" height="100"></canvas>
10: Which methods/approaches are available in HTML5 to
store data?
Answer:
Local Storage and Session Storage
11: Write a code snippet in HTML or Javascript that can count
how many times a user visited the page.
Answer:
We can code the counter in Javascript and can call it from our
web page written in HTML.
<script type="text/javascript">
if (sessionStorage.pagecount)
{
sessionStorage.pagecount=Number(sessionStorage.pagecount)
+1;
10 HTML5 Interview Questions You’ll Most Likely Be Asked
}
else
{
sessionStorage.pagecount=1;
}
document.write("Visits "+sessionStorage.pagecount+" time(s)
this session.");
</script>
12: How can you test your browser's HTML5 compatibility?
Answer:
Visiting http://html5test.com checks the browser's HTML5
compatibility and shows scores.
12 HTML5 Interview Questions You’ll Most Likely Be Asked
13: Which input types are available in HTML5 forms?
Answer:
email, url, number, range, Date pickers, search and color
14: Which form input type will you use if you wish to take an
email as input from the user?
Answer:
HTML5 form provides input field of type 'email' that can be
used to take email address as input. The benefit is that email
validation is done automatically.
e.g. <input type="email" name="email"/>
15: Name any three types of date picker.
Answer:
a) month - selects month and year
b) week - selects week and year
c) time - selects time (hour and minute)
16: Which HTML5 input type will allow you to select color?
Answer:
Color type can be used to get color input from the user. The
user experience may vary depending upon the browser.
e.g. Select color: <input type="color" name="user_color" />
17: What is the default video format for HTML5?
Answer:
Ogg Theora is the default video format in HTML5.
HTML5 Interview Questions You’ll Most Likely Be Asked 13
18: How do you differentiate HTML5 and Flash when
playing videos?
Answer:
HTML5 has built-in support for audio and video codecs
whereas Flash plugin has to load them which makes it slower
than HTML5.
19: What does HTML5 use to access and store data?
Answer:
HTML5 uses Javascript to access and store data.
20: Is there any time limit for the localstorage object's data
storage?
Answer:
There is no time limit.
21: When does the session storage data get deleted?
Answer:
As soon as the user closes the browser, the session storage data
is removed or deleted.
22: What does datalist element do?
Answer:
A list of options for an input field can be specified using
datalist element.
23: What HTML5 element provides a secure way to
authenticate users?
14 HTML5 Interview Questions You’ll Most Likely Be Asked
Answer:
The keygen element.
e.g.
<form action="page.asp" method="get">
Username: <input type="text" name="location" />
Encryption: <keygen name="security" />
<input type="submit" />
</form>
24: Define private and public keygen elements.
Answer:
The keygen element is a key-pair generator and when a form is
submitted, public key and private key are generated. Private
key is used for encrypting the data and public key is used for
decrypting the data.
25: Where is the private key stored?
Answer:
The private key is stored on the client and is never shared.
26: Where is the public key stored?
Answer:
The public key is stored on the server.
27: What does a public key do?
Answer:
The public key could be used to generate a client certificate to
authenticate the user in the future.
HTML5 Interview Questions You’ll Most Likely Be Asked 15
28: Which element is used for calculations and script output?
Answer:
The output element
e.g.
<input name="n1" type="number"> +
<input name="n2" type="number"> =
<output name="result"
onforminput="value=n1.valueAsNumber +
n2.valueAsNumber"></output>
29: Write the syntax of output element.
Answer:
<output id="result" onforminput="resCalc()"></output>