200-901 Infrastructure and Automation Practice Question
A developer is designing a data model for network device configurations using YANG. They need to represent a list of interfaces where each interface has a name (string) and speed (enumeration). Which YANG statement correctly defines this structure?
⚠ Common exam trap
Cisco often tests the requirement of the `key` statement in a YANG `list`; candidates may forget that a list without a key is syntactically invalid, leading them to choose option D.
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
✓
list interface { key name; leaf name { type string; } leaf speed { type enumeration; } }
YANG requires a `list` statement to define a collection of entries with multiple leafs, and a `key` statement to uniquely identify each list entry. The `list interface` with `key name` allows multiple interfaces, each having both a `name` (string) and `speed` (enumeration), matching the requirement exactly.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
leaf interface-list { type string; }
Why it's wrong here
A leaf cannot represent multiple entries; use a list.
- ✗
leaf-list interface { type string; }
Why it's wrong here
leaf-list is for a single-typed list, cannot group name and speed together.
- ✓
list interface { key name; leaf name { type string; } leaf speed { type enumeration; } }
Why this is correct
This defines a list with a key, and two leaves for name and speed.
- ✗
list interface { leaf name { type string; } leaf speed { type enumeration; } }
Why it's wrong here
A list must have a key leaf to uniquely identify each entry.
Go deeper
Related to this question
About these practice questions
One of 989 original 200-901 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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 200-901 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 200-901 exam.