SAUTO Network Programmability Foundation Practice Question
When parsing a complex JSON response from a Cisco Stealthwatch API call, you need to extract the value associated with a key nested deep within the hierarchy. Which Python approach is most idiomatic and robust for this task?
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
✓
Load the response into a dictionary using json.loads() and access the keys using a chain of square brackets.
Using the built-in json module to load the string into a dictionary and accessing keys via standard dictionary lookups is the most robust method.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Convert the JSON to XML and use XPath to navigate the structure.
Why it's wrong here
Converting to XML adds unnecessary overhead and complexity.
- ✓
Load the response into a dictionary using json.loads() and access the keys using a chain of square brackets.
Why this is correct
This is the standard, readable, and reliable way to interact with JSON data in Python.
- ✗
Use string slicing with find() to locate the key.
Why it's wrong here
String manipulation is fragile and error-prone compared to JSON object parsing.
- ✗
Use regex patterns to extract the value directly from the raw string.
Why it's wrong here
Regex is unsuitable for nested structured data and can easily break with minor formatting changes.
About these practice questions
This SAUTO question is part of Courseiva's 281-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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 Cisco exam blueprint
This SAUTO practice question is part of Courseiva's free Cisco 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 SAUTO exam.