0
0
Jenkinsdevops~20 mins

CI/CD tools landscape in Jenkins - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Jenkins CI/CD Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Jenkins Pipeline Stages

Which of the following best describes the purpose of the stage directive in a Jenkins Pipeline?

AIt sets environment variables for the entire pipeline.
BIt specifies the machine where the pipeline will run.
CIt defines a distinct phase in the pipeline to organize tasks and visualize progress.
DIt triggers the pipeline to start automatically on code commit.
Attempts:
2 left
💡 Hint

Think about how Jenkins shows progress in the pipeline view.

💻 Command Output
intermediate
2:00remaining
Jenkins CLI Command Output

What is the output of the following Jenkins CLI command if the Jenkins server is running and the job build-app exists?

java -jar jenkins-cli.jar -s http://localhost:8080/ list-jobs
A
build-app
deploy-app
test-app
BError: Job 'build-app' not found
CNo jobs found
DSyntax error: missing argument
Attempts:
2 left
💡 Hint

This command lists all jobs on the Jenkins server.

🔀 Workflow
advanced
2:00remaining
Jenkins Pipeline Script Execution Order

Given this Jenkins Pipeline snippet, what is the order of printed output?

pipeline {
  agent any
  stages {
    stage('Build') {
      steps {
        echo 'Building...'
      }
    }
    stage('Test') {
      steps {
        echo 'Testing...'
      }
    }
    stage('Deploy') {
      steps {
        echo 'Deploying...'
      }
    }
  }
}
A
Testing...
Building...
Deploying...
B
Building...
Testing...
Deploying...
C
Deploying...
Testing...
Building...
D
Building...
Deploying...
Testing...
Attempts:
2 left
💡 Hint

Stages run in the order they are defined.

Troubleshoot
advanced
2:00remaining
Diagnosing Jenkins Job Failure

A Jenkins freestyle job fails with the error: hudson.AbortException: script returned exit code 1. What is the most likely cause?

AThe shell script or command run by the job returned a non-zero exit code indicating failure.
BThe Jenkins user does not have permission to view the job.
CThe job configuration is missing the build steps section.
DThe Jenkins server is down and cannot execute the job.
Attempts:
2 left
💡 Hint

Exit code 1 usually means a command failed.

Best Practice
expert
3:00remaining
Securing Jenkins Credentials

Which Jenkins feature is the best practice to securely store and use sensitive information like passwords or API tokens in pipelines?

AStore secrets in plain text files on the Jenkins master server.
BHardcode passwords directly in the Jenkinsfile for easy access.
CSend secrets as pipeline parameters without encryption.
DUse Jenkins Credentials Plugin to store secrets and access them via credentials binding in pipelines.
Attempts:
2 left
💡 Hint

Think about how to keep secrets safe and not expose them in logs or code.