YAML Programming MCQs

YAML Programming MCQs

The following YAML Programming MCQs have been compiled by our experts through research, in order to test your knowledge of the subject of YAML Programming. We encourage you to answer these 30 multiple-choice questions to assess your proficiency.
Please continue by scrolling down.

1: Which of the following syntaxes allows a user to define local datatype in YAML?

A.   ---
myObject: !myClass{name :joe,age:15}

B.   ---
myObject: !!myClass{name :joe,age:15}

C.   ---
myObject: *myClass{name :joe,age:15}

D.   ---
myObject: !- myClass{name :joe,age:15}

2: Which of the following are parts of the YAML information model?

A.   Composition

B.   Serialization

C.   Presentation

D.   Nodes

3: Which of the following stages of YAML information reconciliation is responsible for achieving portability between different programming environments?

A.   Presentation

B.   Serialization

C.   Representation

D.   Application

4: Which of the following correctly describes the syntax for representing an integer in YAML with scalar plus the global tag?

A.   "tag:yaml.org,2002:int"

B.   "globaltag:yaml.org,2002.int"

C.   "tag.yaml:org,2002:int"

D.   tag:yaml.org,2002:int

5: Which of the following statements correctly describes the functions performed by a YAML processor?

A.   It works on behalf of another module called application.

B.   It processes a syntax for presenting a YAML representation as a series of characters.

C.   It represents the tool for converting information between a YAML stream and a representation.

D.   It represents the tool for describing a class of data objects.

6: Which of the following correctly describes the syntax for declaring Verbatim tags?

A.   !<!> foo

B.   !<!bar>baz

C.   !<tag:yaml.org,2002:str> foo:

D.   !<$:?>bar

7: Which of the following correctly describes the anchor property of a node in YAML?

A.   It marks a node for future reference.

B.   It needs to be referenced by some alias node.

C.   It identifies the type of native data structure presented by the node.

D.   An anchor is denoted as ! indicator.

8: Which of the following correctly describes the functioning of YAML?

A.   It is used primarily for data storage.

B.   It is a non human-readable data serialization format.

C.   It is a superset of JSON.

D.   It is more verbose than XML.

9: Which of the following failure points can arise while loading native data structure from a YAML stream?

A.   Stream may be ill-formed.

B.   Aliases may be unidentified.

C.   Native may be available.

D.   Node styles may be unavailable.

10: Which of the following kinds of nodes helps in representing strings, integers, dates and other data types in YAML?

A.   Mapping

B.   Sequence

C.   Scalar

D.   None of the above

11: Analyze the following code snippet:
Line 1:%YAML 1.1
Line 2:    ---
Line 3:!!str
Line 4:"specific\L\
Line 5:trimmed\n\n\n
Line 6:as space"
Line 7:"foo"
Which of the following would be the output of the above code?

A.   Complied successfully

B.   Syntax error at line 5

C.   The case of a YAML directive should be small.

D.   Syntax error at line 6

12: Which of the following is the correct syntax for describing hashes of lists in YAML?

A.   men: [John Smith, Bill Jones]
women:
        - Mary, Smith,John
        - Susan W

B.   men: [John Smith, Bill Jones]
        -[ Mary Smith]
        - Susan Williams

C.   men: {John Smith, Bill Jones}
women:
        - [women:Mary Smith]
        - Susan

D.   men: [John Smith, Bill Jones]
women:
        - Mary Smith
        - Susan Will

13: Which of the following is the correct syntax for describing a list in YAML using inline format?

A.   [ruby,{Python},Perl]

B.   {ruby,{Python},Perl}

C.   [ruby,Python,Perl]

D.   {lang:ruby,Python,Perl}

14: Which of the following symbols is used to explicitly define a datatype in YAML?

A.   !!

B.   !

C.   &

D.   @

15: What is the final result produced by the compose stage during the processing of YAML information?

A.   A representation tree

B.   An ordered tree

C.   An event tree

D.   A representation graph

16: In which of the following cases are two nodes in YAML considered to be equal?

A.   If they represent the same tag

B.   If they represent the same content

C.   If they represent the same native data structure

D.   If they represent the same tag and content

17: What is the final outcome of the serialization process during the processing of YAML information?

A.   A YAML serialization graph

B.   A YAML serialization node

C.   A YAML serialization tree

D.   An unordered YAML serialization tree

18: Which of the following statements is not true about non-specific tags available in YAML?

A.   They must be resolved to specific tags for a complete representation graph.

B.   They must include local and global tags.

C.   They are useful only for plain scalars.

D.   They include non-specific tags such as ? and !.

19: Which of the following is the correct syntax for describing a list of hashes in YAML?

A.   - {name: John Smith, age: 33}
- name: Mary Smith
age: 27

B.   - [name: John , age: 33]
- name: Mary Smith
age: 27

C.   - name: John Smith, age: 33
- [name: Mary Smith]
age: 27

D.   - {name: John Smith, age: 33}
- - name: Mary Smith
[ age: 27]

20: Which of the following statements is/are true about parsing during the processing of YAML information?

A.   Parsing is the inverse of presentation.

B.   Parsing deals with formatting a series of characters in a human-friendly manner.

C.   Parsing discards all the details introduced in the presentation process.

D.   Parsing is responsible for producing a representation graph.

21: Which of the following non-specific tags are available in YAML?

A.   Local tag

B.   !

C.   ?

D.   Global tag

22: What is the use of --| indicator used in the code snippet below?
--- | There once was a man from Newyork
Who got on a Bus bound for Newjersey.
It said on the door "Please do not spit on the floor"

A.   It is used to remove the leading and trailing white spaces.

B.   It is used to preserve newlines as they appear.

C.   It ignores the newlines, as their only purpose is to make the text readable.

D.   None of the above

23: Which of the following is a valid format for declaring a numeric value as a string in YAML using an explicit datatype tag?

A.   !string 123

B.   !! char 123

C.   !! str 123

D.   @ str 123

24: Which of the following can be used to make ordered sequence of key:value pairs without duplicates?

A.   --- !omp
- Mark McGwire: 65
- Sammy Sosa: 63
- Ken Griffy: 58

B.   --- !!omap
- Mark McGwire: 65
- Sammy Sosa: 63
- Ken Griffy: 58

C.   --- !!map
- [Mark McGwire: 65]
- [Sammy Sosa: 63]
- Ken Griffy: 58

D.   --- !!otree
- [Mark McGwire: 65]
- [Sammy Sosa: 63]
- Ken Griffy: 58

25: Which of the following symbols is used to define nested tag namespace hierarchies in YAML?

A.   #

B.   /

C.   ::

D.   \

26: Which of the following stages is responsible for converting a series of characters into a human-friendly manner such as comments, directives?

A.   Representation

B.   Presentation

C.   Application

D.   Serialization

27: Which of the following is the correct syntax for describing hashes in YAML in inline block format?

A.   [username:smith,uid:1138]

B.   {username:smith,uid:11387}

C.   !Username:john,uid-1234

D.   - username:smith, uid:1138

28: Which of the following symbols allows you to declare local tag in an application using YAML?

A.   #

B.   !

C.   @

D.   :

29: Which of the following symbols allows you to declare comments in YAML?

A.   !

B.   @

C.   ?

D.   #

30: Which of the following translation stages are followed during the reconcilation of YAML information?

A.   Representation

B.   Serialization

C.   Application

D.   Presentation

31: Which of the following contents can be included in the YAML nodes?

A.   Scalar

B.   Serialization

C.   Mapping

D.   Sequence

E.   Tags

32: Which of the following Type specifiers is/are available in YAML?

A.   global URIs

B.   public

C.   private

D.   local

33: Which of the following presentation details are not considered while resolving the tag of a node in YAML?

A.   Comments

B.   Indentation

C.   The content of the key node directly along the path leading from the root to the resolved node

D.   The node style

34: What is the significance of the "++" sign in the YAML information model?

A.   It denotes serialization details.

B.   It denotes presentation details.

C.   It denotes node styles.

D.   It denotes relationships.

35: Which of the following parameters must be mentioned while resolving the tag of a node in YAML?

A.   The non-specific tag of the node

B.   The specific tag of the node

C.   The content of the node

D.   The path leading from the root node to the node

36: Which of the following correctly describes the characteristics of the flow style of node content in YAML?

A.   It starts and ends at some non-space character within a line.

B.   It uses indicators to denote structure.

C.   It always extends to the end of a line.

D.   It uses indentation to denote structure.

37: Which of the following correctly describes the Verbatim tags?

A.   It must be surrounded by the < and > characters.

B.   It marks a node for future reference.

C.   It requires the tag resolution method to be used.

D.   It must either begin with a ! or be a valid URI.

38: Which of the following character symbols should not be used with the primary tag handle?

A.   !

B.   Valid URI

C.   !!

D.   "TAG" directive