💼 Jenkins Interview Questions
Jenkins Interview Questions: 🎬 Interview Classic: How a Build Moves from the Queue to an Executor Build Stuck in Queue A common interview question: "My build is NOT STARTING in
🎬 Interview Classic: How a Build Moves from the Queue to an Executor
Build Stuck in Queue
A common interview question: "My build is NOT STARTING in the Jenkins UI, why?" The answer isn't in pipeline syntax — it's in this lifecycle.
Step 1 — a webhook or manual trigger PLACES the build request into the Jenkins Build Queue; at this point it is only "waiting," not yet "running."
Step 2 — Jenkins looks for a FREE executor/agent that matches the required label (e.g. `docker`, `linux`).
Step 3 — once a matching executor is found, it allocates its own Workspace directory and checks out the source code there.
Step 4 — the pipeline stages run INSIDE this Workspace; every `sh`/`pytest`/`npm` command is positioned relative to this directory.
Step 5 — as the pipeline finishes, `post {}` (always/success/failure) runs, artifacts are archived; THEN the executor is released and moves to the next queued build.
Final (the contrast / the interview answer) — if ALL executors are busy, the new build gets STUCK IN THE QUEUE: this is not a pipeline bug, it's an agent/executor CAPACITY issue. That is precisely the correct interview answer.
Common Interview Question: Why Is My Build Waiting in the Queue
Request enters the queue
A webhook or manual trigger places the build request in the Build Queue; no executor has been assigned yet.
A matching executor is searched
Jenkins looks for a free agent/executor that matches the required label (docker, linux, etc.).