Intermediate CI/CD test (Intermediate)
30 questions · 35 minutes · Free
Jenkins, GitHub Actions, GitLab CI and deployment strategies.
Take the Intermediate CI/CD test
What it covers
- Jenkins pipelines
- GitHub Actions
- GitLab CI
- Secrets
- Blue-green and canary
Interview format
- Questions: 30 questions — 18 multiple choice, 9 multi-answer, 3 predict-the-output
- Time: 35 minutes, timed from the first question
- Difficulty: Intermediate
- Skill area: DevOps & cloud
- Price: Free
Earn a certificate
The Intermediate CI/CD test is one of the 8 tests of the DevOps Engineer: Intermediate learning path. Pass it and the other 7 tests at 70% or more and readyforhires issues you a verifiable certificate in your name, with its own code and verify link to share or add to LinkedIn.
Sample questions
5 sample questions from the Intermediate CI/CD test, with the answers. Samples are taken out of the live test, so you will not meet these when you sit it.
Which deployment strategy involves deploying to an idle environment and switching traffic all at once after testing?
- Rolling update
- Canary deployment
- Blue-green deployment
- Feature flags
Answer: C. Blue-green deployment
Blue-green deployment is a strategy where two identical environments are used, and traffic is switched all at once after deployment and testing. Canary deployment, on the other hand, gradually routes a small percentage of traffic to the new version. Rolling update replaces instances gradually, and feature flags allow deploying without releasing immediately.
Which of the following statements accurately describes blue-green deployment?
- Blue-green deployment allows for zero-downtime deployment by gradually shifting traffic to the new version.
- Blue-green deployment minimizes downtime by maintaining two identical production environments.
- Blue-green deployment is primarily used for managing dependencies in a CI/CD pipeline.
- Blue-green deployment is a deployment strategy that involves rolling back changes if they fail.
Answer: B. Blue-green deployment minimizes downtime by maintaining two identical production environments.
Blue-green deployment is a strategy that minimizes downtime during deployment by maintaining two identical production environments. One environment (the 'blue' environment) is active and serving traffic, while the other (the 'green' environment) is used for deployment and testing. Once the deployment is complete and verified, traffic is switched to the 'green' environment. This approach ensures that there is no downtime and allows for quick rollbacks if needed. The other options are either incorrect or describe different deployment strategies.
How can a GitLab CI/CD pipeline be scheduled to run at specific times, such as daily or weekly, in a realistic project scenario?
- Using the `trigger` keyword in the `.gitlab-ci.yml` file
- Using the `schedule` keyword in the `.gitlab-ci.yml` file
- Using a cron job on the GitLab server
- Defining a custom event in the GitLab UI
Answer: B. Using the `schedule` keyword in the `.gitlab-ci.yml` file
In GitLab CI/CD, pipeline scheduling is achieved by using the `schedule` keyword in the `.gitlab-ci.yml` file. This allows pipelines to be triggered at specific intervals, such as daily or weekly. The other options are either unrelated to scheduling or incorrect methods of implementing it.
In a GitLab CI/CD pipeline, you are tasked with caching dependencies for a project that frequently updates its dependencies. Which approach should you take to ensure that the cache is correctly restored for each job?
- Use a static cache key for all jobs to speed up the process.
- Use the cache key based on the Git commit hash and dependency versions to ensure consistent restores.
- Store the cache in a shared network drive accessible to all runners.
- Ignore the cache key and always rebuild dependencies from scratch.
Answer: B. Use the cache key based on the Git commit hash and dependency versions to ensure consistent restores.
To effectively cache dependencies in GitLab CI/CD, you should use a cache key that includes the Git commit hash and dependency versions. This ensures that the cache is only restored when the dependencies and code are the same, preventing inconsistencies. Other options may lead to cache misses or incorrect restores, which can negatively impact build performance and reliability.
Which CI/CD platform uses a `.gitlab-ci.yml` file at the repo root for pipeline configuration?
- GitLab CI/CD
- Jenkins
- Azure Pipelines
- GitHub Actions
Answer: A. GitLab CI/CD
GitLab CI/CD uses a `.gitlab-ci.yml` file at the repo root for configuration. This is different from Jenkins, which uses a `Jenkinsfile`, and GitHub Actions, which uses YAML files in `.github/workflows/`.
Frequently asked questions
- How many questions are in the Intermediate CI/CD test?
- 30 questions (18 multiple choice, 9 multi-answer, 3 predict-the-output), with 35 minutes to answer them.
- What does the Intermediate CI/CD test cover?
- Jenkins pipelines, GitHub Actions, GitLab CI, Secrets, Blue-green and canary.
- Is the Intermediate CI/CD test free?
- Yes. It is free to take with a readyforhires account.
- What level is the Intermediate CI/CD test?
- Intermediate, in DevOps & cloud.