Search test library by skills or roles
⌘ K

Adaface Sample Jenkins Questions

Here are some sample Jenkins questions from our premium questions library (10273 non-googleable questions).

Skills

🧐 Question

Medium

Conditional Stage Execution
Conditional Stages
Jenkinsfile
Build Optimization
Solve
You are given a Jenkinsfile for a pipeline that builds, tests, and deploys an application. The pipeline has multiple stages, and you need to optimize it by ensuring certain stages are executed only under specific conditions. The current Jenkinsfile looks like this:
 image
Your task is to modify the Jenkinsfile so that:
            
            1. The 'Test' stage is executed only if the 'Build' stage is successful.
            2. The 'Deploy' stage is executed only for builds triggered by commits to the 'master' branch.
            3. All stages should always run for scheduled nightly builds regardless of the branch.
            
            Which of the following modifications to the Jenkinsfile will meet these requirements?
 image

Medium

Multibranch Pipeline Strategy
Pipelines
Build Strategies
Solve
A Jenkins multibranch pipeline is configured to build projects from a version control system (VCS) with multiple branches. The pipeline is set up with specific build strategies to optimize resource usage and build times. The Jenkins administrator needs to ensure that the pipeline:
            
            1. Automatically triggers builds for the 'master' and 'develop' branches upon new commits.
            2. Does not automatically build feature branches but allows manual builds.
            3. Automatically builds a branch if it has a pull request open with the 'master' branch.
            
            Which combination of build strategies and configurations should the Jenkins administrator use?
A: Enable SCM polling, add a regular expression to include 'master' and 'develop', and use the Pull Request build strategy.
            B: Use the Discover Branches strategy with filters for 'master' and 'develop', and the Pull Request build strategy with a target branch filter for 'master'.
            C: Enable SCM polling with a cron expression, use a script to exclude feature branches, and add a webhook for pull request events.
            D: Use the Discover Branches strategy, add a regular expression to exclude feature branches, and enable webhooks for pull request events.
            E: Enable SCM polling for all branches, use the Discover Tags strategy, and add a post-receive hook in VCS for 'master' and 'develop'.
            F: Use the Discover Branches strategy for all branches, add a property to manually trigger builds for feature branches, and use the Pull Request build strategy.

Easy

Script in Jenkinsfile
Python Scripting
Jenkinsfile
Solve
Consider a Jenkins Pipeline which includes a Jenkinsfile with an embedded Python script. The pipeline is designed for a multi-stage build process. The Python script is responsible for performing certain operations based on the current Jenkins build status. Analyze the following Jenkinsfile pseudo-code snippet:
 image
The pipeline sets an environment variable `BUILD_STATUS` which can have values 'SUCCESS', 'FAILURE', or 'UNSTABLE'. What will be the output and the exit status of the Python script when `BUILD_STATUS` is set to 'UNSTABLE'?
🧐 Question🔧 Skill

Medium

Conditional Stage Execution
Conditional Stages
Jenkinsfile
Build Optimization

3 mins

Jenkins
Solve

Medium

Multibranch Pipeline Strategy
Pipelines
Build Strategies

2 mins

Jenkins
Solve

Easy

Script in Jenkinsfile
Python Scripting
Jenkinsfile

2 mins

Jenkins
Solve
🧐 Question🔧 Skill💪 Difficulty⌛ Time
Conditional Stage Execution
Conditional Stages
Jenkinsfile
Build Optimization
Jenkins
Medium3 mins
Solve
Multibranch Pipeline Strategy
Pipelines
Build Strategies
Jenkins
Medium2 mins
Solve
Script in Jenkinsfile
Python Scripting
Jenkinsfile
Jenkins
Easy2 mins
Solve

Trusted by recruitment teams in enterprises globally

Amazon Morgan Stanley Vodafone United Nations HCL PayPal Bosch WeWork Optimum Solutions Deloitte Microsoft NCS Doubtnut Sokrati J&T Express Capegemini

We evaluated several of their competitors and found Adaface to be the most compelling. Great library of questions that are designed to test for fit rather than memorization of algorithms.


Swayam Narain, CTO, Affable

hashtag image heart icon Swayam
customers across world
Join 1500+ companies in 80+ countries.
Try the most candidate friendly skills assessment tool today.
g2 badges
Ready to streamline your recruitment efforts with Adaface?
Ready to streamline your recruitment efforts with Adaface?
logo
40 min tests.
No trick questions.
Accurate shortlisting.
ada
Ada
● Online
Previous
Score: NA
Next
✖️