Skip to main content
Practice set 1 is free for every certification. Unlock sets 2-5 for $10.

Last updated: May 2026

Practice Exam

200-901 CCNAAUTO — Cisco Certified Network Associate (CCNA) Automation

Test your knowledge with official exam-style questions

Questions25PassingPass/Fail (scaled score not published)Exam time120 min

Questions and options are shuffled each attempt

Email me this practice set

Get a link sent to your inbox so you can pick this back up anytime.

▶Cisco Certified Network Associate (CCNA) Automation — Practice Set 1: All Questions & Explanations

Full question text, answer options, and explanations for this practice set — a spoiler-free alternative is the interactive quiz above for scored, shuffled practice.

  1. 1. A Python script calls a REST API and parses the body with `data = json.loads(response.text)`. The body is: {"name": "SW1", "interfaces": [{"id": "Gi1/0/1", "up": true}, {"id": "Gi1/0/2", "up": false}]} Which expression returns the id of the second interface?

    • A. data["interfaces"][1]["id"](correct)
    • B. data["interfaces"][2]["id"]
    • C. data.interfaces[1].id
    • D. data["interfaces"]["id"][1]

    Explanation: The json module decodes a JSON object to a dict and a JSON array to a list, so data["interfaces"] is a list of dicts. The second element is index 1, and its id is read with the key "id". Why the other options are wrong: (B) Python lists are zero-indexed, so index 2 is the third element; this raises IndexError because only indexes 0 and 1 exist. (C) A JSON object is decoded into a plain dict, which does not support attribute access; this raises AttributeError. (D) data["interfaces"] is a list, and list indexes must be integers, so using the string "id" raises TypeError.

  2. 2. A team tracks `devices.yml` in a Git repository. They decide to stop tracking it (it will be listed in .gitignore) but every engineer must keep the local copy on disk. Which command stages the removal from version control without deleting the working-tree file?

    • A. git rm --cached devices.yml(correct)
    • B. git rm devices.yml
    • C. git add devices.yml
    • D. git diff --cached devices.yml

    Explanation: git rm --cached removes the path from the index only, leaving the file in the working tree, so the next commit stops tracking it. Plain git rm removes it from both the working tree and the index. Why the other options are wrong: (B) Without --cached, git rm removes the file from both the working tree and the index, so the local copy would be deleted. (C) git add records the file's current contents in the index, which keeps it tracked rather than untracking it. (D) git diff only displays differences between the index and a commit; it never changes what is tracked.

  3. 3. Which statement describes a direct advantage of keeping network automation scripts in a version control system such as Git?

    • A. It records changes over time so you can compare versions, see who last modified a file, and revert a file or the whole project to a previous state(correct)
    • B. It guarantees that scripts committed to the repository contain no bugs
    • C. It automatically encrypts any credentials stored inside committed files
    • D. It removes the need for more than one engineer to coordinate on the same script

    Explanation: The Pro Git book describes version control as a system that records changes to files over time so you can recall specific versions, revert files or the project, compare changes over time, and see who last modified something. Why the other options are wrong: (B) A version control system tracks changes; it does not test or validate the logic of the code. (C) Version control does not encrypt file contents; secrets committed to a repository remain readable in its history. (D) Version control helps teams work on shared files and compare changes, but coordination (reviews, branches, merges) is still required.

  4. 4. A developer is building a function that validates VLAN IDs and wants to follow test-driven development (TDD). Which sequence matches the TDD cycle?

    • A. Write the complete function first, add tests afterwards to document the behavior, then refactor
    • B. Refactor the existing code base first, then write the function, and write tests only if a defect is reported
    • C. Write a test for the next piece of functionality, write just enough code to make it pass, then refactor the new and old code(correct)
    • D. Deploy the function to production, observe failures, and then write tests that reproduce them

    Explanation: Fowler describes TDD as three repeated steps: write a test for the next bit of functionality, write the functional code until the test passes, and refactor both new and old code (often summarized as Red-Green-Refactor). Why the other options are wrong: (A) That is test-last development; TDD writes the test before the functional code. (B) TDD does not begin with refactoring or defer tests until a defect; each increment starts with a test. (D) Waiting for production failures is the opposite of TDD, which drives development with tests written up front.

  5. 5. A Python script sends a POST request to create a new VLAN through a REST API, and the server successfully creates the resource. Which response status code best indicates that outcome?

    • A. 201 Created, normally with a Location header identifying the new resource(correct)
    • B. 202 Accepted
    • C. 204 No Content
    • D. 304 Not Modified

    Explanation: RFC 9110 defines 201 (Created) as indicating the request was fulfilled and resulted in one or more new resources; for POST the server SHOULD include a Location header identifying the primary resource created. Why the other options are wrong: (B) 202 means the request was accepted but processing is not complete; it does not state that the resource has been created. (C) 204 means the request succeeded with no content to return; it does not signal that a new resource was created. (D) 304 is a response to a conditional GET/HEAD indicating the cached copy is still valid; it is not a creation result.

  6. 6. A script runs `requests.get("https://api.example.com/devices", params={"site": "HQ", "limit": 10})`. Which URL is requested?

    • A. https://api.example.com/devices/site/HQ/limit/10
    • B. https://api.example.com/devices, with site and limit sent in a JSON request body
    • C. https://api.example.com/devices#site=HQ&limit=10
    • D. https://api.example.com/devices?site=HQ&limit=10(correct)

    Explanation: The Requests library accepts a dictionary through params and appends it to the URL as key=value pairs after a question mark, so the request goes to /devices?site=HQ&limit=10. Why the other options are wrong: (A) The params dictionary is encoded into the query string; it never builds path segments. (B) The params argument always goes into the URL query string; a JSON body would require the json= argument. (C) Parameters are appended after a question mark as a query string, not placed in the URL fragment.

  7. 7. An API uses HTTP Basic authentication. A script must send the user `admin` with the password `Cisco123`. Which Authorization header is correct?

    • A. Authorization: Basic Q2lzY28xMjM6YWRtaW4=
    • B. Authorization: Basic admin:Cisco123
    • C. Authorization: Basic YWRtaW46Q2lzY28xMjM=(correct)
    • D. Authorization: Bearer YWRtaW46Q2lzY28xMjM=

    Explanation: RFC 7617 builds the credentials by joining the user-id, a single colon and the password (admin:Cisco123), encoding that string with Base64 (YWRtaW46Q2lzY28xMjM=), and sending it after the Basic scheme name. Why the other options are wrong: (A) That value is the Base64 of the password and user in the wrong order (Cisco123:admin); the user-id must come first. (B) The user-id:password string must be Base64 encoded; sending it unencoded does not follow the scheme. (D) The encoded value is right but the scheme is wrong; Basic credentials use the Basic scheme, not Bearer.

  8. 8. A script that updates many Meraki networks receives HTTP 429 responses that include a Retry-After header. What is the correct way to handle this?

    • A. Immediately resend the same request in a tight loop until it succeeds
    • B. Wait for the time given in Retry-After, then resend the request (with a backoff for sustained high volume)(correct)
    • C. Generate a new API key, because 429 means the key is invalid
    • D. Treat 429 as a permanent failure and skip the remaining devices

    Explanation: Meraki documents that exceeding the rate limit returns 429 with a Retry-After header telling you how long to wait; the script should pause for that interval and use a backoff. Why the other options are wrong: (A) Hammering the API keeps exceeding the limit; the documentation says to pause using Retry-After. (C) An invalid key produces 401; 429 means too many requests, not bad credentials. (D) 429 is transient; the request can succeed after the indicated wait.

  9. 9. The Meraki Dashboard API documentation lists networks with `GET /organizations/:organizationId/networks` and requires a bearer token. Which request correctly lists the networks of organization 549236?

    • A. GET https://api.meraki.com/api/v1/organizations/549236/networks with the header X-Cisco-Meraki-API-Key: <API key>
    • B. GET https://api.meraki.com/api/v1/organizations/549236/networks with the header Authorization: Bearer <API key>(correct)
    • C. POST https://api.meraki.com/api/v1/organizations/549236/networks with the header Authorization: Bearer <API key>
    • D. GET https://api.meraki.com/api/v1/organizations/549236/devices with the header Authorization: Bearer <API key>

    Explanation: The Getting Started guide shows GET /organizations/:organizationId/networks under the base URI https://api.meraki.com/api/v1, and the Authentication page states that v1 uses Authorization: Bearer <API key> rather than v0's X-Cisco-Meraki-API-Key. Why the other options are wrong: (A) That header belongs to the old v0 API; the v1 documentation specifies the Authorization: Bearer header. (C) The documented operation for listing networks is GET; a POST would not be a read request. (D) That path lists the devices of the organization, not its networks.

  10. 10. A developer has no lab hardware and wants to run and test REST calls against a live Cisco Catalyst Center instance on shared infrastructure for free. Which DevNet resource fits?

    • A. DevNet Sandbox(correct)
    • B. DevNet Code Exchange
    • C. DevNet Learning Labs
    • D. The API reference documentation

    Explanation: DevNet Sandbox lets you 'run your code on live infrastructure' to develop and test Cisco APIs and SDKs for free, and includes an always-on Catalyst Center sandbox for REST clients. Why the other options are wrong: (B) Code Exchange is a catalog of curated GitHub projects and sample code; it does not provide live infrastructure to run calls against. (C) Learning Labs are guided, interactive tutorials; they teach concepts but are not the shared live environments used to test your own code. (D) Documentation describes endpoints and payloads, but you cannot send live requests to a controller from the reference alone.

  11. 11. Which Cisco Catalyst Center interface is the northbound REST API that uses HTTPS verbs (GET, POST, PUT, DELETE) with JSON to discover and control the network?

    • A. The Events and Notifications (eastbound) interface
    • B. The Intent API(correct)
    • C. The Integration API (westbound) used for ITSM integration
    • D. The device console accessed over Telnet

    Explanation: Catalyst Center documents the Intent API as a northbound REST API that uses HTTPS verbs with JSON to discover and control the network, organized into functional domains and subdomains. Why the other options are wrong: (A) That interface lets Catalyst Center send event notifications to external systems; it is not the REST API used to query and control the network. (C) Westbound integration connects Assurance workflows and data to ITSM platforms; it is not the general northbound control API. (D) Telnet to a device console is not a Catalyst Center platform API at all.

  12. 12. A script contains only `import meraki` and `dashboard = meraki.DashboardAPI()` with no argument. According to the Meraki documentation, where does the library obtain the API key, and which call returns the organizations the key can access?

    • A. From a ~/.meraki/config file; dashboard.get_orgs()
    • B. It prompts for the key interactively at run time; dashboard.organizations.listAll()
    • C. From the MERAKI_DASHBOARD_API_KEY environment variable; dashboard.organizations.getOrganizations()(correct)
    • D. From the X-Cisco-Meraki-API-Key HTTP header of the first request; dashboard.orgs()

    Explanation: Meraki recommends exporting the MERAKI_DASHBOARD_API_KEY environment variable so DashboardAPI() can be created without the key in source code, and its example lists organizations with dashboard.organizations.getOrganizations(). Why the other options are wrong: (A) The documentation names an environment variable, not a config file, and getOrganizations is the documented operation. (B) The library does not prompt; it reads the environment variable, and listAll is not the documented operation. (D) That header is a v0 convention and is not a source for the library's key; orgs() is not the documented call.

  13. 13. An engineer enables NETCONF over SSH on a router and must allow the management station through a firewall. Which TCP port does a NETCONF server use by default for the netconf SSH subsystem?

    • A. 22
    • B. 443
    • C. 830(correct)
    • D. 161

    Explanation: RFC 6242 states that NETCONF servers must default to providing access to the netconf SSH subsystem only when the SSH session is established using the IANA-assigned TCP port 830; servers should be configurable to allow other ports. Why the other options are wrong: (A) Port 22 is the general SSH port; RFC 6242 says NETCONF servers must default to offering the netconf subsystem only on the IANA-assigned port 830. (B) Port 443 carries HTTPS, which is used by RESTCONF rather than NETCONF over SSH. (D) Port 161 is used by SNMP agents, not NETCONF.

  14. 14. A company runs an application on its own private cloud infrastructure and, during peak load, shifts overflow work to a public cloud using standardized technology that keeps the application portable between the two. Which deployment model describes this?

    • A. Private cloud
    • B. Public cloud
    • C. Community cloud
    • D. Hybrid cloud(correct)

    Explanation: NIST SP 800-145 defines a hybrid cloud as a composition of two or more distinct cloud infrastructures (private, community, or public) bound together by technology that enables data and application portability, for example cloud bursting. Why the other options are wrong: (A) A private cloud is provisioned for exclusive use by a single organization; this design also uses a public cloud. (B) A public cloud is provisioned for open use by the general public; the company also keeps its own private infrastructure. (C) A community cloud serves a specific community of organizations with shared concerns, which is not described here.

  15. 15. A Dockerfile for a web service contains `EXPOSE 8080`. The container is started with `docker run -d myapp`. A browser on the Docker host cannot reach http://localhost:8080. What is required?

    • A. Publish the port when running the container, for example with -p 8080:8080(correct)
    • B. Nothing more; EXPOSE automatically publishes the port to the host
    • C. Run the container with -P so that Docker maps the exposed port to host port 8080
    • D. Replace EXPOSE with LABEL, because LABEL controls networking

    Explanation: The Dockerfile reference states that EXPOSE doesn't actually publish the port; it works as documentation, and you publish with -p on docker run (or -P to map all exposed ports to high-order host ports). Why the other options are wrong: (B) EXPOSE does not publish the port; it only documents which port the container listens on. (C) -P publishes exposed ports to random high-order host ports, not to a chosen port such as 8080. (D) LABEL only adds metadata to an image and has no effect on networking.

  16. 16. A Python web service builds a query with `cursor.execute(f"SELECT * FROM users WHERE name = '{name}'")` using text from a form field. What is the most effective fix for the SQL injection risk?

    • A. Strip single quotes from the input with name.replace("'", "")
    • B. Validate the field in JavaScript on the web form only
    • C. Use a parameterized query (prepared statement), for example cursor.execute("SELECT * FROM users WHERE name = ?", (name,))(correct)
    • D. Serve the application over HTTPS only

    Explanation: OWASP's first recommended defense is prepared statements with variable binding, which force the SQL code to be defined first and the parameters passed later so the database always distinguishes code from data. Why the other options are wrong: (A) OWASP lists manual escaping of user input as strongly discouraged because it is fragile compared with parameterized queries. (B) Client-side checks can be bypassed by sending requests directly to the server and do not change how the SQL string is built. (D) TLS protects data in transit but does not change how the query is constructed, so injection remains possible.

  17. 17. A Bash user sets an API token and then runs a Python script that reads it from its environment. Which command sequence makes the variable available to the script?

    • A. API_TOKEN=abc123 on its own line, then run python script.py
    • B. echo API_TOKEN=abc123, then run python script.py
    • C. cd API_TOKEN, then run python script.py
    • D. export API_TOKEN=abc123, then run python script.py(correct)

    Explanation: Bash passes its environment to executed commands, and the export builtin adds a variable to that environment so child processes such as the Python script inherit it. Why the other options are wrong: (A) A plain assignment creates a shell variable that is not marked for export, so the child process does not inherit it. (B) echo only prints text; it does not create or export a variable. (C) cd changes directory and has nothing to do with environment variables.

  18. 18. Which statement best describes infrastructure as code (IaC)?

    • A. Documenting the manual CLI steps for each device in a wiki page
    • B. Moving all network devices into a public cloud provider
    • C. Managing infrastructure through configuration files that can be versioned and applied repeatably, rather than through a graphical interface(correct)
    • D. Configuring each device with a vendor GUI wizard and saving screenshots as evidence

    Explanation: HashiCorp describes IaC tools as letting you manage infrastructure with configuration files rather than through a graphical user interface, so you can build, change and manage it in a safe, consistent and repeatable way and version the definitions. Why the other options are wrong: (A) A wiki of manual steps is still manual configuration and is not executable, repeatable code. (B) IaC is a management approach and is independent of where the infrastructure runs. (D) GUI wizards are interactive and not repeatable definitions that can be stored and reviewed in version control.

  19. 19. What does this playbook accomplish? - name: Web tier hosts: webservers become: true tasks: - name: Install nginx ansible.builtin.package: name: nginx state: present - name: Create service account ansible.builtin.user: name: svc_web state: present - name: Ensure nginx is running ansible.builtin.service: name: nginx state: started

    • A. It removes nginx and the svc_web account from the webservers
    • B. It restarts the nginx service on every run
    • C. It runs only on the Ansible control node and changes nothing on the managed hosts
    • D. On the webservers group, with privilege escalation, it ensures nginx is installed, the svc_web account exists and the nginx service is running, doing nothing for steps already satisfied(correct)

    Explanation: A play targets the hosts in the webservers group; become: true enables privilege escalation; package and user with state: present ensure the package and account exist; service with state: started is idempotent and starts the service only if needed. Why the other options are wrong: (A) state: present means the package and user must exist; removal would require state: absent. (B) state: started only starts the service when it is not already running; restarted is the state that always bounces it. (C) hosts: webservers selects the managed nodes in that group, and the tasks run against them.

  20. 20. A code review shows this unified diff of a configuration template. What changed? --- old.cfg +++ new.cfg @@ -1,4 +1,4 @@ hostname R1 -ntp server 10.0.0.1 +ntp server 10.0.0.2 ip domain-name lab.local logging host 10.0.0.9

    • A. A new logging host line was added to the file
    • B. The hostname line was removed and replaced by the NTP line
    • C. The files are identical because both ranges in the hunk header have four lines
    • D. The NTP server address changed from 10.0.0.1 to 10.0.0.2; the other lines are unchanged context(correct)

    Explanation: In unified format the header names the first file (---) and the second file (+++); lines beginning with a space are common to both files, '-' lines come only from the first file and '+' lines only from the second (confirmed by running diff -u on sample files), so only the NTP server line differs. Why the other options are wrong: (A) The logging host line starts with a space, which marks it as unchanged context shared by both files. (B) The hostname line begins with a space (unchanged); only the lines marked - and + differ. (C) The header only reports line ranges; the - and + lines show that content differs.

  21. 21. Which description matches this YANG fragment? list interface { key "name"; leaf name { type string; } leaf enabled { type boolean; } }

    • A. A single interface node that has exactly one name and one enabled value
    • B. A sequence of interface entries, each uniquely identified by its name key and carrying an enabled boolean(correct)
    • C. A leaf-list of interface names with no other data
    • D. An RPC named interface that takes name and enabled as input parameters

    Explanation: RFC 7950 defines a list as a sequence of entries, each like a container and uniquely identified by the values of its key leafs, so name is the key and enabled is another leaf in each entry. Why the other options are wrong: (A) That describes a container; a list defines a sequence of entries. (C) A leaf-list is a sequence of simple values; this list entries contain two leaves. (D) RPCs are declared with the rpc statement and input/output sections, not with list.

  22. 22. An engineer wants to preview what Terraform would change in the infrastructure without making any changes. Which action is correct?

    • A. Run terraform apply
    • B. Run terraform init
    • C. Delete terraform.tfstate so Terraform re-reads the real infrastructure
    • D. Run terraform plan(correct)

    Explanation: The terraform plan command creates an execution plan that previews the changes Terraform would make; it does not carry out the proposed changes. Why the other options are wrong: (A) Apply makes the planned changes; it does more than preview them. (B) Init installs the plugins (providers) Terraform needs; it does not show proposed infrastructure changes. (C) The state file stores the bindings between real objects and configuration, so deleting it loses that mapping rather than producing a preview.

  23. 23. A firewall change request lists several protocols and default ports. Which TWO pairings are correct?

    • A. SNMP agent queries — UDP 123
    • B. Telnet — TCP 80
    • C. HTTPS — TCP 443(correct)
    • D. HTTP — TCP 443
    • E. SSH — TCP 22(correct)

    Explanation: The IANA registry lists ssh on TCP 22, telnet on TCP 23, http on TCP 80, https on TCP 443, snmp on UDP 161 and ntp on UDP 123. Why the other options are wrong: (A) SNMP agent queries use UDP 161; UDP 123 is NTP. (B) Telnet uses TCP 23; port 80 is HTTP. (D) HTTP uses TCP 80; port 443 is HTTPS.

  24. 24. A host has the address 10.10.20.77/26. What is the network address of its subnet?

    • A. 10.10.20.0
    • B. 10.10.20.77
    • C. 10.10.20.128
    • D. 10.10.20.64(correct)

    Explanation: A /26 mask (255.255.255.192) leaves 6 host bits, giving blocks of 64 addresses; 77 falls in the block starting at .64, whose broadcast address is .127 and usable hosts run .65 to .126. Why the other options are wrong: (A) That would be the network address for a /24; a /26 divides the last octet into blocks of 64. (B) The host address itself is not the network address; the host bits must be cleared. (C) 10.10.20.128 begins the third /26 block, which does not contain .77.

  25. 25. In which order do a DHCP client and server normally exchange messages to allocate an address?

    • A. DHCPREQUEST, DHCPDISCOVER, DHCPACK, DHCPOFFER
    • B. DHCPOFFER, DHCPDISCOVER, DHCPACK, DHCPREQUEST
    • C. DHCPDISCOVER, DHCPOFFER, DHCPREQUEST, DHCPACK(correct)
    • D. DHCPDISCOVER, DHCPACK, DHCPOFFER, DHCPREQUEST

    Explanation: RFC 2131 describes the client broadcasting a DHCPDISCOVER, servers answering with DHCPOFFER, the client sending a DHCPREQUEST for one offer, and the server committing the address in a DHCPACK. Why the other options are wrong: (A) A client must first locate servers with DHCPDISCOVER before it can request an offered address. (B) The server's DHCPOFFER is a response to a client's DHCPDISCOVER, so it cannot come first. (D) The server acknowledges only after it has offered an address and the client has requested it.