CompTIA AutoOps+ Free Sample Questions

Create a free account to browse all 20 sample questions. The full practice test includes 150 questions. Use the simulator for timed and flashcard mode.

Try Simulator

AT0-001 Sample Questions

  1. Question 1

    Q1

    A systems engineer is writing a Python script to automate the cleanup of temporary files across several Linux servers. The engineer defines a variable max_age_days = 30 at the very beginning of the script, outside of any functions. Inside a function named clean_temp_files(), the engineer attempts to reassign max_age_days = 15 without any additional keywords. What is the result of this action in Python?

    Show answer & explanation

    Correct answer: A

    In Python, assigning a value to a variable inside a function creates a new local variable by default. To modify the global variable, the engineer would need to explicitly declare global max_age_days inside the function before assignment.

  2. Question 2

    Q2

    When writing a Bash script to iterate over a list of server IP addresses stored in a text file, which loop construct is most appropriate for reading the file line by line? Select the correct keyword to fill in the blank.

    _____ line in $(cat servers.txt); do
    ping -c 1 $line
    done

    Show answer & explanation

    Correct answer: C

    The for loop is used in Bash to iterate over a sequence of items, such as the output of a command substitution like $(cat servers.txt). A while read loop is another valid approach, but the syntax provided specifically matches the for loop structure.

  3. Question 3

    Q3Multiple answers

    An automation engineer is refactoring a monolithic PowerShell script into modular functions. The engineer wants to ensure that a custom function accepts parameters explicitly by name and enforces data typing. Which TWO of the following approaches can be used to define parameters for a PowerShell function? (Select TWO)

    Show answer & explanation

    Correct answers: A, D

    PowerShell also allows defining parameters in parentheses immediately after the function name, similar to languages like C# or Python (e.g., function My-Func($param1) { }).

    In PowerShell, you can define parameters using the Param() block directly inside the function's curly braces. This is a best practice for advanced functions.

  4. Question 4

    Q4

    A DevOps team uses a Python automation script to restart critical production services via a third-party REST API. During automated testing in the CI pipeline, the team wants to ensure the script's logic is tested without actually sending HTTP requests to the live production API. Which of the following is the BEST approach to achieve this?

    Show answer & explanation

    Correct answer: A

    Mocking is the standard practice for testing code that interacts with external systems. By using a library like unittest.mock (specifically @patch), the team can simulate the API's responses (success, timeout, error codes) without making actual network calls, ensuring the script's logic is fully tested safely.

  5. Question 5

    Q5

    A junior administrator has finished editing a Terraform configuration file locally and wants to save this snapshot of the work to their local Git repository history. However, they are not yet ready to share this code with the rest of the team. Which Git command accomplishes this?

    Show answer & explanation

    Correct answer: B

    The git commit command saves a snapshot of the staged changes to the local repository history. Because git push is not used, the changes remain local and are not shared with the remote repository.

  6. Question 6

    Q6

    According to Semantic Versioning (SemVer) principles, an update to an automation module that introduces backwards-incompatible API changes requires incrementing the MINOR version number.

    Show answer & explanation

    Correct answer: A

    False. Semantic Versioning uses a MAJOR.MINOR.PATCH format. Backwards-incompatible changes require incrementing the MAJOR version. The MINOR version is incremented when functionality is added in a backwards-compatible manner.

  7. Question 7

    Q7

    A large enterprise uses a strict Git branching strategy for their infrastructure automation code. The team maintains a main branch representing production and a develop branch for integration.

    During a weekend deployment, a critical bug is discovered in production that is causing automated database backups to fail. The development team is currently midway through building several new features in the develop branch.

    Which workflow represents the correct strategy to address this issue while adhering to standard GitFlow principles?

    Show answer & explanation

    Correct answer: D

    In GitFlow, a hotfix branch is created directly from main to address critical production bugs immediately. Once fixed, the hotfix must be merged back into main (and tagged with an updated version) and also merged into develop to ensure the fix is included in future releases without pulling unfinished features into production.

    flowchart LR Main((main)) --> Hotfix([hotfix]) Hotfix -->|Merge| Main Hotfix -->|Merge| Develop((develop))

  8. Question 8

    Q8

    An automation team prefers a linear, clean commit history without 'merge commits' cluttering the repository. When a developer pulls changes from the remote tracking branch into their local feature branch, which Git command should they use to place their local commits on top of the remote commits?

    Show answer & explanation

    Correct answer: D

    The git pull --rebase command fetches the remote changes and rebases the local branch's commits on top of them. This rewrites the commit history to be linear, avoiding the creation of an extraneous merge commit.

  9. Question 9

    Q9

    A cloud architect is explaining the benefits of Infrastructure as Code (IaC) to a new team member. The architect highlights that running the same deployment script multiple times will yield the exact same environment state without creating duplicate resources or causing errors on subsequent runs. Which IaC principle is the architect describing?

    Show answer & explanation

    Correct answer: D

    Idempotency in IaC means that applying a configuration multiple times results in the same outcome as applying it once. The tool checks the current state and only makes changes necessary to achieve the desired state, preventing duplicate resource creation.

  10. Question 10

    Q10

    An organization mandates that server instances must never be modified in-place after they are provisioned. If an operating system patch is required, the automation pipeline must destroy the existing instances and deploy entirely new instances from an updated image. Which Infrastructure as Code (IaC) principle does this strictly enforce?

    Show answer & explanation

    Correct answer: D

    Immutability dictates that infrastructure components are never modified after they are deployed. Instead of updating existing servers (mutable infrastructure), changes are made by replacing the old components entirely with new ones. This eliminates configuration drift.

Register free to unlock 10 more sample questions

Create a free account to continue with the rest of the AT0-001 sample set.

Lifetime One

Own this practice test forever.

$79.99
$75.99
one-time
  • Full access to 150 questions
  • Study, Timed & Flashcard Modes
  • All past and future versions i
  • Detailed Explanations
  • Study Tracking & Past Attempts
  • Brainy AI Assistant
  • Lifetime updates

Two

Any 2 exams per month.

$20.00/exam
$39.99
/month
  • 2 active exam slots
  • Study, Timed & Flashcard Modes
  • All past and future versions i
  • Detailed Explanations
  • Study Tracking & Past Attempts
  • 1,000 Brainy AI Credits
  • Cancel anytime

Premium Twelve

Any 12 exams over 3 months.

$15.00/exam
$179.99
/3 months
  • 4 active exam slots
  • Study, Timed & Flashcard Modes
  • All past and future versions i
  • Detailed Explanations
  • Study Tracking & Past Attempts
  • 15,000 Brainy AI Credits
  • Dedicated support
  • Friend seat included — full access

Trusted by professionals at

NvidiaSupabaseGitHubOpenAITursoClerkClaude AIAmazon