WGU D416 DevNet Fundamentals
Practice Exam with correct
answers in bold and rationale
graded A+ updated 2026
Section 1: Software Development and Design
Question 1
A development team is implementing a workflow where all code is committed to a
single shared branch, with developers integrating their changes at least daily. Which
software development methodology does this describe?
• A. Git Flow
• B. Waterfall
• C. Trunk-based development
• D. Long-lived feature branching
Rationale: Trunk-based development is characterized by developers committing to a
single branch (the "trunk") frequently, often multiple times per day. This approach
reduces merge conflicts and facilitates continuous integration. Git Flow uses multiple
long-lived branches and is not designed for daily integration. Waterfall is a
sequential methodology that does not emphasize frequent integration. Long-lived
feature branches create divergence and increase merge conflict risk.
Question 2
In a Python script using the Netmiko library, a network engineer needs to capture
and parse the output of show ip interface brief to extract interfaces that are up and have
an IP address. Which approach is the most robust and maintainable?
• A. Use send_command() with use_textfsm=True and filter the structured data
• B. Use send_command() and split the output by newline, then use string slicing
• C. Use send_command() and regex to match lines containing "up" and an IP
address
• D. Use send_command_timing() and manually strip ANSI codes before parsing
,Rationale: Netmiko's TextFSM integration parses command output into structured
data (typically a list of dictionaries), making filtering by state and IP address
straightforward and less error-prone than manual parsing. String slicing is brittle
because it depends on fixed column widths. Regex is error-prone due to varying
output formats across device models and IOS versions. ANSI stripping does not
provide structured parsing.
Question 3
A network engineer is evaluating YANG models for a multi-vendor automation
project. The requirement is to manage interfaces across devices from different
vendors while ensuring configuration consistency. Which approach is most
appropriate?
• A. Use OpenConfig models for read operations and native models for write
operations
• B. Use OpenConfig models because they are vendor-neutral and provide
a consistent abstraction
• C. Use native Cisco models because they offer full feature coverage
• D. Use native models for each vendor and write separate automation logic for
each
Rationale: OpenConfig models are designed specifically for multi-vendor
interoperability, providing a common data model that reduces integration
complexity. Mixing models for read and write operations can cause inconsistencies.
Native models, while potentially offering more detailed features, are vendor-specific
and defeat the purpose of a unified automation strategy.
Question 4
Which Python method converts a JSON-formatted string into a Python dictionary?
• A. json.dumps()
• B. json.loads()
• C. yaml.safe_load()
• D. xml.etree.ElementTree.parse()
Rationale: json.loads() takes a JSON-formatted string and converts it into a Python
object such as a dictionary or list. json.dumps() performs the opposite operation,
converting a Python object into a JSON string. yaml.safe_load() parses YAML data, not
JSON. xml.etree.ElementTree.parse() parses XML data.
Question 5
,What is the recommended maximum number of lines to review at one time during a
code review?
• A. 200 lines
• B. Less than 400 lines
• C. 800 lines
• D. The entire file regardless of size
Rationale: Research and industry best practices recommend reviewing less than 400
lines of code at a time. Smaller, focused reviews help maintain concentration, reduce
fatigue, and improve defect detection. Reviewing too much code in one session leads
to oversight and decreases the quality of feedback.
Question 6
Which data structure is most appropriate for storing hierarchical data about network
devices, including hostname, IP address, and a list of VLANs?
• A. List of strings
• B. Dictionary
• C. Set
• D. Tuple
Rationale: Dictionaries allow you to organize data in key-value pairs, making it easy
to retrieve and manipulate specific attributes of each device. Lists of strings cannot
organize hierarchical key-value data. Sets are unordered and only hold unique items.
Tuples are immutable and better suited for fixed collections.
Question 7
What is the primary purpose of a .gitignore file in a Git repository?
• A. To track changes to large binary files
• B. To specify files and directories that Git should not track
• C. To merge branches automatically
• D. To store encryption keys for the repository
Rationale: A .gitignore file tells Git which files or patterns to exclude from version
control, such as build artifacts, temporary files, or environment-specific configuration.
It does not track binary files, merge branches, or store encryption keys.
Question 8
, Which software development approach emphasizes delivering working software
frequently with a preference for shorter cycle times and reduced documentation
overhead?
• A. Waterfall
• B. Agile
• C. Spiral
• D. V-Model
Rationale: Agile methodologies emphasize iterative development, frequent delivery
of working software, and responsiveness to change over comprehensive
documentation. Waterfall, Spiral, and V-Model are more sequential and
documentation-heavy approaches.
Question 9
In the context of the Observer design pattern, what is the primary role of the
Subject?
• A. To modify its behavior based on notifications
• B. To maintain a list of observers and notify them of state changes
• C. To encapsulate a family of algorithms
• D. To provide a simplified interface to a complex subsystem
Rationale: The Observer pattern defines a one-to-many dependency between
objects. The Subject maintains a list of observers and automatically notifies them
when its state changes. Observers modify their behavior based on these notifications.
Encapsulating algorithms describes the Strategy pattern, and simplifying interfaces
describes the Facade pattern.
Question 10
Which Git command creates a new branch and switches to it in a single operation?
• A. git branch new-branch
• B. git checkout -b new-branch
• C. git merge new-branch
• D. git rebase new-branch
Rationale: git checkout -b new-branch creates a new branch and immediately switches to
it. git branch alone creates a branch but does not switch. git merge integrates changes
from one branch into another. git rebase reapplies commits on top of another base.
Practice Exam with correct
answers in bold and rationale
graded A+ updated 2026
Section 1: Software Development and Design
Question 1
A development team is implementing a workflow where all code is committed to a
single shared branch, with developers integrating their changes at least daily. Which
software development methodology does this describe?
• A. Git Flow
• B. Waterfall
• C. Trunk-based development
• D. Long-lived feature branching
Rationale: Trunk-based development is characterized by developers committing to a
single branch (the "trunk") frequently, often multiple times per day. This approach
reduces merge conflicts and facilitates continuous integration. Git Flow uses multiple
long-lived branches and is not designed for daily integration. Waterfall is a
sequential methodology that does not emphasize frequent integration. Long-lived
feature branches create divergence and increase merge conflict risk.
Question 2
In a Python script using the Netmiko library, a network engineer needs to capture
and parse the output of show ip interface brief to extract interfaces that are up and have
an IP address. Which approach is the most robust and maintainable?
• A. Use send_command() with use_textfsm=True and filter the structured data
• B. Use send_command() and split the output by newline, then use string slicing
• C. Use send_command() and regex to match lines containing "up" and an IP
address
• D. Use send_command_timing() and manually strip ANSI codes before parsing
,Rationale: Netmiko's TextFSM integration parses command output into structured
data (typically a list of dictionaries), making filtering by state and IP address
straightforward and less error-prone than manual parsing. String slicing is brittle
because it depends on fixed column widths. Regex is error-prone due to varying
output formats across device models and IOS versions. ANSI stripping does not
provide structured parsing.
Question 3
A network engineer is evaluating YANG models for a multi-vendor automation
project. The requirement is to manage interfaces across devices from different
vendors while ensuring configuration consistency. Which approach is most
appropriate?
• A. Use OpenConfig models for read operations and native models for write
operations
• B. Use OpenConfig models because they are vendor-neutral and provide
a consistent abstraction
• C. Use native Cisco models because they offer full feature coverage
• D. Use native models for each vendor and write separate automation logic for
each
Rationale: OpenConfig models are designed specifically for multi-vendor
interoperability, providing a common data model that reduces integration
complexity. Mixing models for read and write operations can cause inconsistencies.
Native models, while potentially offering more detailed features, are vendor-specific
and defeat the purpose of a unified automation strategy.
Question 4
Which Python method converts a JSON-formatted string into a Python dictionary?
• A. json.dumps()
• B. json.loads()
• C. yaml.safe_load()
• D. xml.etree.ElementTree.parse()
Rationale: json.loads() takes a JSON-formatted string and converts it into a Python
object such as a dictionary or list. json.dumps() performs the opposite operation,
converting a Python object into a JSON string. yaml.safe_load() parses YAML data, not
JSON. xml.etree.ElementTree.parse() parses XML data.
Question 5
,What is the recommended maximum number of lines to review at one time during a
code review?
• A. 200 lines
• B. Less than 400 lines
• C. 800 lines
• D. The entire file regardless of size
Rationale: Research and industry best practices recommend reviewing less than 400
lines of code at a time. Smaller, focused reviews help maintain concentration, reduce
fatigue, and improve defect detection. Reviewing too much code in one session leads
to oversight and decreases the quality of feedback.
Question 6
Which data structure is most appropriate for storing hierarchical data about network
devices, including hostname, IP address, and a list of VLANs?
• A. List of strings
• B. Dictionary
• C. Set
• D. Tuple
Rationale: Dictionaries allow you to organize data in key-value pairs, making it easy
to retrieve and manipulate specific attributes of each device. Lists of strings cannot
organize hierarchical key-value data. Sets are unordered and only hold unique items.
Tuples are immutable and better suited for fixed collections.
Question 7
What is the primary purpose of a .gitignore file in a Git repository?
• A. To track changes to large binary files
• B. To specify files and directories that Git should not track
• C. To merge branches automatically
• D. To store encryption keys for the repository
Rationale: A .gitignore file tells Git which files or patterns to exclude from version
control, such as build artifacts, temporary files, or environment-specific configuration.
It does not track binary files, merge branches, or store encryption keys.
Question 8
, Which software development approach emphasizes delivering working software
frequently with a preference for shorter cycle times and reduced documentation
overhead?
• A. Waterfall
• B. Agile
• C. Spiral
• D. V-Model
Rationale: Agile methodologies emphasize iterative development, frequent delivery
of working software, and responsiveness to change over comprehensive
documentation. Waterfall, Spiral, and V-Model are more sequential and
documentation-heavy approaches.
Question 9
In the context of the Observer design pattern, what is the primary role of the
Subject?
• A. To modify its behavior based on notifications
• B. To maintain a list of observers and notify them of state changes
• C. To encapsulate a family of algorithms
• D. To provide a simplified interface to a complex subsystem
Rationale: The Observer pattern defines a one-to-many dependency between
objects. The Subject maintains a list of observers and automatically notifies them
when its state changes. Observers modify their behavior based on these notifications.
Encapsulating algorithms describes the Strategy pattern, and simplifying interfaces
describes the Facade pattern.
Question 10
Which Git command creates a new branch and switches to it in a single operation?
• A. git branch new-branch
• B. git checkout -b new-branch
• C. git merge new-branch
• D. git rebase new-branch
Rationale: git checkout -b new-branch creates a new branch and immediately switches to
it. git branch alone creates a branch but does not switch. git merge integrates changes
from one branch into another. git rebase reapplies commits on top of another base.