Jenkins Beginner Quiz
30 questions on Jenkins Pipeline.
Question 1: What is Jenkins mainly used for?
- A. Video editing
- B. Continuous Integration and Deployment (CI/CD) β (correct answer)
- C. Graphic design
- D. Database hosting
Explanation: Jenkins is an open-source automation server widely used for CI/CD workflows, allowing developers to build, test, and deploy software automatically.
Question 2: What language is Jenkins primarily written in?
- A. Python
- B. C++
- C. Java β (correct answer)
- D. Ruby
Explanation: Jenkins is a Java-based application, meaning it requires a Java Runtime Environment (JRE) to run on any server.
Question 3: What is a Jenkins "Job"?
- A. An employee working on the server
- B. A specific, user-defined process or task to be executed by Jenkins (e.g., compiling code) β (correct answer)
- C. A database query
- D. A server restart command
Explanation: Jobs (also called projects) are the fundamental building blocks of Jenkins. You configure a Job to tell Jenkins exactly what to do.
Question 4: What is a "Freestyle Project" in Jenkins?
- A. A project with no rules
- B. The most basic and highly configurable type of Jenkins Job, configured entirely through the web UI β (correct answer)
- C. A project that writes code for you
- D. A free tier of Jenkins
Explanation: Freestyle projects are great for simple tasks, allowing you to add build steps and post-build actions using dropdown menus and text boxes.
Question 5: What is a "Pipeline" in Jenkins?
- A. A physical cable connecting servers
- B. A suite of plugins that supports implementing and integrating continuous delivery pipelines into Jenkins using code β (correct answer)
- C. A database connection
- D. A tool to download updates
Explanation: Unlike Freestyle Jobs, Pipelines allow you to define your entire build process as code (Pipeline-as-Code).
Question 6: What is the name of the file where a Jenkins Pipeline is defined as code?
- A.
pipeline.xml
- B.
build.json
- C.
Jenkinsfile β (correct answer)
- D.
config.yml
Explanation: A Jenkinsfile is a text file committed to your Git repository that contains the definition of your Jenkins Pipeline.
Question 7: What are the two syntaxes available for writing a Jenkinsfile?
- A. HTML and CSS
- B. Declarative and Scripted β (correct answer)
- C. Python and Bash
- D. YAML and JSON
Explanation: Declarative Pipeline is a newer, simpler, and more structured syntax, while Scripted Pipeline is an older, more complex Groovy-based syntax.
Question 8: In a Declarative Pipeline, what does the agent block define?
- A. The secret agent password
- B. Where the entire Pipeline, or a specific stage, will execute in the Jenkins environment (e.g., on which server) β (correct answer)
- C. The user who started the build
- D. The email server
Explanation: agent any tells Jenkins to execute the pipeline on any available executor. agent { label 'linux' } restricts it to a Linux machine.
Question 9: What is a Jenkins "Stage"?
- A. A visual theme for the dashboard
- B. A conceptually distinct subset of tasks executed through the Pipeline (e.g., "Build", "Test", "Deploy") β (correct answer)
- C. The server room
- D. A user role
Explanation: Stages help visualize the pipeline's progress in the Jenkins UI. If the "Test" stage fails, the pipeline stops.
Question 10: What is a Jenkins "Step"?
- A. A stairway in the code
- B. A single task that tells Jenkins exactly what to do at a particular point in time (e.g., executing a shell command) β (correct answer)
- C. A version upgrade
- D. A plugin
Explanation: Steps are the smallest building blocks of a pipeline. Multiple steps make up a stage. Example step: sh 'npm install'.
Question 11: How does Jenkins integrate with Git/GitHub?
- A. It cannot integrate with Git
- B. Via plugins that allow Jenkins to poll repositories, trigger builds on code push, and pull down source code β (correct answer)
- C. By replacing Git entirely
- D. By sending emails to GitHub
Explanation: The Git Plugin allows Jenkins to check out code from repositories to build and test it.
Question 12: What is a Jenkins "Plugin"?
- A. A power cord
- B. An extension module that enhances the functionality of Jenkins, providing integration with other tools (like Docker, AWS, or Slack) β (correct answer)
- C. A piece of hardware
- D. A virus
Explanation: Jenkins' massive ecosystem of over 1,800 community-contributed plugins is the primary reason for its immense popularity.
Question 13: What does the "Build Triggers" section of a Jenkins job do?
- A. Deletes the job
- B. Defines the conditions under which the automated build should start (e.g., periodically, or after a Git push) β (correct answer)
- C. Triggers a database backup
- D. Shuts down Jenkins
Explanation: Common triggers include "Poll SCM" (checking Git every X minutes) or Webhooks (GitHub telling Jenkins a push happened).
Question 14: What is a Webhook in the context of Jenkins and GitHub?
- A. A hacking tool
- B. An HTTP POST message sent by GitHub to Jenkins immediately when an event (like a code push) occurs, triggering a build instantly β (correct answer)
- C. A physical network cable
- D. A type of database
Explanation: Webhooks are far more efficient than Jenkins constantly asking GitHub "Are there new changes?" (Polling).
Question 15: What is the difference between a Jenkins Master (Controller) and a Jenkins Node (Agent)?
- A. They are the same thing
- B. The Controller schedules jobs and manages the UI; Agents are the actual machines that do the heavy lifting of executing the builds β (correct answer)
- C. Controller is for Windows, Agent is for Linux
- D. Controller is free, Agent is paid
Explanation: In a distributed architecture, you never run heavy builds on the Controller to prevent the Jenkins UI from crashing.
Question 16: What does the post section do in a Declarative Pipeline?
- A. It posts a tweet to Twitter
- B. It defines additional steps to run at the end of the Pipeline or Stage, depending on the outcome (e.g., success, failure, always) β (correct answer)
- C. It pauses the build
- D. It restarts the server
Explanation: The post block is typically used to send Slack notifications or clean up temporary files after a build finishes.
Question 17: What happens if you define agent none at the top of a Declarative Pipeline?
- A. The pipeline crashes
- B. The pipeline runs on the Controller
- C. You must define a specific
agent inside every individual stage block β (correct answer)
- D. Jenkins skips the build
Explanation: This is useful when Stage 1 needs to run on a Linux agent (to build a web app) and Stage 2 needs to run on a macOS agent (to build an iOS app).
Question 18: What does the Jenkins "Blue Ocean" plugin do?
- A. Changes the UI color to blue
- B. Provides a modern, highly visual, and intuitive user interface specifically designed for Jenkins Pipelines β (correct answer)
- C. Connects Jenkins to underwater servers
- D. Deletes old pipelines
Explanation: Blue Ocean replaces the classic, somewhat outdated Jenkins UI with a beautiful, graphical representation of pipeline stages.
Question 19: In Jenkins, what are "Artifacts"?
- A. Old configuration files
- B. The resulting files produced by a build (e.g., compiled
.jar files or .zip archives) that are saved for deployment or downloading β (correct answer)
- C. Plugins that are no longer supported
- D. The Jenkins logo
Explanation: Using the "Archive the artifacts" post-build action ensures that the compiled software is safely stored on the Jenkins server after the workspace is cleaned.
Question 20: What is the purpose of the Jenkins "Credentials" system?
- A. To print ID badges for employees
- B. To securely store sensitive data like SSH keys, API tokens, and passwords so they don't have to be hardcoded in scripts β (correct answer)
- C. To verify the Jenkins license
- D. To encrypt the database
Explanation: You can securely inject these credentials into a Pipeline as environment variables to deploy code without exposing passwords.
Question 21: What is a "Multibranch Pipeline" in Jenkins?
- A. A pipeline that builds itself multiple times
- B. A project type that automatically discovers branches in your Git repository, creating a separate Jenkins Pipeline for each branch that contains a
Jenkinsfile β (correct answer)
- C. A pipeline that deploys to multiple clouds
- D. A pipeline managed by multiple people
Explanation: This is essential for modern workflows. It automatically tests feature-A and feature-B independently without manual configuration.
Question 22: What does the cron syntax H/15 * * * * mean in Jenkins "Build Periodically"?
- A. Build every 15 days
- B. Build every 15 hours
- C. Build approximately every 15 minutes β (correct answer)
- D. Build at 15:00 (3 PM) daily
Explanation: The H stands for Hash. It prevents 50 different Jenkins jobs from all trying to start at exactly 00:00:00, spreading the load out.
Question 23: What is the purpose of the Jenkins workspace?
- A. A chat room for developers
- B. A temporary directory on the node where Jenkins checks out the source code and executes the build steps β (correct answer)
- C. The cloud storage
- D. The memory (RAM) of the server
Explanation: Every job has its own workspace. It is best practice to clean the workspace before or after a build to prevent old files from corrupting new builds.
Question 24: How do you pause a Jenkins pipeline and wait for a human to click "Approve" before continuing to the deployment stage?
- A.
sleep 1000
- B. Use the
input step in the pipeline β (correct answer)
- C. Turn off the server
- D. Use
wait()
Explanation: The input step pauses the pipeline indefinitely until an authorized user clicks "Proceed" or "Abort" in the Jenkins UI.
Question 25: What does the parallel block do in a Declarative Pipeline?
- A. Copies the code to two servers
- B. Allows multiple stages to execute simultaneously, drastically reducing the total build time β (correct answer)
- C. Runs the same stage twice
- D. Connects two Jenkins servers together
Explanation: If you need to run tests on Windows, Mac, and Linux, you can put those stages inside a parallel block to run them all at the exact same time.
Question 26: What is the underlying scripting language used in Scripted Pipelines and Declarative Pipeline configuration?
- A. Python
- B. JavaScript
- C. Groovy β (correct answer)
- D. Ruby
Explanation: Groovy is an agile, dynamic language for the Java Virtual Machine. While Declarative syntax hides most of it, advanced scripting in Jenkins requires Groovy knowledge.
Question 27: What is Jenkins Configuration as Code (JCasC)?
- A. Writing CSS for Jenkins
- B. A plugin that allows you to configure the entire Jenkins master (plugins, security, credentials) using a human-readable YAML file β (correct answer)
- C. Configuring Jenkins using a mouse
- D. A database backup tool
Explanation: JCasC treats your Jenkins infrastructure like software. You can spin up a fully configured Jenkins server instantly from a Git repo.
Question 28: What is the "Script Approval" feature in Jenkins?
- A. A feature that requires developers to sign a document
- B. A security mechanism that prevents unauthorized Groovy scripts from executing outside the Jenkins sandbox without an administrator's manual approval β (correct answer)
- C. A spell checker for scripts
- D. A plugin to buy scripts
Explanation: Groovy scripts have the power to access the server's hard drive. Script Approval prevents malicious code in a Jenkinsfile from compromising the server.
Question 29: In a Jenkinsfile, what does the environment directive do?
- A. Tells Jenkins to run in the cloud
- B. Specifies a sequence of key-value pairs representing environment variables that will be available to all steps in the pipeline or stage β (correct answer)
- C. Sets the server room temperature
- D. Checks the operating system
Explanation: Defining environment { DB_PORT = '3306' } allows you to use $DB_PORT in your shell scripts later in the pipeline.
Question 30: What is the primary advantage of running Jenkins Agents as Docker containers rather than static VMs?
- A. Docker is owned by Jenkins
- B. Containers spin up instantly, provide a clean isolated environment for every build, and are destroyed immediately after, eliminating "it works on my machine" issues β (correct answer)
- C. Containers are slower but safer
- D. Containers do not require the internet
Explanation: Using the Docker Pipeline plugin, Jenkins can dynamically provision a Node.js container, run the build, and destroy it, keeping the Jenkins infrastructure incredibly clean.