Chef Principles Certification (CP101) — Questions and Answers
Question 1: When facing an unfamiliar challenge in automation & scripting within Chef DevOps, what is the BEST approach?
- Avoid the challenge if possible
- Attempt to resolve it independently without consultation
- Apply the most familiar technique regardless of suitability
- Research established best practices, consult colleagues, and document the approach (Correct answer)
Correct answer: Research established best practices, consult colleagues, and document the approach
Researching best practices and consulting colleagues combines established knowledge with practical experience, while documentation supports future reference.
Question 2: What is the role of the `.chef/knife.rb` configuration file?
- Configuring the knife CLI with Chef Server URL, key paths, and connection settings (Correct answer)
- Storing cookbook recipes for knife to run
- Managing semantic version constraints for cookbooks
- Defining default node attributes for all environments
Correct answer: Configuring the knife CLI with Chef Server URL, key paths, and connection settings
The `.chef/knife.rb` file configures the knife CLI tool with the Chef Server URL, client name, validation key path, and other connection parameters.
Question 3: In Chef DevOps, which data management & integration approach is MOST effective for achieving long-term goals?
- Reactive management that addresses issues as they arise
- Focusing solely on short-term financial targets
- Delegating all decisions without oversight
- Strategic planning with measurable objectives and regular progress reviews (Correct answer)
Correct answer: Strategic planning with measurable objectives and regular progress reviews
Strategic planning with measurable objectives and regular reviews provides direction, accountability, and the ability to adapt strategies based on progress.
Question 4: What is the MOST effective way to stay current with developments in automation & scripting for Chef DevOps?
- Participating in professional development, industry events, and peer collaboration (Correct answer)
- Reading only internal communications
- Relying on experience gained early in career
- Following a single expert opinions
Correct answer: Participating in professional development, industry events, and peer collaboration
A multi-faceted approach including formal development, industry events, and peer collaboration provides the broadest perspective on current developments.
Question 5: What does `knife cookbook upload` do on a Chef workstation?
- Downloads cookbooks from Supermarket to the workstation
- Creates a new cookbook skeleton with default files
- Uploads a specific cookbook from the workstation to the Chef Server (Correct answer)
- Tests cookbook syntax locally
Correct answer: Uploads a specific cookbook from the workstation to the Chef Server
`knife cookbook upload` takes a cookbook from the local workstation cookbook path and uploads it to the Chef Server for use by nodes.
Question 6: Which competency is MOST essential for professionals working in automation & scripting in Chef DevOps?
- Memorization of procedures without understanding principles
- Speed of task completion above all else
- Critical thinking combined with practical application of knowledge (Correct answer)
- Seniority-based decision making
Correct answer: Critical thinking combined with practical application of knowledge
Critical thinking allows professionals to apply knowledge effectively in varied situations, leading to better outcomes than rote procedures.
Question 7: What is the role of the `Berksfile` in a Chef cookbook?
- It defines the node run list for cookbook execution
- It specifies cookbook dependencies and their sources for Berkshelf to resolve (Correct answer)
- It configures knife plugin settings for the cookbook
- It stores encrypted secrets used by the cookbook at runtime
Correct answer: It specifies cookbook dependencies and their sources for Berkshelf to resolve
The Berksfile tells Berkshelf where to find and which versions of dependent cookbooks to download before uploading to the Chef Server.
Question 8: What is the MOST effective way to stay current with developments in cloud infrastructure & services for Chef DevOps?
- Participating in professional development, industry events, and peer collaboration (Correct answer)
- Following a single expert opinions
- Reading only internal communications
- Relying on experience gained early in career
Correct answer: Participating in professional development, industry events, and peer collaboration
A multi-faceted approach including formal development, industry events, and peer collaboration provides the broadest perspective on current developments.
Question 9: In Chef DevOps, how should project planning & deployment challenges be prioritized?
- By the preferences of senior management
- Based on potential impact, urgency, and alignment with strategic objectives (Correct answer)
- Based solely on cost considerations
- In the order they were identified
Correct answer: Based on potential impact, urgency, and alignment with strategic objectives
Prioritizing based on impact, urgency, and strategic alignment ensures resources are directed where they will produce the greatest benefit.
Question 10: In ChefSpec, which RSpec-style matcher asserts that a package would be installed during a Chef run?
- install_package('name')
- to install_package('name') (Correct answer)
- be_installed('name')
- have_resource(:package)
Correct answer: to install_package('name')
The ChefSpec matcher `to install_package('name')` uses RSpec expect syntax to assert the Chef run would install the specified package.
Question 11: Which Cookstyle command checks a cookbook for style violations without auto-correcting them?
- cookstyle --dry-run
- cookstyle --lint
- cookstyle (no flags) (Correct answer)
- cookstyle --check
Correct answer: cookstyle (no flags)
Running `cookstyle` without flags checks for style violations and reports them; use `cookstyle -a` to auto-correct fixable offenses.
Question 12: What is the MOST effective way to stay current with developments in troubleshooting & problem resolution for Chef DevOps?
- Following a single expert opinions
- Participating in professional development, industry events, and peer collaboration (Correct answer)
- Relying on experience gained early in career
- Reading only internal communications
Correct answer: Participating in professional development, industry events, and peer collaboration
A multi-faceted approach including formal development, industry events, and peer collaboration provides the broadest perspective on current developments.
Question 13: What is a Test Kitchen 'suite' used for in .kitchen.yml?
- Defining cloud provider credentials
- Managing encrypted cookbook versions
- Grouping test configurations with specific attributes or run lists (Correct answer)
- Storing data bag items for testing
Correct answer: Grouping test configurations with specific attributes or run lists
A Test Kitchen suite groups a set of test configurations together, enabling different attribute sets or run lists to be tested against the same platform.
Question 14: How does ongoing professional development support compliance & governance in Chef DevOps?
- It only benefits entry-level professionals
- It replaces the need for formal compliance audits
- It is irrelevant to compliance outcomes
- It keeps professionals informed of evolving standards and best practices (Correct answer)
Correct answer: It keeps professionals informed of evolving standards and best practices
Ongoing professional development ensures that practitioners stay current with evolving regulations, standards, and best practices in their field.
Question 15: When facing an unfamiliar challenge in cloud infrastructure & services within Chef DevOps, what is the BEST approach?
- Avoid the challenge if possible
- Attempt to resolve it independently without consultation
- Apply the most familiar technique regardless of suitability
- Research established best practices, consult colleagues, and document the approach (Correct answer)
Correct answer: Research established best practices, consult colleagues, and document the approach
Researching best practices and consulting colleagues combines established knowledge with practical experience, while documentation supports future reference.
Question 16: What is the PRIMARY objective of implementation & configuration within the Chef DevOps profession?
- To create additional requirements for practitioners
- To limit the scope of professional activities
- To ensure quality outcomes through standardized practices and continuous improvement (Correct answer)
- To maintain the status quo without change
Correct answer: To ensure quality outcomes through standardized practices and continuous improvement
The primary objective is ensuring quality outcomes through established standards while continuously improving practices and processes.
Question 17: What does `kitchen destroy` do in the Test Kitchen workflow?
- Uninstalls Test Kitchen from the workstation
- Removes local test result files
- Tears down and removes the test instance (Correct answer)
- Deletes the cookbook source files
Correct answer: Tears down and removes the test instance
`kitchen destroy` tears down and removes the provisioned test instance (e.g., Vagrant VM or Docker container) to free resources.
Question 18: What is the MOST important skill for effective data management & integration in Chef DevOps?
- Technical expertise alone without people skills
- Avoiding conflict at all costs
- Maintaining strict authority over all decisions
- Clear communication and the ability to align team efforts with objectives (Correct answer)
Correct answer: Clear communication and the ability to align team efforts with objectives
Clear communication is essential for aligning team efforts, building consensus, and ensuring everyone understands and works toward shared objectives.
Question 19: In Chef DevOps, what is the MOST appropriate response when a potential compliance violation is discovered?
- Address it only if a supervisor specifically asks about it
- Discuss it informally without documentation
- Wait to see if the violation causes harm before reporting
- Report it immediately through established channels and document findings (Correct answer)
Correct answer: Report it immediately through established channels and document findings
Immediate reporting through established channels with proper documentation ensures timely resolution and maintains the integrity of the compliance program.
Question 20: What is the MOST effective way to stay current with developments in implementation & configuration for Chef DevOps?
- Participating in professional development, industry events, and peer collaboration (Correct answer)
- Relying on experience gained early in career
- Following a single expert opinions
- Reading only internal communications
Correct answer: Participating in professional development, industry events, and peer collaboration
A multi-faceted approach including formal development, industry events, and peer collaboration provides the broadest perspective on current developments.
Question 21: In Chef cookbook dependency constraints, what version range does `~> 2.1` specify?
- Exactly version 2.1.0
- >= 2.1.0 AND < 3.0.0 (Correct answer)
- >= 2.1.0 AND < 2.2.0
- >= 2.0.0 AND < 3.0.0
Correct answer: >= 2.1.0 AND < 3.0.0
The pessimistic constraint operator `~> 2.1` means >= 2.1.0 and < 3.0.0, allowing minor and patch updates but blocking the next major version.
Question 22: In Chef DevOps, how should sensitive documentation & best practices be protected?
- By limiting all access to one person
- Through role-based access controls, encryption, and compliance with privacy regulations (Correct answer)
- Through password protection alone
- By avoiding digital storage entirely
Correct answer: Through role-based access controls, encryption, and compliance with privacy regulations
Multi-layered protection through access controls, encryption, and regulatory compliance provides comprehensive security for sensitive data.
Question 23: What is the role of data in performance monitoring & optimization programs for Chef DevOps?
- Data complicates the improvement process
- Data is only needed for external reporting
- Data is collected but rarely analyzed
- Data provides objective evidence for decision-making and measuring progress (Correct answer)
Correct answer: Data provides objective evidence for decision-making and measuring progress
Data provides the objective evidence needed to make informed decisions, track progress, and validate the effectiveness of improvements.
Question 24: In Chef DevOps, how should performance monitoring & optimization initiatives be prioritized?
- Based on impact on outcomes, feasibility, and alignment with strategic goals (Correct answer)
- By the department requesting the improvement
- Based on the most recent complaints
- In order of ease of implementation only
Correct answer: Based on impact on outcomes, feasibility, and alignment with strategic goals
Prioritizing by impact, feasibility, and strategic alignment ensures resources are directed where they will produce the greatest benefit.
Question 25: What does `berks upload` do after dependencies have been installed locally?
- Installs cookbook dependencies to the local cache
- Runs Berkshelf integration tests
- Uploads all resolved cookbooks from the local cache to Chef Server (Correct answer)
- Creates a Berksfile.lock file
Correct answer: Uploads all resolved cookbooks from the local cache to Chef Server
`berks upload` takes the locally cached cookbooks resolved by Berkshelf and uploads them and their dependencies to the Chef Server.
Question 26: What is Berkshelf used for in Chef cookbook development?
- Running integration tests
- Encrypting data bags
- Bootstrapping nodes
- Managing and resolving cookbook dependencies (Correct answer)
Correct answer: Managing and resolving cookbook dependencies
Berkshelf is Chef's cookbook dependency manager that resolves, downloads, and caches required cookbooks and their transitive dependencies.
Question 27: What is the purpose of `kitchen verify` in the Test Kitchen lifecycle?
- Run InSpec or Serverspec tests against the converged instance (Correct answer)
- Upload the cookbook to Chef Server
- Create the virtual machine
- Apply cookbook recipes to the instance
Correct answer: Run InSpec or Serverspec tests against the converged instance
`kitchen verify` executes the defined test suite (InSpec, Serverspec, etc.) against a converged Test Kitchen instance to assert the desired state was achieved.
Question 28: What is the PRIMARY objective of automation & scripting within the Chef DevOps profession?
- To maintain the status quo without change
- To ensure quality outcomes through standardized practices and continuous improvement (Correct answer)
- To limit the scope of professional activities
- To create additional requirements for practitioners
Correct answer: To ensure quality outcomes through standardized practices and continuous improvement
The primary objective is ensuring quality outcomes through established standards while continuously improving practices and processes.
Question 29: Which characteristic BEST describes a successful performance monitoring & optimization culture in Chef DevOps?
- Continuous learning where all team members actively seek improvement (Correct answer)
- Periodic campaigns without sustained effort
- Top-down directives without employee input
- Focus on compliance over genuine improvement
Correct answer: Continuous learning where all team members actively seek improvement
A culture where all team members actively seek improvement opportunities creates sustainable quality enhancement across the organization.
Question 30: What file at the cookbook root defines platforms, suites, and driver settings for Test Kitchen?
- .kitchen.yml (Correct answer)
- Berksfile
- metadata.rb
- Policyfile.rb
Correct answer: .kitchen.yml
The `.kitchen.yml` file is the Test Kitchen configuration file that defines platforms, test suites, and the driver to use for provisioning.
Question 31: What consequence can result from failing to maintain proper compliance & governance standards in Chef DevOps?
- Reduced workload for staff
- Lower training requirements
- Increased customer satisfaction
- Loss of certification, legal penalties, and reputational damage (Correct answer)
Correct answer: Loss of certification, legal penalties, and reputational damage
Non-compliance can result in serious consequences including certification revocation, legal penalties, fines, and significant reputational damage.
Question 32: Which Chef resource renders a file on the node from an ERB template stored in the cookbook?
- remote_file
- file
- cookbook_file
- template (Correct answer)
Correct answer: template
The `template` resource reads an ERB file from `templates/default/`, substitutes node attribute variables, and writes the result to the node filesystem.
Question 33: What is the PRIMARY objective of compliance & governance in the Chef DevOps field?
- To limit the scope of professional practice
- To create additional paperwork for professionals
- To increase operational costs for organizations
- To ensure adherence to established standards and protect stakeholders (Correct answer)
Correct answer: To ensure adherence to established standards and protect stakeholders
The primary objective of compliance and regulatory frameworks is to ensure adherence to standards that protect stakeholders.
Question 34: What is the default Test Kitchen driver used for local cookbook testing?
- Hyper-V
- Docker
- AWS EC2
- Vagrant (Correct answer)
Correct answer: Vagrant
Vagrant is Test Kitchen's default driver, using virtual machines (typically with VirtualBox) to create isolated local test instances.
Question 35: Which action BEST demonstrates a commitment to compliance & governance in Chef DevOps?
- Relying on colleagues to interpret regulatory requirements
- Following only the regulations that are convenient
- Maintaining current knowledge of all applicable regulations and standards (Correct answer)
- Addressing compliance issues only when audited
Correct answer: Maintaining current knowledge of all applicable regulations and standards
Actively maintaining current knowledge of applicable regulations demonstrates genuine commitment to compliance and helps prevent violations.
Question 36: What is the purpose of Foodcritic in Chef cookbook development?
- Bootstrapping nodes
- Linting Chef cookbooks for style and correctness issues (Correct answer)
- Running integration tests
- Managing cookbook versions
Correct answer: Linting Chef cookbooks for style and correctness issues
Foodcritic is a linting tool that analyzes Chef cookbooks against defined rules to catch common mistakes and style violations.
Question 37: Which command in Chef Workstation generates a new cookbook skeleton with the recommended directory structure?
- berkshelf init <name>
- chef init cookbook <name>
- knife cookbook create <name>
- chef generate cookbook <name> (Correct answer)
Correct answer: chef generate cookbook <name>
`chef generate cookbook <name>` is the modern Chef Workstation command that creates a cookbook with the correct directory layout, metadata.rb, and test files.
Question 38: In a GitOps workflow with Chef, what ultimately causes managed nodes to apply updated cookbooks?
- A cron job on the Chef Server that pushes to nodes
- Manual knife ssh command to each node
- Direct SSH access to each node to run chef-client manually
- A Git push triggers the CI/CD pipeline which updates policies, and nodes pull changes on their next client run (Correct answer)
Correct answer: A Git push triggers the CI/CD pipeline which updates policies, and nodes pull changes on their next client run
In a GitOps Chef workflow, a Git push triggers the pipeline to test and upload cookbooks/policies, and nodes then apply those updates automatically on their scheduled chef-client runs.
Question 39: In Chef DevOps, how does automation & scripting contribute to professional credibility?
- By avoiding challenging situations
- Through the number of years in practice alone
- By demonstrating competence, maintaining standards, and delivering consistent results (Correct answer)
- By using impressive terminology
Correct answer: By demonstrating competence, maintaining standards, and delivering consistent results
Professional credibility is built through demonstrated competence, consistent adherence to standards, and reliable delivery of quality results.
Question 40: What is the PRIMARY objective of troubleshooting & problem resolution within the Chef DevOps profession?
- To limit the scope of professional activities
- To create additional requirements for practitioners
- To maintain the status quo without change
- To ensure quality outcomes through standardized practices and continuous improvement (Correct answer)
Correct answer: To ensure quality outcomes through standardized practices and continuous improvement
The primary objective is ensuring quality outcomes through established standards while continuously improving practices and processes.
Question 41: Which factor BEST indicates mastery of automation & scripting in Chef DevOps?
- The ability to adapt knowledge and skills to varying contexts while maintaining standards (Correct answer)
- Years of experience in a single setting
- Speed of task completion
- Number of certifications held
Correct answer: The ability to adapt knowledge and skills to varying contexts while maintaining standards
True mastery is demonstrated by the ability to apply knowledge flexibly across different contexts while consistently maintaining quality standards.
Question 42: What Chef tool is used for integration testing of cookbooks in real environments?
- InSpec
- ChefSpec
- Test Kitchen (Correct answer)
- Foodcritic
Correct answer: Test Kitchen
Test Kitchen is Chef's integration testing tool that spins up temporary instances to verify cookbook behavior end-to-end.
Question 43: Where are cookbook dependencies declared when using Berkshelf?
- Policyfile.rb
- Berksfile (Correct answer)
- metadata.rb
- Cheffile
Correct answer: Berksfile
The `Berksfile` is where you declare cookbook sources and dependencies that Berkshelf reads to resolve and fetch the correct versions.
Question 44: Which element is ESSENTIAL for an effective compliance & governance program in Chef DevOps?
- Compliance responsibility assigned to one individual only
- Regular audits and continuous monitoring processes (Correct answer)
- Annual review without interim checks
- Documentation stored without regular updates
Correct answer: Regular audits and continuous monitoring processes
Regular audits and continuous monitoring enable early detection of compliance gaps and ensure ongoing adherence to standards.
Question 45: What does InSpec provide in a Chef DevOps workflow?
- Recipe compilation
- Node bootstrapping
- Cookbook dependency management
- Compliance-as-code testing (Correct answer)
Correct answer: Compliance-as-code testing
InSpec provides compliance-as-code testing, enabling teams to write human-readable tests that verify infrastructure meets security and compliance requirements.
Question 46: Which approach to network design & administration security is MOST effective in Chef DevOps?
- Defense in depth with multiple layers of protection and regular audits (Correct answer)
- Security through obscurity alone
- A single strong firewall without additional measures
- Addressing security only after a breach occurs
Correct answer: Defense in depth with multiple layers of protection and regular audits
Defense in depth provides multiple layers of protection, so if one layer is compromised, others continue to provide security.
Question 47: When implementing project planning & deployment changes in Chef DevOps, what factor is MOST critical?
- Top-down mandate without input from affected parties
- Speed of implementation regardless of preparation
- Minimizing communication about the changes
- Stakeholder buy-in and a clear change management plan (Correct answer)
Correct answer: Stakeholder buy-in and a clear change management plan
Stakeholder buy-in and a structured change management plan significantly increase the likelihood of successful implementation.
Question 48: What Chef community tool automates cookbook version bumping, Git tagging, and Supermarket publishing?
- knife
- stove (Correct answer)
- berkshelf
- chef
Correct answer: stove
Stove is the Chef cookbook release tool that automates bumping the version in metadata.rb, creating a Git tag, and publishing to the Chef Supermarket.
Question 49: What is the MOST important consideration when implementing system architecture & design solutions in Chef DevOps?
- Using the newest technology regardless of fit
- Alignment with organizational needs and scalability requirements (Correct answer)
- Minimizing initial cost without considering long-term value
- Selecting solutions based on vendor popularity alone
Correct answer: Alignment with organizational needs and scalability requirements
Technology solutions must align with organizational needs and scale appropriately to deliver value both now and in the future.
Question 50: In a CI/CD pipeline for Chef cookbooks, which stage typically runs first?
- Upload cookbook to Chef Server
- Lint checks and ChefSpec unit tests (Correct answer)
- Test Kitchen integration tests
- Deploy cookbook to production nodes
Correct answer: Lint checks and ChefSpec unit tests
Linting (Cookstyle) and unit tests (ChefSpec) run first in a Chef CI pipeline because they are fast, cheap, and catch most issues before spinning up real instances.
Chef Principles Certification (CP101)
The Chef Principles Certification validates knowledge of Chef DevOps automation tools including Chef Infra, Chef InSpec, Chef Habitat, and Chef Automate, covering configuration management, compliance automation, and DevOps pipeline practices.
Exam Rules
- You can skip questions and return to them later
- Flag questions for review before submitting
- No feedback shown until you submit the entire exam
- Unanswered questions count as wrong — answer everything
- 10 pretest questions are mixed in and don't affect your score
- Timer auto-submits when time runs out
- Your progress is auto-saved every 30 seconds