Written by Ashmit N. Rai • Co-Founder & DevOps Platform EngineerDevOps automation specialist and platform automation architect. Expert in CI/CD.
Interactive Flashcards
# 1
Unreviewed
What is the difference between a Declarative and a Scripted Pipeline in Jenkins?
Answer Guide
Declarative Pipeline uses a structured, opinionated syntax (defined within a "pipeline {}" block) with pre-defined sections like "agent", "stages", and "steps", making it easier to read and maintain. Scripted Pipeline uses a flexible, Groovy-based syntax (defined within "node {}" blocks) allowing arbitrary programming logic but with higher complexity.
Key Concepts Checklist
Evaluate difficulty:
# 2
Unreviewed
What are Jenkins parameters, and how do you use them in a pipeline?
Answer Guide
Parameters allow user input to be passed into a Jenkins job before execution (e.g., choice of branch, environment target, boolean flags). They are defined using the "parameters" block in Declarative syntax and accessed in stages via the "params" object (e.g., "params.BRANCH_NAME").
Key Concepts Checklist
Evaluate difficulty:
# 3
Unreviewed
What are Jenkins Shared Libraries, and why are they used?
Answer Guide
Shared Libraries are reusable Groovy scripts stored in Git repositories that Jenkins can load dynamically. They are used to modularize common pipeline steps (like Slack notifications, Docker builds, or sonar scans), keeping individual Jenkinsfiles clean and enforcing uniform company-wide compliance.
Key Concepts Checklist
Evaluate difficulty:
# 4
Unreviewed
Explain the Jenkins Master-Agent (Controller-Agent) architecture.
Answer Guide
The Jenkins Controller (Master) is responsible for serving the web GUI, handling configurations, scheduling builds, and orchestrating execution. The Jenkins Agents are lightweight helper processes running on separate servers (or containers) that receive commands from the Controller to run the actual build steps.
Key Concepts Checklist
Evaluate difficulty:
# 5
Unreviewed
How do you secure credentials (like passwords, API tokens, Docker logins) in a Jenkins Pipeline?
Answer Guide
Store credentials securely in the Jenkins Credentials Manager. Reference them in a Declarative Pipeline using the "credentials()" helper inside the "environment" block, or use the "withCredentials" block. Jenkins will automatically inject them as environment variables and mask them in the build logs.
Key Concepts Checklist
Evaluate difficulty:
# 6
Unreviewed
How do you run stages in parallel in a Jenkins Declarative Pipeline?
Answer Guide
Use the "parallel" block inside a stage. This block contains nested stages that run concurrently on different agent executors, reducing overall pipeline build time (e.g., running unit tests, linting, and security scans simultaneously).
Key Concepts Checklist
Evaluate difficulty:
# 7
Unreviewed
What is the "Poll SCM" feature in Jenkins, and how does it compare to Webhooks?
Answer Guide
Poll SCM is a pull-based mechanism where Jenkins queries the Git repository at scheduled cron intervals to check for new commits. Webhooks are push-based mechanisms where the Git hosting provider (e.g. GitHub) sends an immediate HTTP POST request to Jenkins upon push events, initiating builds instantly and reducing load.
Key Concepts Checklist
Evaluate difficulty:
# 8
Unreviewed
What steps should you take if a deployment stage fails in a pipeline?
Answer Guide
1. Examine the Console Output of the failed build to find the exact error message. 2. Verify target environment connectivity, API endpoints, and credential validity. 3. Check application logs on the target server/container. 4. Trigger automatic rollbacks or post-actions (like Slack alerts) using "post { failure {} }" hooks.
Key Concepts Checklist
Evaluate difficulty:
# 9
Unreviewed
How do you configure a distributed agent cluster in Jenkins using Docker or Kubernetes?
Answer Guide
Install the Kubernetes plugin in Jenkins. Configure a cloud provider endpoint pointing to the Kubernetes API. Define agent pod templates specifying container images (e.g., Maven, Go, Node). When a job is triggered, Jenkins dynamically provisions a pod agent, executes the build, and terminates the pod.
Key Concepts Checklist
Evaluate difficulty:
# 10
Unreviewed
How do you migrate Jenkins from one server to another?
Answer Guide
Since Jenkins stores configurations, jobs, and build history as XML files on disk under "$JENKINS_HOME", you can: 1. Stop Jenkins on both servers. 2. Tar the "$JENKINS_HOME" directory (excluding heavy work directories like "workspace"). 3. Copy the archive to the new server. 4. Extract it to the new home path, fix file permissions, and start the new Jenkins instance.
Key Concepts Checklist
Evaluate difficulty:
# 11
Unreviewed
How do you deploy a .NET application using a CI/CD pipeline?
Answer Guide
Restore dependencies ("dotnet restore"), compile the code ("dotnet build --configuration Release"), run unit tests ("dotnet test"), publish the app ("dotnet publish -c Release -o ./publish"), build a Docker image containing the published files, and push/deploy it to target environments (like IIS, ECS, or Kubernetes).
Key Concepts Checklist
Evaluate difficulty:
# 12
Unreviewed
If you launched the Jenkins service on a server, but it is not accessible in the browser, what might be the issues?
Answer Guide
1. Jenkins service is not running ("systemctl status jenkins"). 2. Jenkins is listening on a different port, or port is blocked by firewall ("ufw" or "iptables"). 3. Security Group in AWS doesn't allow inbound traffic on port 8080. 4. Reverse proxy (Nginx/Apache) is misconfigured or down.
Key Concepts Checklist
Evaluate difficulty:
Scenario Challenges
Select a scenario below to test your troubleshooting workflow.
Topic: Registry Authentication
A build stage fails to push a newly built image to Docker Hub with an unauthorized message. Order the actions to fix the authentication issue.
Confirm target registry URL and credentials in the Jenkins Credential Store.Click to select
Wrap the Docker build/push stages in the "withCredentials" or "withRegistry" blocks in the Jenkinsfile.Click to select
Execute the pipeline to verify that the image pushes successfully and credentials are masked in logs.Click to select
Selected Sequence
No steps selected yet. Click options above in sequence.
Topic: Agent Node Offline
A critical release is queued because the build agent node has disconnected. Recover the node and start the pipeline.
Check the node status page in Jenkins UI and read the agent launch log.Click to select
Log into the agent server, check the JVM status, and launch the JNLP/SSH agent jar process.Click to select
Verify firewalls on JNLP port 50000 to ensure connectivity is restored and state shows active.Click to select
Selected Sequence
No steps selected yet. Click options above in sequence.
Topic: Shared Library Migration
Refactor duplicate build steps across 20 pipelines into a global shared library. Place the workflow in order.
Create a Git repository containing the Groovy script variables under the vars/ directory.Click to select
Configure Global Pipeline Libraries in Jenkins System settings with Git checkout options.Click to select
Annotate individual Jenkinsfiles with the @Library annotation and invoke the new shared method.Click to select
Selected Sequence
No steps selected yet. Click options above in sequence.
Topic: Automated GitHub Webhook
Set up push-based pipeline execution using GitHub webhooks instead of constant Poll SCM triggers.
Enable the GitHub Integration plugin in Jenkins and register credentials.Click to select
Create a Webhook in the GitHub repository settings pointing to Jenkins' /github-webhook/ endpoint.Click to select
Check the option "GitHub hook trigger for GITScm polling" in the Jenkins job settings.Click to select
Selected Sequence
No steps selected yet. Click options above in sequence.
Topic: .NET App Pipeline Orchestration
Create a pipeline for a .NET application. Order the stages from compilation to containerized deployment.
Execute dotnet restore, dotnet build, and dotnet test in the build phase.Click to select
Execute dotnet publish and run docker build to package the application binaries.Click to select
Deploy the Docker image to the target Kubernetes namespace via kubectl apply.Click to select
Selected Sequence
No steps selected yet. Click options above in sequence.
We value your privacy
We use cookies to analyze site traffic, personalize content, and support our free educational platforms. By clicking "Accept All", you consent to our use of cookies.