Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 6 MCQs CI/CD with Jenkins

INT332 — Devops Virtualization And Configuration Management 60 questions. Pick an option to check it.

Read the notes

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Jenkins architecture (Master/Agent model) Easy

    In the Jenkins Master/Agent architecture, what is the primary role of the Jenkins Master?

  2. Question 2 of 60 Plugins management Easy

    What is the primary purpose of plugins in Jenkins?

  3. Question 3 of 60 Jenkinsfile structure Easy

    What is a Jenkinsfile?

  4. Question 4 of 60 Freestyle vs Pipeline jobs Easy

    What is a major advantage of Jenkins Pipeline jobs over Freestyle jobs?

  5. Question 5 of 60 Declarative pipeline syntax Easy

    Which keyword is used to start a Declarative Jenkins Pipeline block?

  6. Question 6 of 60 Pipeline Stages: Checkout code from Git Easy

    What happens during the 'Checkout' stage of a Jenkins CI/CD pipeline?

  7. Question 7 of 60 Managing artifacts Easy

    In Jenkins, what is an 'artifact'?

  8. Question 8 of 60 Jenkins multi-branch pipelines Easy

    What is the main feature of a Jenkins Multi-branch Pipeline?

  9. Question 9 of 60 Docker inside Jenkins agents Easy

    Why is running Docker inside Jenkins agents beneficial?

  10. Question 10 of 60 Publishing images to Docker Hub/GHCR Easy

    Which of the following describes the process of sending a newly built Docker image to Docker Hub?

  11. Question 11 of 60 Jenkins CI/CD Deployment Flows: Triggering builds (pollSCM, webhook) Easy

    Which build trigger mechanism is more efficient and immediate: PollSCM or Webhooks?

  12. Question 12 of 60 Global tool configuration Easy

    Where in Jenkins do you configure the paths for tools like JDK, Maven, and Git so that they can be used globally across jobs?

  13. Question 13 of 60 Jenkins architecture (Master/Agent model) Easy

    What is a Jenkins Agent?

  14. Question 14 of 60 Post actions Easy

    In a Declarative Pipeline, what is the purpose of the post block?

  15. Question 15 of 60 Running Maven builds in pipelines Easy

    Which of the following commands is typically used in a Jenkins pipeline to compile, test, and package a Java application using Maven?

  16. Question 16 of 60 Backup & restore Easy

    Which directory contains all Jenkins configurations, job definitions, and logs, and is the primary target for a Jenkins backup?

  17. Question 17 of 60 Pipeline libraries Easy

    What is the primary benefit of using Jenkins Shared Libraries?

  18. Question 18 of 60 Parameters Easy

    Why would you use parameters in a Jenkins pipeline?

  19. Question 19 of 60 Code coverage & test reports Easy

    In a Jenkins pipeline, what is the purpose of test report plugins (like JUnit)?

  20. Question 20 of 60 Jenkins agents (SSH/SFTP/Container-based) Easy

    How does the Jenkins Master typically communicate with an SSH-based agent?

  21. Question 21 of 60 Jenkins Foundations: Jenkins architecture (Master/Agent model) Medium

    In a Jenkins Master/Agent architecture, what happens to currently executing builds on an agent if the Jenkins Master node suddenly crashes?

  22. Question 22 of 60 Jenkins Pipelines: Freestyle vs Pipeline jobs Medium

    Which of the following is a primary advantage of using a Jenkins Pipeline job over a Freestyle job for a CI/CD workflow?

  23. Question 23 of 60 Jenkins Pipelines: Declarative pipeline syntax Medium

    In a Declarative Pipeline, which directive is used to control the execution of a stage based on specific conditions, such as the branch name?

  24. Question 24 of 60 Pipeline Stages: Managing artifacts Medium

    Which pipeline step is used to preserve a generated binary file (e.g., a .jar file) so that it can be downloaded directly from the Jenkins build results page?

  25. Question 25 of 60 Jenkins CI/CD Deployment Flows: Triggering builds (pollSCM, webhook) Medium

    Why is it generally recommended to use Webhooks over pollSCM for triggering Jenkins builds from a Git repository?

  26. Question 26 of 60 Docker and Jenkins Integration: Docker inside Jenkins agents Medium

    When configuring a Jenkins agent to build Docker images, what is the 'Docker outside of Docker' (DooD) approach?

  27. Question 27 of 60 Jenkins Pipelines: Parameters, environment variables Medium

    How do you correctly reference a Jenkins environment variable named BUILD_NUMBER within a sh step in a Declarative Pipeline?

  28. Question 28 of 60 Jenkins and Maven: Global tool configuration Medium

    If an underlying Jenkins agent does not have Maven installed on its OS, how can a pipeline still execute mvn clean install successfully?

  29. Question 29 of 60 Docker and Jenkins Integration: Publishing images to Docker Hub/GHCR Medium

    What is the most secure way to authenticate and push a Docker image to Docker Hub within a Jenkins pipeline?

  30. Question 30 of 60 Jenkins CI/CD Deployment Flows: Jenkins agents (SSH/SFTP/Container-based) Medium

    To add a new Linux-based Jenkins agent via SSH, which of the following is an absolute requirement on the target agent machine?

  31. Question 31 of 60 Jenkins Pipelines: Jenkins multi-branch pipelines Medium

    How does a Jenkins Multi-branch Pipeline decide which branches to automatically build?

  32. Question 32 of 60 Pipeline Stages: Post actions Medium

    In a Declarative Pipeline, how can you ensure an email notification is sent ONLY when the build status changes from successful to failing?

  33. Question 33 of 60 Jenkins CI/CD Deployment Flows: Pipeline libraries Medium

    What is the primary purpose of Jenkins Shared Libraries?

  34. Question 34 of 60 Jenkins Pipelines: Scripted pipeline syntax Medium

    Which of the following represents a significant difference between Scripted Pipeline syntax and Declarative Pipeline syntax?

  35. Question 35 of 60 Backup & restore Medium

    To perform a complete backup of Jenkins, including job configurations, plugin configurations, and build histories, which directory is the most critical to back up?

  36. Question 36 of 60 Jenkins and Maven: Code coverage & test reports Medium

    After running mvn clean test jacoco:report in a Jenkins pipeline, how is the coverage report typically visualized on the Jenkins UI?

  37. Question 37 of 60 Pipeline best practices Medium

    According to Jenkins best practices, why should complex logic and heavy processing be avoided directly inside the Jenkins Master node (e.g., inside the Jenkinsfile Groovy context without an agent)?

  38. Question 38 of 60 Jenkins Foundations: Security, users, roles Medium

    When implementing Role-Based Access Control (RBAC) in Jenkins using the Role Strategy Plugin, how are permissions applied to specific jobs?

  39. Question 39 of 60 Docker and Jenkins Integration: Building Docker images using Jenkins Medium

    In a Declarative Pipeline, which block is used to specify that the entire pipeline should execute inside a specific Docker container rather than directly on the agent's host OS?

  40. Question 40 of 60 Jenkins CI/CD Deployment Flows: Deployments to servers/clouds Medium

    When configuring a deployment step in a pipeline to push code to a remote Linux server via SSH, which approach ensures the pipeline handles host key verification securely without hanging the build?

  41. Question 41 of 60 Jenkins Foundations: Jenkins architecture (Master/Agent model) Hard

    In a distributed Jenkins architecture operating across multiple isolated network zones, you need to connect an agent residing in a private subnet (no inbound internet access) to a Jenkins Master in a public cloud. Which connection strategy and configuration is most secure and architecturally appropriate?

  42. Question 42 of 60 Jenkins Foundations: Security, users, roles Hard

    When utilizing the Role-Based Strategy plugin for Jenkins security, a user is assigned a Global role with 'Overall/Read' access and an Item role matching the regex ^PROD-.* with 'Job/Build' access. However, the user cannot see any jobs starting with PROD-. What is the most likely cause of this issue?

  43. Question 43 of 60 Jenkins Pipelines: Declarative pipeline syntax Hard

    In a Declarative Pipeline, you have a stage that requires a heavy Docker agent to run. You want to execute a when condition based on a branch name before Jenkins provisions the Docker agent, to save compute resources. How can this be achieved?

  44. Question 44 of 60 Jenkins Pipelines: Declarative pipeline syntax Hard

    When defining a matrix block in a Declarative Pipeline to test multiple combinations of OS and browsers, you want to skip the combination of OS 'macOS' and browser 'Internet Explorer'. Which syntax correctly prevents this specific cell from executing?

  45. Question 45 of 60 Jenkins Pipelines: Scripted pipeline syntax Hard

    You are writing a Scripted Pipeline that dynamically generates parallel execution branches based on an array of environments. You want all parallel branches to finish execution even if one fails, so you can gather complete test results. Which approach guarantees this behavior?

  46. Question 46 of 60 Jenkins CI/CD Deployment Flows: Pipeline libraries Hard

    You are utilizing a Jenkins Shared Library and need to load a static configuration file (e.g., config.json) stored in the library's resources folder securely within a sandbox-restricted Scripted Pipeline. Which method is correct and adheres to Jenkins security practices?

  47. Question 47 of 60 Jenkins CI/CD Deployment Flows: Pipeline libraries Hard

    What is a primary functional difference between importing a shared library using the @Library('my-lib') _ annotation versus dynamically loading it using the library 'my-lib' step within a pipeline?

  48. Question 48 of 60 Jenkins Pipelines: Parameters, environment variables Hard

    In a Declarative Pipeline, an environment variable APP_ENV is defined in three places: as a global parameter (parameters { string(name: 'APP_ENV', defaultValue: 'dev') }), in the global environment block (environment { APP_ENV = 'qa' }), and inside a specific stage environment block (environment { APP_ENV = 'prod' }). What will be the value of env.APP_ENV when accessed within a script step in that specific stage?

  49. Question 49 of 60 Jenkins Pipelines: Jenkins multi-branch pipelines Hard

    In a Jenkins Multi-branch Pipeline project mapped to a GitHub repository, the 'Orphaned Item Strategy' is configured to discard old items with 'Max # of old items to keep' set to 0. A developer deletes a feature branch on GitHub. What happens to the corresponding Jenkins job and its build history on the next branch indexing?

  50. Question 50 of 60 Docker and Jenkins Integration: Docker inside Jenkins agents Hard

    You are implementing Docker-out-of-Docker (DooD) on a Jenkins agent by mounting /var/run/docker.sock into the Jenkins agent container. Which of the following is the most critical security risk associated with this configuration?

  51. Question 51 of 60 Docker and Jenkins Integration: Using Docker plugins Hard

    When using docker.image('maven:3-alpine').inside { ... } in a Jenkins Pipeline, how does the Docker Pipeline plugin handle the Jenkins workspace by default?

  52. Question 52 of 60 Docker and Jenkins Integration: Publishing images to Docker Hub/GHCR Hard

    A pipeline uses the docker global variable to push an image to an external registry: docker.withRegistry('https://registry.example.com', 'registry-credentials-id') { ... }. How does the Docker Pipeline plugin manage the credentials during this block?

  53. Question 53 of 60 Jenkins CI/CD Deployment Flows: Deployments to servers/clouds Hard

    In a Continuous Deployment pipeline, multiple commits might trigger concurrent builds. You want to ensure that an older build that took longer to test does not overwrite a deployment from a newer build that finished faster. Which Declarative Pipeline step/feature natively provides this concurrency control?

  54. Question 54 of 60 Jenkins CI/CD Deployment Flows: Triggering builds (pollSCM, webhook) Hard

    Jenkins is configured to trigger a build via a GitHub Webhook. If GitHub sends two push events for the exact same commit hash simultaneously, and the job is currently not running, how does the Jenkins quiet period and queue mechanism handle this?

  55. Question 55 of 60 Jenkins and Maven: Code coverage & test reports Hard

    During a Maven build stage (sh 'mvn clean test'), some tests fail, causing the step to return a non-zero exit code. You still want the pipeline to proceed to the next stage to publish JUnit test reports but ultimately mark the build as unstable/failed. Which scripted syntax correctly handles this?

  56. Question 56 of 60 Jenkins Foundations: Backup & restore Hard

    When performing a live backup of the JENKINS_HOME directory via filesystem snapshots (e.g., LVM or ZFS) while jobs are actively running, which specific subdirectory is most prone to data corruption or inconsistent states upon restoration?

  57. Question 57 of 60 Jenkins and Maven: Global tool configuration Hard

    A Jenkins Declarative Pipeline specifies tools { maven 'Maven-3.8' }. The Jenkins master has this tool configured to auto-install via Apache. However, the build runs on a Windows agent where executing shell scripts is not natively supported. How does Jenkins handle the Maven installation on the Windows agent?

  58. Question 58 of 60 Jenkins Pipelines: Pipeline Stages: Managing artifacts Hard

    You have an upstream job 'Build-Core' that archives a .jar artifact and a downstream job 'Deploy-Core' that retrieves it using the Copy Artifact plugin. To ensure end-to-end traceability of where a specific .jar version was deployed, what must be configured?

  59. Question 59 of 60 Jenkins CI/CD Deployment Flows: Jenkins agents (SSH/SFTP/Container-based) Hard

    When provisioning dynamic container-based Jenkins agents using the Kubernetes plugin, you notice the pod starts, but Jenkins immediately terminates the pod after 100 seconds with an 'Agent offline' error. The pod logs show that your custom build container completed its initial command. What is the fundamental misconfiguration?

  60. Question 60 of 60 Docker and Jenkins Integration: Jenkins and GitHub integration Hard

    To secure Jenkins from unauthorized payload spoofing via GitHub webhooks, you configure an HMAC secret in the GitHub App/Webhook settings. How does the Jenkins GitHub plugin validate this incoming payload?

That's unit 6

Answer a few questions and your score shows up here.