JNCIA-DevOps Data Serialization Practice Question
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?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Behavior is undefined by the specification; typically the last defined key-value pair overwrites previous ones in Python dictionaries.
RFC 8259 states that while names within an object SHOULD be unique, the specification does not mandate how parsers should handle duplicates, resulting in behavior dependent on the parser (typically keeping the last encountered key-value pair).
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Behavior is undefined by the specification; typically the last defined key-value pair overwrites previous ones in Python dictionaries.
Why this is correct
Correct. Standard JSON parsers overwrite earlier keys with later ones when duplicates occur.
- ✗
Both values are automatically combined into a JSON array under that key.
Why it's wrong here
Incorrect. Parsers do not automatically merge duplicate keys into lists.
- ✗
Duplicate keys are prohibited, and compliance checks will reject the file pre-parsing.
Why it's wrong here
Incorrect. Pre-parsing compliance is not enforced by standard json modules.
- ✗
The parser must raise a fatal JSONDecodeError immediately.
Why it's wrong here
Incorrect. The JSON specification does not mandate throwing an error for duplicate keys.
About these practice questions
One of 306 original JNCIA-DevOps practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Juniper Networks exam blueprint
This JNCIA-DevOps practice question is part of Courseiva's free Juniper Networks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the JNCIA-DevOps exam.