Chef Interview Preparation Guide and Questions (2027)
A four-week Chef interview prep plan with 30 practice questions: cookbooks, testing, Policyfiles, Chef Infra Client 19 changes and Progress certification.
To prepare for a Chef interview, learn how Chef Infra converges a node from a run list of cookbooks and recipes, practise writing and testing a cookbook with Test Kitchen and InSpec, understand Policyfiles, and know what changed in Chef Infra Client 19. Then rehearse short answers to the core questions and a few troubleshooting stories from your own lab.
This is a preparation guide: a four-week plan, the topics to study, and 30 practice questions with model answers. For a longer bank of questions sorted by level, see our most asked Chef interview questions for freshers and experienced, the main post in this series.
Key takeaways
- Interviewers test three things: Chef concepts, cookbook craft (writing, testing, versioning) and operations (server, bootstrapping, troubleshooting runs).
- Chef Infra Client 19 is built with Chef Habitat, needs a Chef license key to download, renames the package from
cheftochef-ice, installs under/hab/pkgs, and requires Workstation 26 or later. - Client 19 adds an agentless mode that runs Chef over SSH on nodes without an installed client.
- Progress runs two certification tracks: Associate Chef (multiple choice plus lab tasks, 75% to pass) and Executive Chef (mentor-led). Both must be completed within six months, with up to three attempts.
- Your own lab, with a cookbook you wrote and tested, is the best preparation and the best source of honest interview stories.
A four-week preparation plan
| Week | Study | Build |
|---|---|---|
| 1 | Architecture, resources, recipes, cookbooks, run lists, Ohai | Install Workstation, write a cookbook that installs and configures a web server |
| 2 | Testing: Cookstyle, ChefSpec, Test Kitchen, InSpec | Add unit and integration tests, run them in Test Kitchen |
| 3 | Chef Infra Server, knife, bootstrapping, Policyfiles, data bags, secrets | Bootstrap two nodes, deploy with a Policyfile, promote between policy groups |
| 4 | Client 19 changes, Habitat basics, troubleshooting, CI/CD | Break runs on purpose, practise answers out loud |
Spend more time building than reading. A fresher who can open a laptop and show a tested cookbook stands out because many candidates only know definitions. Keep notes of every error you hit in the lab: the message, the cause and the fix. Those notes become your answers to "tell me about a problem you solved", and they are true, which matters because interviewers dig into details.
Topics to study
Start with the model. Chef is a configuration management tool written in Ruby. You describe desired state in recipes made of resources; Chef Infra Client compares that with the node and changes only what differs. Recipes live in cookbooks along with templates, files, attributes and metadata. A node's run list says which recipes to apply. Ohai collects system facts before each run.
Next, learn the server side. Chef Infra Server stores cookbooks, node objects, policies, roles, environments and data bags. Workstations upload content with knife or the chef command, and nodes pull what they need during a run. Understand both the older roles and environments approach and Policyfiles, which lock exact cookbook versions and are the recommended pattern for new work.
Then learn testing, because experienced interviews always reach it: Cookstyle for linting, ChefSpec for unit tests, Test Kitchen to converge real instances or containers, and InSpec to check the result. Finally, read the Client 19 notes so you can answer "what is new" accurately.
Practice questions: concepts
1. What is Chef Infra?
A configuration management tool where you write desired state as Ruby-based code. Chef Infra Client applies that code to nodes so their configuration matches.
2. What is a resource?
A statement of desired state for one piece of the system, such as a package, file, service, user or template, with properties and actions. Chef uses providers behind the scenes to make it true on each platform.
3. What is the difference between a recipe and a cookbook?
A recipe is a Ruby file containing resources. A cookbook is the unit of distribution that holds recipes plus templates, files, attributes, tests and metadata.rb.
4. What is a run list?
The ordered list of recipes and roles applied to a node. Chef expands it into a list of recipes and runs them in order.
5. What is Ohai?
The tool that collects node data such as platform, network and memory at the start of each run. Recipes read it through node attributes.
6. Explain attribute precedence briefly.
Attributes can be set as default, normal, override or automatic, in cookbooks, roles, environments or policies. Automatic attributes from Ohai win. Use default in cookbooks and override sparingly, so values are easy to trace.
7. What does idempotent mean for Chef?
Running the same recipe twice should change nothing the second time. Built-in resources are idempotent; execute resources need guards like not_if, only_if or creates.
8. What are notifications?
notifies and subscribes trigger an action on another resource when one changes, for example restarting a service after its template changes. :delayed runs the action at the end of the run; :immediately runs it straight away.
template '/etc/nginx/nginx.conf' do
source 'nginx.conf.erb'
notifies :reload, 'service[nginx]', :delayed
end
service 'nginx' do
action [:enable, :start]
end
9. What are data bags?
Global JSON data stored on Chef Infra Server, such as user lists. Encrypted data bags protect secrets, though many teams now fetch secrets from a vault or cloud secret manager at run time.
10. What is a custom resource?
A resource you define in a cookbook's resources directory with properties and actions, so other recipes can use it like a built-in. It replaces long, repeated recipe code.
Practice questions: cookbook craft and testing
11. How do you create a new cookbook?
Use chef generate cookbook <name> from Chef Workstation, which creates the layout, metadata and test scaffolding.
12. How do you lint a cookbook?
Run Cookstyle. It checks Ruby style and Chef-specific rules and can autocorrect many issues.
13. What is ChefSpec?
A unit testing framework that simulates a Chef run in memory and lets you assert which resources would be created, without touching a real machine.
14. What does Test Kitchen do?
It creates instances (for example containers or cloud VMs), converges your cookbook on them, and runs integration tests, usually written in InSpec. The configuration lives in kitchen.yml.
15. What is InSpec?
A testing and compliance language for describing expected system state, such as a port listening or a file having certain permissions. It is used for integration tests and for compliance profiles.
16. How do you version cookbooks?
Set the version in metadata.rb using semantic versioning, bump it for every change, and pin versions in Policyfiles so nodes get exactly what you tested.
17. What is a Policyfile?
A file that defines a node's run list and cookbook sources. chef install resolves dependencies and writes a lock file; chef push uploads the locked policy to a policy group such as staging or production.
18. Why prefer Policyfiles over roles and environments?
Policyfiles lock exact cookbook versions and dependencies in one artifact, so the same tested set moves from staging to production. Roles and environments can let versions drift between nodes.
Practice questions: operations
19. How do you add a node to Chef?
Bootstrap it with knife bootstrap, which installs the client, registers the node with the server and runs it with an initial run list or policy. With Client 19 the bootstrap needs a Chef license key to download the client.
20. What changed in Chef Infra Client 19?
It is built with Chef Habitat instead of Omnibus, the package is renamed to chef-ice, it installs under /hab/pkgs with binlinked executables, downloads require a license key, Ruby moves to 3.4, and Workstation 26 or later is required. It also adds agentless mode.
21. What is agentless mode?
A way to run Chef against nodes reachable over SSH without installing the client on them. Progress says more than 90 resources support it. It helps for appliances or systems where installing an agent is not allowed.
22. Which platforms lost support in Client 19?
Local installs on AIX and Solaris are discontinued (they can be managed in target mode), and Intel macOS is not supported.
23. A chef-client run fails halfway. How do you troubleshoot?
Read the stack trace and the failing resource in the output, rerun with debug logging, check the cookbook version the node actually received, and reproduce in Test Kitchen. Fix, bump the version, push the policy and rerun.
24. A service restarts on every run. Why?
A resource reports a change each run, often a template with a timestamp or an execute without a guard, and it notifies the service. Make the resource idempotent and the restarts stop.
25. How do you keep secrets out of cookbooks?
Never commit them. Read them at run time from a secrets manager, or use encrypted data bags with keys distributed separately, and mark sensitive resources with sensitive true so values do not appear in logs.
26. How does Chef fit into CI/CD?
On every pull request run Cookstyle, ChefSpec and Test Kitchen. On merge, update the Policyfile lock and push it to a staging policy group, test, then promote the same lock to production.
27. What is Chef Habitat?
Progress's tool for building and running applications and software packages with their dependencies. Client 19 itself is built with Habitat, which is why its install path and packaging changed.
28. Chef or Ansible: how do you answer?
Chef uses Ruby code with a client and server model and strong testing tools; Ansible uses YAML playbooks pushed over SSH without an agent. Chef suits teams that want code-heavy, tested configuration on long-lived fleets. Many companies use both.
29. How do you upgrade a fleet from Client 18 to 19?
Read the differences guide, upgrade Workstation to 26 or later, obtain license keys, test cookbooks on Client 19 in Test Kitchen, check any appbundler or path assumptions, then roll out in batches with monitoring of run success.
30. How would you check compliance across nodes?
Write or adopt InSpec profiles for the standard you need, run them on a schedule against nodes, and send results to a reporting system so failures become tickets.
Certification: should you take it?
Progress offers two Chef certifications. The Associate Chef track is for operational users and combines a multiple-choice exam (75% to pass) with lab tasks, including publishing a cookbook to a working Chef environment in the Learn Chef lab. The Executive Chef track is mentor-led and aimed at architects. Progress says both must be completed within six months of enrolment with up to three attempts, and lists prices at registration rather than publicly. A certification helps if the employers you target use Chef heavily, but interviews still test hands-on skill, so do the lab work either way. Our Chef certification interview questions post goes deeper on that path.
Interview day tips
Bring one cookbook you can describe end to end: what it configures, how you tested it, and one bug you fixed. Answer with the direct point first, then detail. When you do not know something, say how you would find it, such as reading the resource documentation or rerunning with debug logging.
Expect at least one question about versions. If you learned on Client 18, say so, and explain what you would check before moving to 19: the license key for downloads and bootstrap, the new install path for any scripts that call /opt/chef, the Ruby version for custom gems, and Workstation 26 on developer machines. That answer shows you read release notes, which is a habit interviewers value in anyone who will run upgrades. Also prepare a two-minute explanation of your test pipeline, from Cookstyle on a pull request to a Policyfile promoted to production, because it brings together most of the topics in this guide in one story. For scenario practice, see the Chef scenario-based questions, and for the Ansible comparison that often follows, the most asked Ansible questions. The 200 DevOps interview questions hub covers the other rounds.
Configuration management with desired state and idempotence is taught in our Ansible training, in the Kharadi, Pune classroom and live online.
Official references
- Progress Chef: differences between Infra Client 18 and 19
- Progress Chef certification programs
- Chef Infra Client release notes
- Chef documentation
FAQs
How long does it take to prepare for a Chef interview?
About four weeks of steady practice is enough for most people with Linux basics: one week each for concepts, testing, server operations and troubleshooting.
What is new in Chef Infra Client 19?
Habitat-based packaging, a license key for downloads, the chef-ice package name, a new install path, Ruby 3.4, a Workstation 26 requirement and an agentless mode.
Is there an official Chef certification?
Yes. Progress offers Associate Chef and Executive Chef certifications. The Associate track needs 75% on a multiple-choice exam plus lab tasks.
Should I learn Policyfiles or roles and environments?
Learn both, but use Policyfiles for new work because they lock exact cookbook versions and promote the same set between environments.
Which testing tools should I know for Chef?
Cookstyle for linting, ChefSpec for unit tests, Test Kitchen for converging test instances and InSpec for integration and compliance checks.
Is Chef still used in 2027?
Yes, Progress continues to release Chef Infra Client and related tools. Check job listings in your target market to decide how much time to give it compared with Ansible.
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0