Explain the Jenkins pipeline (Declarative vs Scripted).
⚡
Quick Answer
A Jenkins pipeline defines the CI/CD process as code in a Jenkinsfile. Declarative pipelines use a structured, opinionated syntax that is easier to read and validate; Scripted pipelines use full Groovy for maximum flexibility.
Detailed Answer
Declarative is the recommended default: a pipeline block with stages, steps, agents, and post conditions, plus built-in constructs for parallelism, environment, and credentials. Scripted pipelines trade readability for programmability when you need complex logic. Both live in version control alongside the app (pipeline-as-code).
💡
Interview Tip
Recommend Declarative for most cases and note pipeline-as-code (the Jenkinsfile in the repo) as the key practice.
jenkinspipelineci-cd