ExamGecko
Question list
Search
Search

Question 5 - JN0-223 discussion

Report
Export

YAML uses which two data structures? (Choose two.)

A.
arrays
Answers
A.
arrays
B.
mappings
Answers
B.
mappings
C.
sequences
Answers
C.
sequences
D.
objects
Answers
D.
objects
Suggested answer: B, C

Explanation:

YAML (YAML Ain't Markup Language) primarily uses two data structures:

Mappings: These are key-value pairs, similar to dictionaries or hashes in programming languages. In YAML, mappings are used to represent associative arrays or objects. They are defined with a colon (:) separating the key from the value.

Example:

key: value

name: John Doe

Sequences: These are ordered lists of items, equivalent to arrays or lists in other programming languages. Sequences in YAML are denoted by a dash (-) followed by a space and then the item.

Example:

fruits:

- Apple

- Banana

- Cherry

Detailed Explanation:

Mappings (B) allow you to define relationships between keys and values, making it possible to represent more complex data structures like dictionaries or objects.

Sequences (C) allow you to represent ordered collections, which is important for listing elements that must maintain a specific order.

YAML is often used in configuration files and data serialization in DevOps environments, such as in Ansible playbooks, Kubernetes manifest files, and CI/CD pipeline definitions. Its simplicity and human-readable format make it a popular choice for these applications.

YAML Official Documentation: YAML's specification outlines these core data structures.

Juniper Automation and DevOps Documentation: Provides best practices for using YAML in network automation scripts and configuration management.

asked 18/09/2024
Vusani Nedzungani
50 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first