30 Common CI/CD Interview Questions (with Answers)

Version control

1. What is version control?

2. What is Git?

3. What is a Git repository?

4. Which other version control tools do you know of?

  • Mercurial
  • Subversion (SVN)
  • Concurrent Version Systems (CVS)
  • Perforce
  • Bazaar
  • Bitkeeper
  • Fossil

5. What is a Git branch?

6. What is merging?

7. What is trunk-based development?

8. What is Gitflow, and how does it compare to trunk-based development?

9. How long should a branch live?

CI/CD

10. What is continuous integration?

11. How do CI and version control relate to one another?

12. What’s the difference between continuous integration, continuous delivery, and continuous deployment?

13. Name some benefits of CI/CD

  • Less risk: automated tests reduce the chance of introducing bugs, creating a safety net that increases the developer’s confidence in their code.
  • More frequent releases: the automation provided by continuous delivery and continuous deployment allows developers to release and deploy software safely many times per day.
  • Improved productivity: freed from the manual labor of building and testing the code, developers can focus on the creative aspects of coding.
  • Elevated quality: CI acts as a quality gate, preventing code that is not up to standards from getting released.
  • Better design: the iterative nature of continuous integration lets developers work in small increments, allowing a higher degree of experimentation, which leads to more innovative ideas.

14. What are the most important characteristics in a CI/CD platform?

  • Reliability: the team depends on the CI server for testing and deployment, so it must be reliable. An unreliable CI/CD platform can block all development work.
  • Speed: the platform should be fast and scalable to obtain results in a few minutes.
  • Reproducibility: the same code should always yield the same results.
  • Ease of use: easy to configure, operate, and troubleshoot.

15. What is the build stage?

16. What’s the difference between a hosted and a cloud-based CI/CD platform?

17. How long should a build take?

18. Is security important in CI/CD? What mechanisms are there to secure it?

19. Can you name some deployment strategies?

  • Regular release/deployment: releases software to everyone at once, making it available to the general public.
  • Canary releases: this is a method that reduces the chance of failure by exposing a small portion of the userbase (around 1%) to the release. With a canary release, developers gradually switch users to the latest release in a controlled way.
  • Blue-green releases: consists of running two simultaneous instances of an application; one is the stable version currently serving users and the other the latest release. Users are switched from the former to the latter all at once. This method is safer than the regular or big bang releases because users can instantly be routed back to the previous version if there is a problem.
  • Dark launches: are deployments where new features are released without being announced. Features can be enabled in a very fine-grained way with feature flags.

Testing

20. How does testing fit into CI?

21. Should testing always be automated?

22. Name a few types of tests used in software development

  • Unit tests: validate that functions or classes behave as expected.
  • Integration tests: are used to verify that the different components of an application work well together.
  • End-to-end tests: check an application by simulating user interaction.
  • Static tests: finds defects in code without actually executing it.
  • Security tests: scans the application’s dependencies for known security issues.
  • Smoke tests: fast tests that check if the application can start and that the infrastructure is ready to accept deployments.

23. How many tests should a project have?

24. What is a flaky test?

  • Improperly handled concurrency.
  • Dependency on test order within the test suite.
  • Side effects in tests.
  • Use of non-deterministic code.
  • Non-identical test environments.

25. What is TDD?

  1. Red: write a test that fails.
  2. Green: write the minimal code that passes the test.
  3. Refactor: improve the code, and make it more abstract, readable, and optimized.

26. What is the main difference between BDD and TDD?

27. What is test coverage?

28. Does test coverage need to be 100%?

29. How can you optimize tests in CI?

  • Breaking large tests into smaller units.
  • Removing obsolete tests.
  • Refactoring tests to have fewer dependencies.
  • Parallelizing tests.

30. What’s the difference between end-to-end testing and acceptance testing?

Conclusion

--

--

--

Supporting developers with insights and tutorials on delivering good software. · https://semaphoreci.com

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Semaphore

Semaphore

Supporting developers with insights and tutorials on delivering good software. · https://semaphoreci.com

More from Medium

Terrform : Chapter 2

A High-Level Overview of DevOps

Running Highly Available Apps on Kubernetes

Monolithic and Microservices Architecture