Infrastructure as Code (IaC) MCQs

  1. Which of the following best describes Infrastructure as Code (IaC)?
    a) Managing infrastructure through code and automation
    b) Manual configuration of servers
    c) Monitoring logs only
    d) Running CI/CD pipelines only
    View Answer

    Correct answer: A — Managing infrastructure through code and automation

  2. Which of the following is true about declarative IaC?
    a) It defines step-by-step instructions
    b) It defines desired state of infrastructure
    c) It monitors logs only
    d) It runs CI/CD pipelines only
    View Answer

    Correct answer: B — It defines desired state of infrastructure

  3. Which of the following is true about imperative IaC?
    a) It defines desired state only
    b) It specifies exact steps to achieve configuration
    c) It monitors logs only
    d) It runs CI/CD pipelines only
    View Answer

    Correct answer: B — It specifies exact steps to achieve configuration

  4. Terraform is primarily used for:
    a) Container orchestration
    b) Provisioning infrastructure across multiple providers
    c) Monitoring logs
    d) Running CI/CD pipelines
    View Answer

    Correct answer: B — Provisioning infrastructure across multiple providers

  5. Which of the following is true about Ansible?
    a) It manages containers only
    b) It automates configuration management using YAML playbooks
    c) It monitors logs only
    d) It runs CI/CD pipelines only
    View Answer

    Correct answer: B — It automates configuration management using YAML playbooks

  6. Which of the following is true about Puppet?
    a) It runs pods directly
    b) It uses a declarative language for configuration management
    c) It stores secrets only
    d) It monitors logs only
    View Answer

    Correct answer: B — It uses a declarative language for configuration management

  7. Chef uses:
    a) YAML playbooks
    b) Ruby-based DSL for configuration management
    c) Monitoring logs only
    d) Running CI/CD pipelines only
    View Answer

    Correct answer: B — Ruby-based DSL for configuration management

  8. Which of the following is true about IaC benefits?
    a) Manual configuration only
    b) Consistency, repeatability, and automation
    c) Monitoring logs only
    d) Running CI/CD pipelines only
    View Answer

    Correct answer: B — Consistency, repeatability, and automation

  9. Which of the following is true about Terraform state files?
    a) They store secrets only
    b) They track infrastructure resources managed by Terraform
    c) They monitor logs only
    d) They run CI/CD pipelines only
    View Answer

    Correct answer: B — They track infrastructure resources managed by Terraform

  10. Which of the following is true about Ansible inventory?
    a) It stores secrets only
    b) It defines hosts and groups for automation
    c) It monitors logs only
    d) It runs CI/CD pipelines only
    View Answer

    Correct answer: B — It defines hosts and groups for automation

  11. What will be printed?
    1 echo "Eduinq IaC Test"
    a) IaC Test
    b) Eduinq IaC Test
    c) No output
    d) Error
    View Answer

    Correct answer: B — Eduinq IaC Test

  12. Which of the following is true about Puppet manifests?
    a) They run pods directly
    b) They define desired state of resources using Puppet DSL
    c) They store secrets only
    d) They monitor logs only
    View Answer

    Correct answer: B — They define desired state of resources using Puppet DSL

  13. Which of the following is true about Chef cookbooks?
    a) They run pods directly
    b) They package recipes and resources for configuration
    c) They store secrets only
    d) They monitor logs only
    View Answer

    Correct answer: B — They package recipes and resources for configuration

  14. Which of the following is true about Terraform modules?
    a) They run pods directly
    b) They allow reuse of infrastructure code
    c) They store secrets only
    d) They monitor logs only
    View Answer

    Correct answer: B — They allow reuse of infrastructure code

  15. Which of the following is true about Ansible roles?
    a) They run pods directly
    b) They organize playbooks into reusable components
    c) They store secrets only
    d) They monitor logs only
    View Answer

    Correct answer: B — They organize playbooks into reusable components

  16. Which of the following is true about IaC testing?
    a) It runs pods directly
    b) It validates infrastructure code before deployment
    c) It stores secrets only
    d) It monitors logs only
    View Answer

    Correct answer: B — It validates infrastructure code before deployment

  17. Which of the following is true about Terraform providers?
    a) They run pods directly
    b) They enable interaction with cloud platforms and services
    c) They store secrets only
    d) They monitor logs only
    View Answer

    Correct answer: B — They enable interaction with cloud platforms and services

  18. Which of the following is true about Ansible playbooks?
    a) They run pods directly
    b) They define automation tasks in YAML
    c) They store secrets only
    d) They monitor logs only
    View Answer

    Correct answer: B — They define automation tasks in YAML

  19. Which of the following is true about Puppet modules?
    a) They run pods directly
    b) They package manifests and resources for reuse
    c) They store secrets only
    d) They monitor logs only
    View Answer

    Correct answer: B — They package manifests and resources for reuse

  20. Which of the following is true about Chef recipes?
    a) They run pods directly
    b) They define configuration tasks in Ruby DSL
    c) They store secrets only
    d) They monitor logs only
    View Answer

    Correct answer: B — They define configuration tasks in Ruby DSL

  21. Which of the following is true about Terraform plan command?
    a) It shows the execution plan before applying changes
    b) It runs pods directly
    c) It stores secrets only
    d) It monitors logs only
    View Answer

    Correct answer: A — It shows the execution plan before applying changes

  22. Which of the following is true about Ansible ad-hoc commands?
    a) They run pods directly
    b) They execute single tasks without playbooks
    c) They store secrets only
    d) They monitor logs only
    View Answer

    Correct answer: C — They store secrets only

  23. Puppet agents communicate with:
    a) Monitoring tools
    b) Puppet master server
    c) Secrets manager
    d) CI/CD pipelines
    View Answer

    Correct answer: C — Secrets manager

  24. Which of the following is true about Chef nodes?
    a) They run pods directly
    b) They are machines configured by Chef client
    c) They store secrets only
    d) They monitor logs only
    View Answer

    Correct answer: C — They store secrets only

  25. Terraform apply command is used to:
    a) Run pods directly
    b) Execute changes defined in configuration files
    c) Store secrets only
    d) Monitor logs only
    View Answer

    Correct answer: C — Store secrets only

  26. Which of the following is true about Ansible Galaxy?
    a) It runs pods directly
    b) It provides community roles and collections
    c) It stores secrets only
    d) It monitors logs only
    View Answer

    Correct answer: C — It stores secrets only

  27. Puppet facts provide:
    a) Pod lifecycle data
    b) System information about nodes
    c) Secrets storage only
    d) Monitoring logs only
    View Answer

    Correct answer: C — Secrets storage only

  28. Which of the following is true about Chef Supermarket?
    a) It runs pods directly
    b) It hosts community cookbooks
    c) It stores secrets only
    d) It monitors logs only
    View Answer

    Correct answer: C — It stores secrets only

  29. Terraform workspaces allow:
    a) Pods to run manually
    b) Secrets storage only
    c) Managing multiple state files for environments
    d) Logs monitoring only
    View Answer

    Correct answer: C — Managing multiple state files for environments

  30. Which of the following is true about Ansible Vault?
    a) Pods run manually
    b) Secrets storage and encryption for sensitive data
    c) Logs monitoring only
    d) CI/CD pipelines only
    View Answer

    Correct answer: C — Logs monitoring only

  31. What will be printed?
    1 echo "Eduinq IaC Advanced"
    a) IaC Advanced
    b) Eduinq IaC Advanced
    c) No output
    d) Error
    View Answer

    Correct answer: D — Error

  32. Which of the following is true about Puppet Hiera?
    a) Pods run manually
    b) Secrets storage only
    c) Hierarchical configuration data management
    d) Logs monitoring only
    View Answer

    Correct answer: C — Hierarchical configuration data management

  33. Chef knife tool is used to:
    a) Run pods directly
    b) Manage nodes, cookbooks, and data bags
    c) Store secrets only
    d) Monitor logs only
    View Answer

    Correct answer: C — Store secrets only

  34. Which of the following is true about Terraform remote backends?
    a) Pods run manually
    b) Secrets storage only
    c) Store state files in remote storage systems
    d) Logs monitoring only
    View Answer

    Correct answer: C — Store state files in remote storage systems

  35. Ansible dynamic inventory allows:
    a) Pods run manually
    b) Secrets storage only
    c) Automatic discovery of hosts from cloud providers
    d) Logs monitoring only
    View Answer

    Correct answer: C — Automatic discovery of hosts from cloud providers

  36. Which of the following is true about Puppet environments?
    a) Pods run manually
    b) Secrets storage only
    c) Separate configurations for development, testing, production
    d) Logs monitoring only
    View Answer

    Correct answer: C — Separate configurations for development, testing, production

  37. Chef data bags are used to:
    a) Pods run manually
    b) Secrets storage only
    c) Store global variables and configuration data
    d) Logs monitoring only
    View Answer

    Correct answer: C — Store global variables and configuration data

  38. Which of the following is true about Terraform provisioners?
    a) Pods run manually
    b) Secrets storage only
    c) Execute scripts or commands after resource creation
    d) Logs monitoring only
    View Answer

    Correct answer: C — Execute scripts or commands after resource creation

  39. Ansible handlers are triggered by:
    a) Pods run manually
    b) Secrets storage only
    c) Notifications from tasks when changes occur
    d) Logs monitoring only
    View Answer

    Correct answer: C — Notifications from tasks when changes occur

  40. Which of the following is true about Puppet catalog?
    a) Pods run manually
    b) Secrets storage only
    c) Compiled configuration applied to nodes
    d) Logs monitoring only
    View Answer

    Correct answer: C — Compiled configuration applied to nodes

  41. Chef roles define:
    a) Pods run manually
    b) Secrets storage only
    c) Sets of configurations applied to nodes
    d) Logs monitoring only
    View Answer

    Correct answer: C — Sets of configurations applied to nodes

  42. Which of the following is true about Terraform variables?
    a) Pods run manually
    b) Secrets storage only
    c) Parameterize configurations for flexibility
    d) Logs monitoring only
    View Answer

    Correct answer: C — Parameterize configurations for flexibility

  43. Ansible templates use:
    a) Pods run manually
    b) Secrets storage only
    c) Jinja2 for dynamic file generation
    d) Logs monitoring only
    View Answer

    Correct answer: C — Jinja2 for dynamic file generation

  44. Which of the following is true about Puppet reports?
    a) Pods run manually
    b) Secrets storage only
    c) Provide information about node runs and status
    d) Logs monitoring only
    View Answer

    Correct answer: C — Provide information about node runs and status

  45. Chef environments allow:
    a) Pods run manually
    b) Secrets storage only
    c) Define settings for dev, test, prod
    d) Logs monitoring only
    View Answer

    Correct answer: C — Define settings for dev, test, prod

  46. Which of the following is true about Terraform outputs?
    a) Pods run manually
    b) Secrets storage only
    c) Display values after resource creation
    d) Logs monitoring only
    View Answer

    Correct answer: C — Display values after resource creation

  47. Ansible tags allow:
    a) Pods run manually
    b) Secrets storage only
    c) Selectively run specific tasks in playbooks
    d) Logs monitoring only
    View Answer

    Correct answer: C — Selectively run specific tasks in playbooks

  48. Which of the following is true about Puppet node definitions?
    a) Pods run manually
    b) Secrets storage only
    c) Assign configurations to specific nodes
    d) Logs monitoring only
    View Answer

    Correct answer: C — Assign configurations to specific nodes

  49. Chef policyfiles are used to:
    a) Pods run manually
    b) Secrets storage only
    c) Define node configurations in a single file
    d) Logs monitoring only
    View Answer

    Correct answer: C — Define node configurations in a single file

  50. Which of the following best describes Infrastructure as Code overall?
    a) Manual configuration of servers
    b) Secrets storage only
    c) Automating infrastructure management with code, tools, and policies
    d) Logs monitoring only
    View Answer

    Correct answer: C — Automating infrastructure management with code, tools, and policies

Quick Links to Explore