Note :- If you see the previous two questions both canvas and SVG can
draw graphics on the browser. So in this question interviewer wants to know when
will you use what.
SVG
|
Canvas
|
Here’s it’s like draw and remember. In other words any
shape drawn by using SVG can be remembered and manipulated and browser can
render it again.
|
Canvas is like draw and forget. Once something is drawn
you cannot access that pixel and manipulate it.
|
SVG is good for creating graphics like CAD software’s
where once something is drawn the user wants to manipulate it.
|
Canvas is good for draw and forget scenarios like
animation and games.
|
This is slow as it needs to remember the co-ordinates for
later manipulations.
|
This is faster as there is no intention of remembering
things later.
|
We can have event handler associated with the drawing
object.
|
Here we cannot associate event handlers with drawing
objects as we do not have reference of them.
|
Resolution independent.
|
Resolution dependent.
|
Do visit
www.questpond.com which provides 600 interview questions on ASP.NET , Design pattern , UML , SQL
Server , ADO.NET and lot more. Below is an awesome video which talks about how
questions are asked in .NET and C# interviews.