Chef Principles Certification (CP101) — Questions and Answers
Question 1: How should documentation & best practices retention policies be determined in Chef DevOps?
- Keeping everything indefinitely
- Based on available storage space
- Destroying records as soon as they are no longer immediately needed
- Based on legal requirements, operational needs, and industry best practices (Correct answer)
Correct answer: Based on legal requirements, operational needs, and industry best practices
Retention policies should balance legal requirements, operational needs, and best practices to ensure appropriate preservation and disposal.
Question 2: What is Chef Supermarket?
- A community repository for sharing and discovering reusable Chef cookbooks (Correct answer)
- A paid Chef Software enterprise product
- A Chef Server-side marketplace plugin
- An encrypted data bag storage service
Correct answer: A community repository for sharing and discovering reusable Chef cookbooks
Chef Supermarket is the community hub at supermarket.chef.io where the Chef community publishes and discovers reusable cookbooks.
Question 3: Which framework is used for unit testing Chef cookbooks without converging a node?
- Minitest
- ChefSpec (Correct answer)
- Test Kitchen
- InSpec
Correct answer: ChefSpec
ChefSpec is the unit testing framework for Chef that uses RSpec syntax to test cookbook logic without running Chef on a real node.
Question 4: In Chef semantic versioning (e.g., 1.2.3), what does incrementing the first number signify?
- A build metadata update
- A breaking or incompatible change (Correct answer)
- A patch fix with no API changes
- A backward-compatible new feature
Correct answer: A breaking or incompatible change
In semantic versioning, the first (major) version number is incremented when introducing breaking or backward-incompatible changes.
Question 5: What does the `notifies` method do when used in a Chef resource definition?
- It logs a Chef Server notification when the resource successfully converges
- It sends an email alert to operators when the resource changes state on the node
- It broadcasts a resource state change event to all nodes in the Chef environment
- It triggers a specified action on another resource when the current resource is updated (Correct answer)
Correct answer: It triggers a specified action on another resource when the current resource is updated
`notifies :action, 'resource[name]', :timing` queues an action on the target resource whenever the notifying resource makes a change during convergence.
Question 6: Which action BEST demonstrates a commitment to compliance & governance in Chef DevOps?
- Following only the regulations that are convenient
- Relying on colleagues to interpret regulatory requirements
- Addressing compliance issues only when audited
- Maintaining current knowledge of all applicable regulations and standards (Correct answer)
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 7: What does InSpec provide in a Chef DevOps workflow?
- Node bootstrapping
- Cookbook dependency management
- Compliance-as-code testing (Correct answer)
- Recipe compilation
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 8: What file at the cookbook root defines platforms, suites, and driver settings for Test Kitchen?
- Berksfile
- Policyfile.rb
- .kitchen.yml (Correct answer)
- metadata.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 9: Which approach to network design & administration security is MOST effective in Chef DevOps?
- Security through obscurity alone
- A single strong firewall without additional measures
- Defense in depth with multiple layers of protection and regular audits (Correct answer)
- 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 10: Which competency is MOST essential for professionals working in automation & scripting in Chef DevOps?
- Seniority-based decision making
- Memorization of procedures without understanding principles
- Speed of task completion above all else
- Critical thinking combined with practical application of knowledge (Correct answer)
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 11: Which Chef resource guard executes a resource only when its condition evaluates to true?
- when_true
- only_if (Correct answer)
- not_if
- guard_if
Correct answer: only_if
`only_if` accepts a shell command string or a Ruby block; when the command exits 0 or the block returns truthy, the resource executes.
Question 12: What does `berks upload` do after dependencies have been installed locally?
- Runs Berkshelf integration tests
- Uploads all resolved cookbooks from the local cache to Chef Server (Correct answer)
- Creates a Berksfile.lock file
- Installs cookbook dependencies to the local cache
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 13: In Chef DevOps, what is the MOST appropriate response when a potential compliance violation is discovered?
- Wait to see if the violation causes harm before reporting
- Address it only if a supervisor specifically asks about it
- Discuss it informally without documentation
- 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 14: What consequence can result from failing to maintain proper compliance & governance standards in Chef DevOps?
- Loss of certification, legal penalties, and reputational damage (Correct answer)
- Lower training requirements
- Reduced workload for staff
- Increased customer satisfaction
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 15: When facing an unfamiliar challenge in automation & scripting within Chef DevOps, what is the BEST approach?
- Apply the most familiar technique regardless of suitability
- Attempt to resolve it independently without consultation
- Research established best practices, consult colleagues, and document the approach (Correct answer)
- Avoid the challenge if possible
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: In ChefSpec, which call creates a simulated Chef run for unit testing?
- chef_run.apply
- ChefSpec::Runner.run
- chef_simulate.start
- ChefSpec::SoloRunner.converge (Correct answer)
Correct answer: ChefSpec::SoloRunner.converge
ChefSpec::SoloRunner.converge creates a simulated in-memory Chef run for unit testing without actually applying changes to a node.
Question 17: What is the PRIMARY objective of automation & scripting within the Chef DevOps profession?
- To maintain the status quo without change
- To limit the scope of professional activities
- To create additional requirements for practitioners
- 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 18: Which factor BEST indicates mastery of automation & scripting in Chef DevOps?
- Number of certifications held
- Years of experience in a single setting
- Speed of task completion
- The ability to adapt knowledge and skills to varying contexts while maintaining standards (Correct answer)
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 19: In ChefSpec, which RSpec-style matcher asserts that a package would be installed during a Chef run?
- install_package('name')
- have_resource(:package)
- be_installed('name')
- to install_package('name') (Correct answer)
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 20: What is the primary purpose of a Chef Policyfile?
- To configure Berkshelf source policies for internal cookbook mirrors
- To capture a node's exact cookbook versions and run list as a versioned, lockable artifact (Correct answer)
- To define Chef Server access control policies for cookbooks and roles
- To manage InSpec compliance policy assignments across node groups
Correct answer: To capture a node's exact cookbook versions and run list as a versioned, lockable artifact
A Policyfile (`Policyfile.rb`) pins exact cookbook versions and defines the run list, then compiles into a `Policyfile.lock.json` that ensures fully reproducible Chef runs.
Question 21: In Chef DevOps, how does automation & scripting contribute to professional credibility?
- By using impressive terminology
- Through the number of years in practice alone
- By avoiding challenging situations
- By demonstrating competence, maintaining standards, and delivering consistent results (Correct answer)
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 22: What does `knife cookbook upload` do on a Chef workstation?
- Downloads cookbooks from Supermarket to the workstation
- Uploads a specific cookbook from the workstation to the Chef Server (Correct answer)
- Tests cookbook syntax locally
- Creates a new cookbook skeleton with default files
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 23: What is the PRIMARY objective of compliance & governance in the Chef DevOps field?
- To ensure adherence to established standards and protect stakeholders (Correct answer)
- To create additional paperwork for professionals
- To increase operational costs for organizations
- To limit the scope of professional practice
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 24: What is the PRIMARY benefit of continuous improvement in data management & integration for Chef DevOps?
- Enhanced efficiency, quality, and competitive advantage over time (Correct answer)
- Higher operational costs in the short term
- Increased complexity in operations
- Reduced need for employee input
Correct answer: Enhanced efficiency, quality, and competitive advantage over time
Continuous improvement systematically enhances efficiency and quality, leading to sustained competitive advantage.
Question 25: In Chef DevOps, how does implementation & configuration contribute to professional credibility?
- By avoiding challenging situations
- By demonstrating competence, maintaining standards, and delivering consistent results (Correct answer)
- Through the number of years in practice alone
- 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 26: What does a passing ChefSpec test confirm about your cookbook?
- Chef resources would be declared and executed correctly during a run (Correct answer)
- The node converged successfully in a production environment
- The cookbook was successfully uploaded to Chef Server
- InSpec compliance controls all passed
Correct answer: Chef resources would be declared and executed correctly during a run
Passing ChefSpec tests confirm that the cookbook's Chef resources would be declared with correct parameters during a simulated Chef run.
Question 27: How often should performance monitoring & optimization metrics be reviewed in Chef DevOps?
- When problems are reported
- Regularly at defined intervals with additional reviews triggered by significant events (Correct answer)
- When external audits are scheduled
- Only during annual performance reviews
Correct answer: Regularly at defined intervals with additional reviews triggered by significant events
Regular scheduled reviews ensure ongoing monitoring while event-triggered reviews capture the impact of significant changes.
Question 28: Where are Chef custom resources defined within a cookbook?
- In the `recipes/` directory with a `resource_` prefix
- In the `resources/` directory as `.rb` files (Correct answer)
- In the `libraries/` directory as Ruby modules
- In the `providers/` directory as action handlers
Correct answer: In the `resources/` directory as `.rb` files
Custom resources are placed in the `resources/` directory, where each `.rb` file defines a reusable resource with properties and action blocks.
Question 29: Which element is ESSENTIAL for an effective compliance & governance program in Chef DevOps?
- Regular audits and continuous monitoring processes (Correct answer)
- Documentation stored without regular updates
- Compliance responsibility assigned to one individual only
- Annual review without interim checks
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 30: 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)
- Relying on experience gained early in career
- Reading only internal communications
- 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.
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