Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

When commands of Path element takes absolute path?

Answer»

When commands are in Upper case, these represents absolute path. In case their lower case commands are used, then relative path is used.

2.

Which command of path element closes the path.

Answer»

Z command of path element closes the path.

3.

Which command of path element creates a elliptical arc?

Answer»

A command of path element creates a elliptical arc.

4.

Which command of path element creates a smooth quadratic Bezier curve?

Answer»

T command of path element creates a smooth quadratic Bezier curve.

5.

Which command of path element creates quadratic Bezier curve

Answer»

Q command of path element creates a quadratic Bezier curve.

6.

Which command of path element creates a smooth curve?

Answer»

S command of path element creates a smooth curve.

7.

Which command of path element creates a curve?

Answer»

C command of path element creates a curve.

8.

Which command of path element creates a vertical line?

Answer»

V command of path element creates a vertical line.

9.

Which command of path element creates a horizontal line?

Answer»

H command of path element creates a horizontal line.

10.

Which command of path element creates a line?

Answer»

L command of path element creates a line.

11.

Which command of path element moves cursor from one point to another point?

Answer»

M command of path element move from one point to another point.

12.

How to draw a free flow path in SVG?

Answer»

'path' tag of SVG is used to draw a free flow path. Following is the commonly used attribute −

d − path data,usually a set of commands like moveto, lineto etc.

Example −

<path d = "M 100 100 L 300 100 L 200 300 z" stroke = "black" stroke-width = "3" fill = "rgb(121,0,121)">
13.

How to draw a open ended polygon in SVG?

Answer»

'polyline' tag of SVG is used to draw a open ended polygon. Following is the commonly used attribute −

points − List of points to make up a polygon.

Example −

<polyline points = "150,75 258,137.5 258,262.5 150,325 42,262.6 42,137.5" stroke = "black" stroke-width = "3" fill = "none">
14.

How to draw a close ended polygon in SVG?

Answer»

'polygon' tag of SVG is used to draw a polygon. Following is the commonly used attribute −

points - List of points to make up a polygon.

Example −

<polygon points = "150,75 258,137.5 258,262.5 150,325 42,262.6 42,137.5" stroke = "black" stroke-width = "3" fill = "rgb(121,0,121)">
15.

How to draw a line in SVG?

Answer»

'line' tag of SVG is used to draw a line. Following are the commonly used attributes −

  • x1 − x-axis co-ordinate of the start point. Default is 0.

  • y1 − y-axis co-ordinate of the start point. Default is 0.

  • x2 − x-axis co-ordinate of the end point. Default is 0.

  • y2 − y-axis co-ordinate of the end point. Default is 0.

Example −

<line x1 = "20" y1 = "20" x2 = "150" y2 = "150" stroke = "black" stroke-width = "3" fill = "rgb(121,0,121)">
16.

How to draw a ellipse in SVG?

Answer»

'ellipse' tag of SVG is used to draw a ellipse. Following are the commonly used attributes −

  • cx − x-axis co-ordinate of the center of the ellipse. Default is 0.

  • cy − y-axis co-ordinate of the center of the ellipse. Default is 0.

  • rx − x-axis radius of the ellipse.

  • ry − y-axis radius of the ellipse.

Example −

<ellipse cx = "100" cy = "100" rx = "90" ry = "50" stroke = "black" stroke-width = "3" fill = "rgb(121,0,121)">
17.

How to draw a circle in SVG?

Answer»

'circle' tag of SVG is used to draw a circle. Following are the commonly used attributes −

  • cx − x-axis co-ordinate of the center of the circle. Default is 0.

  • cy − y-axis co-ordinate of the center of the circle. Default is 0.

  • r − radius of the circle.

Example −

<circle cx = "100" cy = "100" r = "50" stroke = "black" stroke-width = "3" fill = "rgb(121,0,121)" >
18.

How to draw a rectangle in SVG?

Answer»

'rect' tag of SVG is used to draw a rectangle. Following are the commonly used attributes −

  • x − x-axis co-ordinate of top left of the rectangle. Default is 0.

  • y − y-axis co-ordinate of top left of the rectangle. Default is 0.

  • width − width of the rectangle.

  • height − height of the rectangle.

  • rx − used to round the corner of the rounded rectangle.

  • ry − used to round the corner of the rounded rectangle.

Example −

<rect x = "100" y = "30" width = "300" height = "100" style = "fill:rgb(121,0,121);stroke-width:3;stroke:rgb(0,0,0)" >
19.

How will you embed an SVG image in HTML page?

Answer»

SVG image can be embedded using following ways −

  • using embed tag

  • using object tag

  • using iframe

20.

Which element of SVG is used to create links?

Answer»

<a> element is used to create hyperlink. "xlink:href" attribute is used to pass the IRI (Internationalized Resource Identifiers) which is complementary to URI (Uniform Resource Identifiers).

21.

How to get a active SVG element using javascript?

Answer»

In javascript functions, event represents current event and can be used to get the target element on which event got raised.

22.

How to get a SVG document using javascript?

Answer»

In javascript functions, document represents SVG document and can be used to get the SVG elements.

23.

Are mouse events, keyboard events supported in SVG?

Answer»

Yes! SVG elements support mouse events, keyboard events. We've used onClick event to call a javascript functions.

24.

Can we write javascript functions in SVG images?

Answer»

Yes! SVG supports JavaScript/ECMAScript functions. Script block is to be in CDATA block consider character data support in XML.

25.

Can SVG images be made responsive to user actions?

Answer»

Yes! SVG images can be made responsive to user actions. SVG supports pointer events, keyboard events and document events.

26.

What is Radial Gradients in SVG

Answer»

Radial Gradients represents circular transition of one color to another from one direction to another. It is defined using <radialGradient> element.

27.

What is Linear Gradients in SVG

Answer»

Linear Gradients represents linear transition of one color to another from one direction to another. It is defined using <linearGradient> element.

28.

What are SVG Gradients?

Answer»

Gradient refers to smooth transition of one color to another color within a shape. SVG provides two types of gradients −

  • Linear Gradients

  • Radial Gradients

29.

What are SVG Patterns?

Answer»

SVG uses <pattern> element to define patterns. Patterns are defined using <pattern> element and are used to fill graphics elements in tiled fashion.

30.

Name some of the commonly used filers.

Answer»

SVG provides a rich set of filters. Following is the list of the commonly used filters −

  • feBlend

  • feColorMatrix

  • feComponentTransfer

  • feComposite

  • feConvolveMatrix

  • feDiffuseLighting

  • feDisplacementMap

31.

What are SVG filters?

Answer»

SVG uses <filter> element to define filters. <filter> element uses an id attribute to uniquely identify it.Filters are defined within <def> elements and then are referenced by graphics elements by their ids.

32.

Which stroke property used to create dashed lines?

Answer»

'stroke-dasharray' property used to create dashed lines.

33.

Which stroke property defines different types of ending of a line or outline of any path?

Answer»

'stroke-linecap' property defines different types of ending of a line or outline of any path.

34.

Which stroke property defines thickness of text, line or outline of any element?

Answer»

'stroke-width' property defines thickness of text, line or outline of any element.

35.

Which stroke property defines color of text, line or outline of any element?

Answer»

'stroke' property defines color of text, line or outline of any element.

36.

Which attribute of text tag of SVG sets the rendering length of the text?

Answer»

'textlength' attribute of text tag of SVG sets the rendering length of the text.

37.

Which attribute of text tag of SVG sets the rotation to be applied to all glyphs?

Answer»

'rotation' attribute of text tag of SVG sets the rotation to be applied to all glyphs.

38.

Which attribute of text tag of SVG represents the shift along with y-axis?

Answer»

'dy' attribute of text tag of SVG represents the shift along with y-axis.

39.

Which attribute of text tag of SVG represents the shift along with x-axis?

Answer»

'dx' attribute of text tag of SVG represents the shift along with x-axis.

40.

Which attribute of text tag of SVG represents the y axis cordinates of glyphs?

Answer»

'y' attribute of text tag of SVG represents the y axis cordinates of glyphs.

41.

Which attribute of text tag of SVG represents the x axis cordinates of glyphs?

Answer»

'x' attribute of text tag of SVG represents the x axis cordinates of glyphs.

42.

Which tag of SVG is used to draw text?

Answer»

'text' tag of SVG is used to draw text.

43.

Which tag of SVG is used to draw any path?

Answer»

'path' tag of SVG is used to draw any path.

44.

Which tag of SVG is used to draw a open shape consisting of connected straight lines?

Answer»

'polyline' tag of SVG is used to draw a open shape consisting of connected straight lines.

45.

Which tag of SVG is used to draw a closed shape consisting of connected straight lines?

Answer»

'polygon' tag of SVG is used to draw a closed shape consisting of connected straight lines.

46.

Which tag of SVG is used to draw a line?

Answer»

'line' tag of SVG is used to draw a line.

47.

Which tag of SVG is used to draw a ellipse?

Answer»

'ellipse' tag of SVG is used to draw a ellipse.

48.

Which tag of SVG is used to draw a circle?

Answer»

'circle' tag of SVG is used to draw a circle.

49.

Which tag of SVG is used to draw a rectangle?

Answer»

'rect' tag of SVG is used to draw a rectangle.

50.

What are the disadvantages of using SVG?

Answer»

Following are the disadvantages of using SVG images −

  • Being text format size is larger then compared to binary formatted raster images.

  • Size can be big even for small image.