Skip to content

Circleci

← Back to all decks

31 cards — 🟢 5 easy | 🟡 8 medium | 🔴 3 hard

🟢 Easy (5)

1. What is CircleCI and how does it fit into CI/CD workflows?

Show answer [Circle CI](https://circleci.com): "CircleCI is a continuous integration and continuous delivery platform that can be used to implement DevOps practices."

Remember: CircleCI = SaaS CI/CD platform. Config in .circleci/config.yml. Free tier: 6,000 build minutes/month.

CircleCI vs GitHub Actions: CircleCI has more executor types (Docker, Linux, macOS, Windows, ARM). GHA has tighter GitHub integration.

2. What is a CircleCI Orb and how does it enable reuse?

Show answer [Circle CI Docs](https://circleci.com/developer/orbs): "Orbs are shareable packages of CircleCI configuration you can use to simplify your builds"

They can come from the public registry or defined privately as part of an organization.

Remember: orbs = reusable CI/CD config packages (like GitHub Actions). Example: circleci/aws-cli@4.0 provides AWS CLI steps without manual setup.

3. What are approval jobs in CircleCI workflows?

Show answer Approval jobs are manual gates in a workflow that pause execution until a team member clicks "Approve" in the CircleCI UI. Defined with type: approval in the workflow. Common use: require human approval before deploying to production. Downstream jobs use requires: [hold] to wait for the approval step.

Remember: workflows orchestrate job execution order, parallelism, and fan-out/fan-in patterns. Jobs within a workflow can run in parallel or sequentially.

4. How do you validate a CircleCI configuration file locally?

Show answer Use the CircleCI CLI: circleci config validate to check .circleci/config.yml for syntax and schema errors before pushing. You can also run circleci config process to see the fully expanded config after orb resolution. This catches errors early and avoids wasted build minutes on broken configs.

Remember: CircleCI config lives in .circleci/config.yml. Start with a simple config and iterate. Use the circleci CLI to validate locally: circleci config validate.

5. What executor types does CircleCI support?

Show answer Docker: runs jobs in a Docker container (most common, fast startup).
Machine: runs on a full Linux VM with root access (needed for Docker-in-Docker, privileged operations).
MacOS: runs on a macOS VM (for iOS/macOS builds).
Windows: runs on a Windows VM.
Arm: runs on ARM-based machines. Choose based on what your build needs: Docker for most workloads, machine for Docker builds or kernel access.

Remember: executors define where jobs run: Docker (fast, lightweight), machine (full VM), macOS (for iOS builds). Choose based on your build needs.

🟡 Medium (8)

1. What are some benefits of Circle CI?

Show answer [Circle CI Docs](https://circleci.com/docs/about-circleci): "SSH into any job to debug your build issues.
Set up parallelism in your .circleci/config.yml file to run jobs faster.
Configure caching with two simple keys to reuse data from previous jobs in your workflow.
Configure self-hosted runners for unique platform support.
Access Arm resources for the machine executor.
Use orbs, reusable packages of configuration, to integrate with third parties.
Use pre-built Docker images in a variety of languages.
Use the API
to retrieve information about jobs and workflows.
Use the CLI to access advanced tools locally.
Get flaky test detection with test insights."

2. Explain the following configuration file

Show answer This configuration file will set up one job that will checkout the code of the project will run the command `echo Hello, World!`.
It will run in a container using the image `cimg/base:stable`.

Remember: CircleCI config lives in .circleci/config.yml. Start with a simple config and iterate. Use the circleci CLI to validate locally: circleci config validate.

3. Where (in what location in the project) Circle CI pipelines are defined?

Show answer `.circleci/config.yml`

Remember: CircleCI config lives in .circleci/config.yml. Start with a simple config and iterate. Use the circleci CLI to validate locally: circleci config validate.

4. How do CircleCI orbs promote configuration reuse and what types exist?

Show answer Orbs are reusable YAML config packages that encapsulate jobs, commands, and executors. Types: 1) Public orbs from the registry (e.g., circleci/node, circleci/aws-cli); 2) Private orbs scoped to an organization; 3) Inline orbs defined in-config for local reuse. They reduce duplication and standardize CI patterns across teams.

Remember: orbs = reusable CI/CD config packages (like GitHub Actions). Example: circleci/aws-cli@4.0 provides AWS CLI steps without manual setup.

5. What are CircleCI contexts and how do they manage secrets?

Show answer Contexts are named collections of environment variables stored at the organization level. They are attached to jobs in a workflow. Benefits: 1) Secrets are encrypted at rest; 2) Access can be restricted by security group; 3) Multiple projects can share the same context; 4) Contexts separate secret management from config files. Example: a "production" context with AWS credentials shared across deploy jobs.

Remember: contexts = shared environment variables across projects. Use for org-wide secrets (AWS keys, Docker Hub tokens). Restrict access with security groups.

6. What are CircleCI resource classes and when would you change them?

Show answer Resource classes define the CPU and RAM allocated to a job executor. Options range from small (1 vCPU, 2GB) to 2xlarge+ (8+ vCPU, 16GB+). Change them when: 1) Builds are slow due to CPU-bound compilation; 2) Tests run out of memory; 3) You want to reduce cost by downsizing low-resource jobs. Specified per job: resource_class: large.

Remember: CircleCI config lives in .circleci/config.yml. Start with a simple config and iterate. Use the circleci CLI to validate locally: circleci config validate.

7. How do you set up scheduled pipelines in CircleCI?

Show answer Scheduled pipelines trigger workflows on a cron schedule without requiring a git push. Configure via the CircleCI UI or API: set a cron expression, target branch, and pipeline parameters. Use cases: nightly builds, periodic security scans, scheduled integration tests. The pipeline runs with the latest code from the specified branch.

Remember: CircleCI config lives in .circleci/config.yml. Start with a simple config and iterate. Use the circleci CLI to validate locally: circleci config validate.

8. How do you SSH into a CircleCI job for debugging?

Show answer Click "Rerun job with SSH" in the CircleCI UI. CircleCI will rerun the job and provide an SSH command to connect. You get shell access to the running executor to inspect the environment, run commands, and debug failures interactively. The session stays open for 10 minutes after the job finishes or 2 hours max.

Remember: CircleCI config lives in .circleci/config.yml. Start with a simple config and iterate. Use the circleci CLI to validate locally: circleci config validate.

🔴 Hard (3)

1. What is the difference between workspaces and caching in CircleCI?

Show answer Workspaces persist data between jobs within a single workflow run (e.g., build artifacts passed to a deploy job). They are ephemeral and deleted after the workflow ends.
Caching persists data across workflow runs (e.g., node_modules, pip packages). Caches use keys with checksums for invalidation.
Use workspaces for intra-workflow data flow, caches for speeding up repeated builds.

Remember: CircleCI config lives in .circleci/config.yml. Start with a simple config and iterate. Use the circleci CLI to validate locally: circleci config validate.

2. How does CircleCI parallelism work for splitting tests?

Show answer Set parallelism: N on a job to run N containers in parallel. Use circleci tests split to distribute test files across containers. Splitting strategies: 1) --split-by=timings (uses historical timing data for even distribution); 2) --split-by=filesize; 3) --split-by=name. Requires collecting test results with store_test_results for timing data. Can dramatically reduce test suite wall time.

Remember: CircleCI config lives in .circleci/config.yml. Start with a simple config and iterate. Use the circleci CLI to validate locally: circleci config validate.

3. What is Docker Layer Caching (DLC) in CircleCI and when should you use it?

Show answer DLC caches Docker image layers between builds so that unchanged layers are not rebuilt. Enable it on machine or remote Docker executors with docker_layer_caching: true. Use when: 1) Building Docker images is a significant part of CI time; 2) Base layers rarely change. Cost: DLC is a paid feature and adds overhead for cache management. Not useful if Dockerfiles change frequently.

Remember: CircleCI config lives in .circleci/config.yml. Start with a simple config and iterate. Use the circleci CLI to validate locally: circleci config validate.