Most Asked CircleCI Interview Questions (2027)
48 most asked CircleCI interview questions with answers: config.yml, orbs, caching vs workspaces, test splitting, contexts, OIDC and debugging.
The most asked CircleCI interview questions cover the .circleci/config.yml structure (jobs, workflows, executors, steps), orbs, caching versus workspaces, test splitting with parallelism, contexts and secrets, OIDC for cloud access, and how to debug a failing job. This page answers 48 of them, grouped by experience level, with scenario questions at the end.
This is the main CircleCI interview guide on our blog. Shorter and more specialised pages link back here, including scenario-based CircleCI questions, advanced CircleCI questions and the CircleCI interview preparation guide. Config keys and CLI commands below were checked against the CircleCI configuration reference in November 2026.
Key takeaways
- Every answer about configuration comes back to four building blocks: executors, jobs, steps and workflows.
- Know
version: 2.1features: orbs, reusable commands, reusable executors and pipeline parameters. - Caches speed up dependency installs between pipelines. Workspaces pass files between jobs in the same workflow. Artifacts store files for people to download.
circleci tests runsupersedescircleci tests splitand is required for the rerun failed tests feature.- Contexts hold shared secrets and can be restricted to security groups. OIDC tokens remove the need for long-lived cloud keys.
- For debugging, interviewers expect "rerun job with SSH" and
circleci config validate.
Where CircleCI questions come up
CircleCI questions appear in DevOps, platform and build engineer interviews at companies that use it as their CI/CD service. Interviewers rarely expect you to know every key. They want to see that you can read a config, explain why a pipeline is slow or failing, and keep secrets safe. If you are comparing tools, our Jenkins vs GitLab CI vs CircleCI comparison explains where each fits.
| Level | Questions | What is being tested |
|---|---|---|
| Freshers | 1 to 16 | Config structure, basic steps, triggers |
| 2 to 5 years | 17 to 34 | Orbs, caching, parallelism, contexts, dynamic config |
| Senior | 35 to 42 | Security, runners, cost, standardisation |
| Scenarios | 43 to 48 | Debugging real failures |
CircleCI interview questions for freshers
1. What is CircleCI?
CircleCI is a hosted CI/CD service that runs build, test and deploy jobs when code changes in a connected repository. Pipelines are defined in .circleci/config.yml in the repository. There is also a self-hosted server edition and self-hosted runners for jobs that must run on your own machines.
2. Where does CircleCI configuration live?
In .circleci/config.yml at the root of the repository. Because it is in Git, config changes go through the same pull request review as code.
3. What are the main top-level keys in a config?
version, jobs and workflows appear in almost every file. With version 2.1 you also use orbs, commands, executors and parameters. A setup: true key enables dynamic configuration.
4. Write a minimal config that runs tests in a Docker image.
version: 2.1
jobs:
test:
docker:
- image: cimg/node:20.11
steps:
- checkout
- run: npm ci
- run: npm test
workflows:
build-and-test:
jobs:
- test
cimg/ images are CircleCI's maintained convenience images.
5. What is a job?
A job is a collection of steps that run in one execution environment. Each job starts fresh, so files do not carry over between jobs unless you use a workspace or cache.
6. What is a workflow?
A workflow decides which jobs run, in what order and under what conditions. Jobs without requires run in parallel. Jobs with requires wait for the named jobs to succeed.
7. What is an executor, and which types exist?
The executor is the environment a job runs in. The types are docker, machine (a full VM) and macos. Windows jobs run on a machine executor with a Windows image, and self-hosted runners extend this to your own hardware.
8. When would you pick the machine executor over Docker?
When the job needs full VM access: running Docker commands with privileged features, kernel modules, or tools that do not work inside a container. Docker executors start faster for ordinary builds.
9. What does the checkout step do?
It clones the project's code into the working directory at the commit that triggered the pipeline. It does not check out Git submodules automatically, so add a run step for that if you need them.
10. Name the common step types.
checkout, run, save_cache, restore_cache, persist_to_workspace, attach_workspace, store_artifacts, store_test_results, setup_remote_docker and add_ssh_keys. when and unless wrap steps in a condition.
11. What is resource_class?
It sets the CPU and memory size for a job, such as medium or large. Bigger classes finish faster but use more credits. For self-hosted runners, the resource class names the runner pool the job goes to.
12. How do you run a job only on the main branch?
workflows:
deploy:
jobs:
- test
- deploy:
requires: [ test ]
filters:
branches:
only: main
13. How do you add a manual approval?
Add a job entry with type: approval in the workflow and make the deploy job require it. The workflow pauses until someone approves it in the CircleCI app. The approval job is defined only under workflows, not under jobs.
14. Where do you store a secret such as an API token?
In a project environment variable or a context, never in config.yml. CircleCI masks secret values in job output, but you should still avoid printing them.
15. How do you see test results in the CircleCI UI?
Have your test runner write JUnit XML and add store_test_results with the path. The UI then shows failed tests, and CircleCI can use the timing data for test splitting.
16. How do you check a config for errors before pushing?
Install the CircleCI CLI and run:
circleci config validate
circleci config process .circleci/config.yml
validate checks syntax and schema. process expands orbs and 2.1 features into the final config so you can see what will actually run.
Questions for 2 to 5 years of experience
17. What is an orb?
An orb is a reusable, versioned package of CircleCI config: commands, jobs and executors. You import it under orbs: with a version, for example node: circleci/[email protected], and call its jobs or commands. Check the orb's page in the registry for the current version.
18. What are the risks of third-party orbs, and how do you control them?
An orb runs code in your jobs, so a malicious or broken version can read secrets. Pin exact versions, review the source, and use the organization security setting that allows only certified and partner orbs, or only your own private orbs.
19. Explain reusable commands and executors.
A command is a named sequence of steps with parameters, defined under commands:. An executor is a named environment under executors:. Jobs call both, so you define the Node image or the install steps once.
executors:
node:
docker:
- image: cimg/node:20.11
commands:
install:
steps:
- restore_cache:
keys:
- deps-{{ checksum "package-lock.json" }}
- run: npm ci
- save_cache:
key: deps-{{ checksum "package-lock.json" }}
paths: [ ~/.npm ]
jobs:
test:
executor: node
steps: [ checkout, install, { run: npm test } ]
20. Cache, workspace or artifact: what is the difference?
| Feature | Scope | Typical use |
|---|---|---|
| Cache | Across pipelines | Dependency folders such as ~/.npm or ~/.m2 |
| Workspace | Between jobs in one workflow | Build output passed from build to deploy |
| Artifact | Stored after the job for people to download | Coverage reports, binaries, screenshots |
21. How do cache keys work, and why use a checksum?
A cache is saved under a key and is immutable once saved. Using {{ checksum "package-lock.json" }} makes the key change when dependencies change. restore_cache accepts a list of keys and uses prefix matching, so you can fall back to an older partial cache.
22. How does parallelism and test splitting work?
Set parallelism: 4 on a job to run four copies of it. Each copy gets a different slice of the tests:
circleci tests glob "spec/**/*_spec.rb" \
| circleci tests run --command="xargs bundle exec rspec --format RspecJunitFormatter -o test-results/rspec.xml" \
--verbose --split-by=timings
--split-by=timings uses stored test timing data, which comes from store_test_results.
23. What does "rerun failed tests" do?
It starts a new workflow from the same commit that runs only the tests that failed, instead of the whole suite. It needs circleci tests run and JUnit XML results with file or classname attributes.
24. What is a context?
A context is an organization-level set of environment variables that you attach to workflow jobs with context: aws-prod. Several projects can share it, and you rotate a secret in one place.
25. How do you restrict who can use production secrets?
Restrict the context to a security group, so only members of that group can trigger jobs that use it. Combine this with an approval job so a member must approve before the deploy job runs.
26. What are pipeline parameters?
Typed values (string, boolean, integer or enum) declared under top-level parameters:. They can be set when a pipeline is triggered through the API and used in when conditions to choose which workflow runs.
27. What is dynamic configuration?
With setup: true, the first workflow runs a setup job that generates or selects the real config and continues the pipeline with it, usually through the continuation orb. Monorepos use it with the path filtering orb to build only the services that changed.
28. How do you build and push a Docker image from a Docker executor?
Add setup_remote_docker, which gives the job a separate Docker engine. Then run docker build and docker push. Docker layer caching can be enabled on that step to reuse layers between runs, at extra cost.
29. How do you run a nightly build?
Use a scheduled pipeline set up in project settings or through the API. Older configs use a workflow with triggers and a schedule cron. CircleCI recommends scheduled pipelines, and its migration guide explains how to move from scheduled workflows.
30. How do you run the same job for several versions?
Use a matrix on a parameterised job in the workflow, for example matrix: parameters: node-version: ["18.20", "20.11"]. CircleCI creates one job per combination.
31. How do you skip CI for a documentation-only commit?
Put [ci skip] or [skip ci] in the commit message. For finer control in a monorepo, use dynamic config with path filtering.
32. How do you pass build output to a deploy job?
build:
steps:
- checkout
- run: make build
- persist_to_workspace:
root: .
paths: [ dist ]
deploy:
steps:
- attach_workspace:
at: .
- run: ./deploy.sh dist
33. How do you run a step even if earlier steps failed?
Set when: always on the run step. It is common for uploading logs or cleaning up test resources.
34. What do Insights show?
Insights report workflow and job duration, success rate, credit use and flaky tests over time. Use them to find the slowest jobs before optimising anything.
Senior CircleCI interview questions
35. How do you give a job AWS or Google Cloud access without stored keys?
Use CircleCI's OIDC tokens. A job receives a signed token in $CIRCLE_OIDC_TOKEN (and in newer versions with more claims, such as $CIRCLE_OIDC_TOKEN_V2, which adds repository and branch to the subject). Configure the cloud provider to trust CircleCI as an identity provider and exchange the token for short-lived credentials. Trust policies should check the organization, project and branch claims.
36. When would you use self-hosted runners?
When jobs must reach private networks, need special hardware such as GPUs or specific architectures, or must run on machines you control for compliance. Runners can be machine runners or container runners on Kubernetes. Route jobs to them with the runner's resource class.
37. How do you standardise CI across 100 repositories?
Publish a private orb with your organization's approved jobs and commands, version it with semantic versioning, and have repos reference it. Use config policies to enforce rules, such as requiring specific orbs or forbidding unapproved ones.
38. How would you cut credit spend without slowing teams down?
Start with Insights to find the most expensive jobs. Right-size resource classes, cache dependencies, split tests sensibly, rerun only failed tests, cancel redundant workflows on the same branch with auto-cancel, and use path filtering so unrelated services do not build.
39. How do you protect secrets from pull requests opened from forks?
Keep the project setting that blocks passing secrets to forked pull requests turned on. Do not build forks on runners that can reach internal systems. Run untrusted code only in jobs that have no contexts attached.
40. How do you make a deploy safe to roll back?
Build an immutable artifact or image once, tag it with the commit SHA, and deploy that exact tag through each environment. Rolling back is then redeploying a previous tag, which you can trigger with a pipeline parameter.
41. How do you handle flaky tests?
Use Insights to identify them, quarantine or fix them, and use rerun failed tests so one flaky test does not force a full rerun. Do not hide flakiness with automatic job reruns without tracking it.
42. How do you keep a monorepo pipeline fast?
Use dynamic config with path filtering to set pipeline parameters for changed folders, then run only the workflows for those services. Share caches by lock file per service, and keep a nightly full build to catch cross-service breakage.
Scenario questions
43. A job passes locally but fails in CircleCI. How do you debug it?
Read the failing step's output first, then rerun the job with SSH. CircleCI gives you an SSH command to connect to the running container or VM so you can repeat the command in the same environment. Common causes are different image versions, missing environment variables and files that only existed locally.
44. The cache never restores. What do you check?
Compare the key in save_cache with the keys in restore_cache, check that the checksum file exists at that point in the job, and remember that a key that already exists is not overwritten. A changing value such as {{ epoch }} in the key creates a new cache every run.
45. The deploy job says an environment variable is empty.
Check that the workflow attaches the right context to that job, that the user who triggered the pipeline is in the context's security group, and that the pipeline is not a forked pull request with secrets blocked.
46. Tests take 40 minutes. What is your plan?
Store test results so timings exist, raise parallelism and split by timings, cache dependencies, and move slow end-to-end tests to a separate workflow that runs before merge or on a schedule. Measure in Insights after each change.
47. A workflow is stuck "on hold". Why?
It has reached an approval job. Someone with permission has to approve or cancel it in the app. If nobody is expected to approve, the approval job was added to the wrong branch filter.
48. A config change broke every project using your private orb.
Projects that referenced a floating version picked up the change. Roll back by publishing a fixed patch version, then require exact version pins and test new orb versions in a canary project before announcing them.
How to prepare
- Build a config for a small app with test, build and deploy jobs, a cache, a workspace and an approval.
- Add parallelism with
circleci tests runand look at the timing data in the UI. - Write one reusable command and one executor, then replace them with an orb.
- Set up OIDC to a cloud sandbox account and remove all stored keys.
- Practise the scenarios above, then work through our real-time CircleCI questions.
CircleCI skills sit on general CI/CD knowledge, so prepare the basics in our Jenkins interview questions and Docker interview questions as well. Our DevOps training in Pune covers CI/CD pipelines, containers and cloud deployment in the Kharadi classroom and live online.
FAQ
What are the most asked CircleCI interview questions?
Config structure (jobs, workflows, executors, steps), orbs, caching versus workspaces, parallelism and test splitting, contexts for secrets, and how to debug a failed job with SSH rerun.
What is the difference between a CircleCI cache and a workspace?
A cache reuses files such as dependencies across pipeline runs. A workspace passes files between jobs within one workflow run.
What is an orb in CircleCI?
A reusable, versioned package of config that contains commands, jobs and executors. You import it under the orbs key and pin a version.
How do you store secrets in CircleCI?
Use project environment variables or contexts. Restrict production contexts to security groups and prefer OIDC tokens over long-lived cloud keys.
How do you validate a CircleCI config locally?
Run circleci config validate with the CircleCI CLI, and circleci config process to see the expanded config after orbs are resolved.
Does CircleCI support self-hosted builds?
Yes. Self-hosted runners run jobs on your own machines or Kubernetes cluster, and CircleCI also offers a self-hosted server edition.
Official references
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0