+91 90691 39140 | +1 253 214 3115 | info@hub4tech.com | hub4tech

Top 18 Most Asked HTML5 Interview Questions and Answers

Tue, 2017-09-05 19:40
HTML5 Interview Questions

Are you preparing for HTML5 job interview and wondering what questions you might be asked? In this blog we have hand-picked the questions you are likely to be asked in HTML5 job interview and provided to-the-point answers to each one of them so as to help you prepare better for HTML5 job interviews.

Always keep in the mind that, only academic knowledge is not enough to crack an interview. Employers expects from the candidate to have practical knowledge and hands-on experience as well. This HTML5 Interview Questions designed by industry expert will help you to gain practical knowledge of HTML5.

HTML5 Interview Questions and Answers

  1. What are the new features provided in HTML5?

Answer:
Some of the new features provided in HTML5 are:

  • It provides support for local storage
  • New form controls, like calendar, date, time, email, url, search
  • element is provided to facilitate 2D drawing
  • The and elements are provided for media playback
  • New content-specific elements are provided. For e.g. , , , ,
  1. What is the origin of HTML5?

Answer:
In 2004, HTML 4.01 was the standard, remaining stagnant and without updates since 2000. While the Web Hypertext Application Technology Working Group, or WHATWG, were working out a new standard, the World Wide Web Consortium, or W3C, was focusing their own efforts on XHTML 2.0.
In 2006, the two organizations decided to join forces and develop a new web standard for HTML. They are currently working on HTML5.

  1. Tell us something about the new <canvas> element.

Answer:

  • The new element provided by HTML 5 aids in 2D drawing.
  • It uses the tag .
  • This tag helps in drawing graphics through scripting usually JavaScript.
  1. What are some of the key issues with previous HTML versions that HTML5 is addressing?

Answer:
One main issue developers of HTML5 are aiming to reduce is the need for so many external plug-ins like Silverlight and Flash. HTML5 also offers improvements to error handling and scripting.

  1. Which method is used to draw an image on the canvas?

Answer:
drawImage(image,x,y) method is used to draw an image on the canvas.

  1. What are the new form element types introduced in HTML5?

Answer:

  • Date
  • Datetime-local
  • Time
  • Color
  • Email
  • URL
  • Range
  • Telephone
  • Number
  • Search
  1. Which methods are used to draw a straight line on a Canvas?

Answer:
Following methods are used to draw a straight line on a Canvas:

  • moveTo(x,y) – It defines the starting co-ordinates of the line
  • lineTo(x,y) – It defines the ending co-ordinates of the line
  • The actual line is drawn with the help of a method like stroke()
  1. How do you enable the application cache?

Answer:
To enable the application cache, just add the manifest attribute inside the tag and link to the manifest file. If a web user visits a page with the manifest attribute included, that page will be cached.
N/A
The suggested file extension for manifest files is “.appcache,” as seen in the example above.

  1. What is the application cache, and what are its benefits?

Answer:
The application cache generates offline versions of a web application, making it accessible offline. It also improves the site’s performance and speed.

  1. What is a Canvas? What is the default border size of a canvas?

Answer:
Canvas is a rectangular area on a HTML page, specified with the tag .
By default, a canvas has no border. To get a border on the canvas, a style attribute is required to be used.

  1. What is the manifest file?

Answer:
The manifest file is a text file that instructs the browser what it should and should not cache when the application cache is enabled. It is made up of three parts:

  • Cache Manifest: Indicates files to be cached after they are initially downloaded.
  • Network: Indicates files that require a server connection to load, and will not be cached.
  • Fallback: Indicates fallback pages in the case a page is not accessible.
  1. Differentiate between Canvas and SVG.

Answer:
The table below shows some important differences between Canvas and SVG:

  • Canvas is resolution dependent while SVG is not.
  • Canvas does not provide any support for event handlers while SVG does.
  • Canvas is suitable for graphic-intensive games while SVG is not suitable for gaming.
  • Canvas is suitable for small rendering areas while SVG is suitable for large rendering areas like Google maps.
  1. Which file formats does the <audio> tag support? Which browsers support the different formats?

Answer:
MP3, WAV, and OGG files are supported by the audio tag.
The MP3 file format is supported by Chrome, Internet Explorer, Safari, and Firefox 21 running on Windows Vista, Windows 7, Windows 8, and Android devices. It is not supported by other versions of Firefox, or Opera.
The WAV file format is supported by Chrome, Firefox, Safari, and Opera. It is not supported by Internet Explorer.
The OGG file format is supported by Chrome, Firefox, and Opera. It is not supported by Internet Explorer or Safari.

  1. What is SVG?

Answer:

  • SVG is the abbreviation for Scalable Vector Graphics and is recommended by W3C.
  • It is used to define vector-based graphics for the Web
  • The graphics are defined in XML format
  • An important quality of SVG graphics is that their quality is maintained even when they are zoomed or resized.
  • All the element and attributes of SVG files can be animated
  1. What are the advantages of SVG over other image format like JPEG or GIF?

Answer:
Following are the main advantages of using SVG over other image formats:

  • It is possible to scale the SVG images.
  • They can be created and edited with any text editor
  • The print quality of these image is high at any resolution.
  • It is possible to zoom the SVG images without any degradation in the quality.
  • SVG images can be searched, indexed, scripted, and compressed
  1. Which JavaScript objects are not accessible to web worker?

Answer:
Following JavaScript objects are not accessible to web worker:

  • The window object
  • The document object
  • The parent object
  1. Can HTML 5 get the geographical position of a user?

Answer:

  • Yes, HTML 5 can get the location of a user with the use of Geolocation API.
  • Use getCurrentPosition() method to get the user’s current position.
  1. What is a Web Worker?

Answer:

  • A web worker is a JavaScript which runs in the background. It exists in external files.
  • It is independent of other scripts and does not affect the performance of the page.
  • Web workers are usually used for CPU intensive tasks.

Hub4tech is a one of the few online training platforms who provide best in quality and cutting edge technology education directly from industry experts. If you have any query regarding the data scientist or any of the blog information, please speak to our specialists here.
You can also send your query in our mail box at info@hub4tech.com, and we will write back or call back to you. Don’t forget to like our Facebook and LinkedIn page to get more technology updates. You can read all our Blogs here.
You can also check your level by participating in our free Online Assessment Tests
Use Full Link for HTML Training and Certification

Hitesh Patel
 
Copyright ©2015 Hub4Tech.com, All Rights Reserved. Hub4Tech™ is registered trademark of Hub4tech Portal Services Pvt. Ltd.
All trademarks and logos appearing on this website are the property of their respective owners.
FOLLOW US