0
0
Jenkinsdevops~20 mins

GitLab CI comparison in Jenkins - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
GitLab CI Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Key difference between GitLab CI and Jenkins pipelines

Which statement best describes a key difference between GitLab CI and Jenkins pipelines?

AJenkins pipelines cannot be version controlled, but GitLab CI pipelines are stored in a database only.
BGitLab CI requires a separate server installation, while Jenkins is fully cloud-based with no server setup.
CGitLab CI uses a YAML file stored in the repository to define pipelines, while Jenkins uses a separate Jenkinsfile or UI configuration.
DJenkins pipelines are only triggered manually, whereas GitLab CI pipelines run only on schedule.
Attempts:
2 left
💡 Hint

Think about where the pipeline configuration files live and how they are managed.

💻 Command Output
intermediate
2:00remaining
Output of Jenkins pipeline stage status

Given this Jenkins pipeline snippet, what will be the output status of the Build stage if the sh command fails?

Jenkins
pipeline {
  agent any
  stages {
    stage('Build') {
      steps {
        sh 'exit 1'
      }
    }
  }
}
AThe Build stage will be marked as FAILED and the pipeline will stop.
BThe Build stage will be marked as SUCCESS despite the failure.
CThe Build stage will be marked as UNSTABLE and pipeline continues.
DThe pipeline will ignore the failure and mark the Build stage as SKIPPED.
Attempts:
2 left
💡 Hint

Consider how Jenkins treats shell command exit codes in pipeline steps.

🔀 Workflow
advanced
2:00remaining
Order of GitLab CI pipeline stages execution

What is the correct order of execution for the following GitLab CI stages defined in .gitlab-ci.yml?

A2,1,3,4
B1,2,3,4
C2,3,1,4
D3,2,1,4
Attempts:
2 left
💡 Hint

Remember the typical order of stages in CI/CD pipelines.

Troubleshoot
advanced
2:00remaining
Why does Jenkins pipeline fail to trigger on Git push?

A Jenkins pipeline is not triggering automatically when code is pushed to the Git repository. What is the most likely cause?

AThe Jenkins agent is offline but triggers still run pipelines.
BThe Jenkinsfile syntax is invalid causing the pipeline to skip triggers.
CThe Git repository is private and Jenkins cannot clone it manually.
DThe Jenkins webhook is not configured or not reachable by the Git server.
Attempts:
2 left
💡 Hint

Think about how Jenkins knows when to start a pipeline on Git events.

Best Practice
expert
2:00remaining
Best practice for secret management in GitLab CI vs Jenkins

Which approach is considered best practice for managing secrets securely in GitLab CI compared to Jenkins?

AUse environment variables set manually on build agents without any encryption or masking.
BUse GitLab CI's built-in masked variables and Jenkins credentials plugin to avoid storing secrets in code.
CCommit encrypted secrets files to the repository and decrypt during pipeline execution without external tools.
DStore secrets directly in the pipeline YAML or Jenkinsfile for easy access during builds.
Attempts:
2 left
💡 Hint

Consider how each tool supports secret masking and secure storage.