Courseiva

JNCIA-DevOps · domain

Data Serialization

Practise Juniper Networks Automation and DevOps, Associate (JNCIA-DevOps, JN0-224) (JNCIA-DevOps) Data Serialization practice questions — original exam-style scenarios with answer choices, explanations, and analysis of common mistakes.

67 questions22 easy23 medium22 hard

Focused practice

Practice Data Serialization questions

Scored sessions drawing only from this domain — pick a length below.

Start 20-question practice test →

What this domain covers

What to know about Data Serialization

Data Serialization questions test whether you can apply the concept in context, not just recognise a definition.

How the topic appears in realistic exam-style scenarios.

Which detail in the question changes the correct answer.

How to eliminate plausible but wrong options.

How to connect the question back to the wider exam objective.

Watch out for

Common Data Serialization exam traps

  • Answering from memory before reading the full scenario.
  • Missing a constraint such as cost, availability, security, scope or command context.
  • Choosing a broad answer when the question asks for the most specific fix.
  • Ignoring why the wrong options are tempting.

Question index

All Data Serialization questions (67)

Click any question to see the full explanation, or start a practice session above.

1

An engineer needs to convert an existing YAML-formatted inventory file into JSON format using a Python script. Which workflow accomplishes this transformation?

Medium
2

You are writing a Python automation tool that reads telemetry data from a Junos device. The data is received as a JSON string containing forward slashes escaped as '\/'. When you load this string using json.loads(), how does Python handle the escaped slashes?

Hard
3

Which symbol represents the beginning of a single YAML document stream?

Easy
4

Which TWO Python exceptions might be raised when attempting to parse a malformed JSON string using the standard 'json' module? (Choose two)

Medium
5

An automation engineer wants to log structured data from a Junos device automation run. The Python script formats a dictionary into a JSON string and prints it. However, the engineer wants all keys sorted alphabetically to ensure consistent log diffing. Which parameter accomplishes this in json.dumps()?

Medium
6

When writing a Python script to interact with a Junos device via PyEZ, you receive an object representing RPC output. You want to serialize a custom Python class instance containing device metadata into JSON, but calling json.dumps() raises a TypeError. What is the standard approach to resolve this?

Hard
7

You are writing a Python script to convert a complex Juniper device inventory from YAML format into JSON format using PyYAML and the built-in json module. Which THREE considerations must you keep in mind regarding differences between YAML and JSON during this conversion? (Choose three)

Hard
8

Which of the following primitive data types is NOT supported natively in JSON?

Easy
9

An automation scripter needs to load a YAML configuration file in Python. To prevent arbitrary code execution vulnerabilities associated with untrusted files, which function should always be called?

Medium
10

Which TWO characters or sequences are valid in YAML for representing lists or sequences? (Choose two)

Easy
11

An automation engineer writes a Python script that reads a Junos configuration file serialized in JSON. The file opens successfully, but parsing fails with a JSONDecodeError due to trailing commas at the end of object lists. How does standard JSON handle trailing commas compared to YAML?

Medium
12

When converting a deeply nested JSON data structure representing Junos device health metrics into YAML using PyYAML, the output uses complex block styles that are difficult for team members to read. Which parameter in yaml.safe_dump() can force scalar values or containers to prefer flow style (JSON-like curly braces and brackets) instead?

Hard
13

An automation engineer is writing a Python script to parse a Juniper Junos NETCONF reply received in XML format and needs to convert it into a JSON structure for easier manipulation in a web application. Which built-in Python module is primarily used to handle JSON data serialization and deserialization?

Easy
14

You are writing a Python script that parses a multi-document YAML stream containing Junos device site configurations. One of the documents contains a custom YAML tag. When parsing with yaml.safe_load_all(), how does the safe loader handle custom tags?

Hard
15

An automation script reads interface names and VLAN IDs from a CSV file and converts each row into a JSON object before sending it to a Junos device REST API. Which Python module is specifically designed to parse CSV (Comma-Separated Values) files?

Medium
16

You are writing a Python automation script that reads a Junos configuration file in JSON format. The JSON file contains duplicate keys within the same object scope. According to the JSON specification RFC 8259, how should a conforming JSON parser handle duplicate keys?

Hard
17

An engineer receives a YAML configuration snippet for a PyEZ automation script, but the script fails with a parser error. Upon inspection, the error is caused by improper indentation levels. Which rule must be strictly followed regarding indentation in YAML syntax?

Medium
18

An automation engineer needs to convert a JSON payload representing Junos interface configurations into equivalent YAML format to reuse in an Ansible playbook. Which fundamental structural relationship between JSON and YAML makes this conversion straightforward?

Medium
19

An automation engineer is reviewing data serialization formats used within Junos automation workflows. Which TWO statements are correct regarding JSON syntax and data types? (Choose two)

Medium
20

During script development, an engineer encounters a YAML file containing comments and multiple configuration documents separated by document markers. Which characters are used to denote the start of a new document within a single YAML file stream?

Medium
21

A Python script retrieves interface statistics from a Junos device in JSON format, modifies a threshold value, and needs to output it back into a formatted JSON string with an indentation level of 4 spaces for readability. Which Python snippet achieves this?

Medium
22

An automation engineer needs to pretty-print a JSON payload in the Linux terminal for debugging Junos telemetry. Which built-in Python command-line utility can be invoked to validate and pretty-print a JSON file?

Medium
23

An automation engineer wants to verify the syntax of a large YAML playbook before executing it against a production Junos device. Which python one-liner command can be run in the terminal to quickly check if the file is syntactically valid YAML?

Medium
24

A Python automation script extracts routing table entries from a Junos device. The data structure contains deeply nested dictionaries and lists. The engineer needs to perform a deep copy of this deserialized JSON structure before modifying it. Which Python module provides the deepcopy function needed to duplicate nested containers safely?

Hard
25

A network automation script is reading a YAML configuration file containing Junos device credentials. The script encounters an unhandled exception when attempting to load the file using PyYAML. Upon inspection, the error is caused by a tab character used for indentation instead of spaces. Which YAML specification rule does this violate?

Medium
26

Which TWO of the following are valid scalar values in a YAML document? (Choose two)

Easy
27

Which of the following valid JSON values represents a boolean true state?

Easy
28

An automation developer is examining a JSON response payload returned by a Juniper device via a REST API call. Which valid JSON data type is used to represent an ordered list of values enclosed within square brackets?

Easy
29

An automation script reads a multi-document YAML file containing configuration templates for various Junos router models. To process each document individually in Python using PyYAML, which function should the engineer invoke?

Hard
30

Which file extension is conventionally used for YAML data serialization files?

Easy
31

A Python script reads a Junos configuration snippet stored in YAML. The configuration uses YAML anchors and aliases to duplicate common routing policy definitions across multiple VRFs. When the script parses the file using yaml.safe_load(), what happens to the anchors and aliases?

Hard
32

Which of the following characters is used to start a comment line in a YAML document?

Easy
33

An automation engineer is writing a script that saves operational telemetry data gathered from a Junos router. The data needs to be written directly to an open file stream in JSON format. Which method from the Python 'json' module should be used?

Medium
34

An engineer needs to represent an ordered list of IP addresses in a YAML configuration file for a Junos automation playbook. Which valid YAML syntax correctly defines a sequence of items?

Easy
35

You are writing a Python automation script that processes JSON output from a Junos device's 'show interfaces' operational command via PyEZ. One of the interface descriptions contains raw control characters. When the script attempts to dump this data to a JSON string using json.dumps(), it raises a ValueError. Which parameter should you pass to json.dumps() to handle non-printable or out-of-range character encoding gracefully?

Hard
36

Which Python function deserializes a JSON-formatted string into a native Python dictionary?

Easy
37

An automation engineer is writing a Python script that takes a complex nested Python dictionary containing Junos telemetry parameters and converts it into a YAML string. Which PyYAML function should be used?

Medium
38

Which TWO features are supported by YAML but are notably absent in standard JSON? (Choose two)

Medium
39

When serializing complex nested Python dictionaries to JSON, which THREE data types will cause a TypeError unless handled by a custom default encoder function? (Choose three)

Hard
40

When writing an automation script that converts data formats between YAML and JSON for Junos configuration pipelines, which THREE potential pitfalls should an engineer account for? (Choose three)

Hard
41

An automation script reads a configuration template where boolean values are represented as 'yes' and 'no' in YAML. When parsed using PyYAML in Python, how are these values interpreted?

Medium
42

When serializing Python data structures to JSON for Junos automation payloads, which THREE parameters can be passed to json.dumps() to control formatting and readability? (Choose three)

Hard
43

An automation engineer needs to include comments explaining complex network parameters inside a Junos automation data file. Which serialization format should the engineer select?

Medium
44

You are writing a Python script using the PyEZ library to retrieve interface facts from a Juniper EX Series switch. The resulting data structure is stored in a Python dictionary. You need to dump this dictionary into a YAML file so it can be read by an Ansible playbook later. Which PyYAML function should you use to convert the Python dictionary into a YAML-formatted string or file stream?

Hard
45

What is the native data format returned by Junos devices when queried via REST API or NETCONF operations configured with JSON output formatting?

Easy
46

When working with PyYAML in Python for Junos automation scripts, which THREE of the following practices enhance script security and robustness? (Choose three)

Hard
47

An automation engineer is writing a Python script to push configurations to a Junos device. The script loads a YAML data file containing interface descriptions. One description contains a colon without a following space (e.g., 'Interface:Primary'). What error will PyYAML raise when attempting to parse this file?

Medium
48

An automation script needs to convert a JSON string containing Juniper interface statistics into a YAML format to maintain consistency with existing Ansible variable files. When performing this conversion, which structural capability does YAML support that standard JSON does not?

Hard
49

Which TWO of the following are valid primitive data types in JSON? (Choose two)

Easy
50

What is the primary delimiter used to separate key-value pairs in a JSON object?

Easy
51

A Python script processes a YAML configuration template for Junos BGP neighbors. The configuration contains a multi-line banner string description. Which YAML block scalar indicator preserves newlines exactly as written in the text block?

Hard
52

You are writing a Python automation script that processes configuration data. The script reads a YAML file containing Junos firewall filters, modifies them, and writes them back out. However, you notice that all the original comments in the file are stripped out in the output. What is the fundamental reason for this behavior in standard PyYAML dump operations?

Hard
53

What type of brackets enclose an array in a JSON document?

Easy
54

An automation engineer is writing a Python script to parse a Juniper Junos NETCONF reply received in XML format and needs to convert it into a native Python dictionary for internal processing. Which built-in library should the engineer use to convert the structured XML tree?

Easy
55

Which of the following describes the fundamental structural difference between JSON and YAML regarding syntax design?

Easy
56

An engineer writes a Python script that loads a JSON configuration file using the json.load() method. The file contains configuration parameters for a Junos device. If the JSON file contains a trailing comma at the end of the last element in an array, what will happen when the script executes?

Medium
57

You are writing a Python script that converts a Junos operational state output from XML (via NETCONF) into JSON. The XML structure contains sibling elements with the same tag name. When converted naively, how do standard XML-to-JSON conversion libraries (like xmltodict) typically represent these repeated sibling elements in the resulting JSON dictionary?

Hard
58

Which TWO methods are provided by the Python standard library 'json' module for deserializing JSON data? (Choose two)

Medium
59

When parsing a Junos configuration snippet in YAML, an engineer notices a string value starting with a zero (e.g., '01234') that is unquoted. How do YAML parsers typically interpret this value?

Hard
60

Which character is used to indicate a mapping key-value pair in YAML syntax?

Easy
61

Which TWO Python standard library modules are commonly combined when a script needs to fetch web content (such as Junos REST API data) and parse the resulting payload? (Choose two)

Medium
62

An automation developer is designing a script that reads routing policy parameters from a configuration file. Which TWO data formats are natively supported and commonly used across Junos automation toolchains like PyEZ, Ansible, and REST APIs for data serialization? (Choose two)

Easy
63

A Python automation script parses a Junos telemetry stream in JSON. The JSON payload uses integer keys in a dictionary (e.g., {443: 'HTTPS'}). When loaded into Python using json.loads(), what data type do the dictionary keys become?

Hard
64

Which of the following data types is natively supported in JSON without requiring custom serialization handlers?

Easy
65

A Python script receives a JSON payload from a Junos device containing 64-bit interface counter integers. When loaded using the standard 'json' module, the script experiences precision loss on counter values exceeding standard integer limits. Which alternative JSON parser package for Python should be used to handle high-precision integers without data degradation?

Hard
66

Which TWO of the following are valid extensions commonly used for YAML files? (Choose two)

Easy
67

Which Python module is part of the standard library and provides functions to serialize and deserialize JSON data?

Easy

Frequently asked questions

What does the Data Serialization domain cover on the JNCIA-DevOps exam?
Data Serialization questions test whether you can apply the concept in context, not just recognise a definition.
How many questions are in this domain?
This page lists all 67 Data Serialization questions in the JNCIA-DevOps question bank. The actual exam draws from this domain proportionally to its weighting in the official exam blueprint.
What is the best way to practise this domain?
Start with a short focused session (10 questions) to identify gaps, then work through explanations. Repeat with a longer session once the weak areas feel solid.
Can I practise only Data Serialization questions?
Yes — the session launcher on this page filters questions to this domain only. Choose any session length for inline explanations and scoring.
Juniper Networks Automation and DevOps, Associate (JNCIA-DevOps, JN0-224) (JNCIA-DevOps) Data Serialization Practice Questions