# GitLab interview prep

## Can a faster pipeline still deploy the right commit?

Original Opend practice case · Updated 2026-11-30

[Cite this case](https://opend.in/prep/gitlab#pipeline-dependencies)

A monorepo builds an API in four minutes and a UI in ten. API tests take six minutes and UI tests take two. Both test suites currently wait for the entire build stage. Design the fastest safe deployment assuming two available runners.

**Short answer** — Schedule each test as soon as its own build succeeds. Deploy after both required test jobs pass, then serialize access to the target environment across pipelines.

### Independent branches meet at the release gate

- **API branch** — Build from minute 0 to 4. Test from minute 4 to 10.

- **UI branch** — Build from minute 0 to 10. Test from minute 10 to 12.

- **Release gate** — Both branches are green at minute 12. Deploy the tested artifact for that commit.

### Compute the critical path before adding runners

With a stage barrier, both builds finish at minute ten. The longest test then takes another six minutes. With explicit dependencies, the longest path instead takes twelve minutes. The API test occupies the runner freed by the API build. The UI build keeps its original runner. GitLab supports expressing these dependencies with needs. The timing calculation assumes no queue delay and excludes deployment time.

[GitLab job dependencies with needs](https://docs.gitlab.com/ci/yaml/needs/)

### Carry artifact identity through the graph

Tests should consume the artifact produced by their declared upstream commit. A shared mutable tag such as latest can point at a newer build by the time a test starts. Pass the digest or immutable artifact reference downstream. When an upstream test fails, block deployment and keep the failed run inspectable. A retry can rerun the failed test against the same artifact without rebuilding everything.

### Handle two pipelines finishing out of order

Suppose commit B finishes while older commit A waits for a flaky test. A resource group serializes deployment to one environment. Mutual exclusion alone still permits A to deploy after B. Pick an ordering policy and add an environment check that rejects an obsolete candidate, while leaving an explicit rollback path. GitLab documents different resource-group processing modes and their requirements.

[GitLab resource groups and process modes](https://docs.gitlab.com/ci/resource_groups/)

### Earliest safe release, in minutes

| Schedule | API tests finish | Both branches ready |
| --- | --- | --- |
| Build-stage barrier · 2 runners | 16 | 16 |
| Dependency graph · 2 runners | 10 | 12 |
| Same work · 1 runner | Order dependent | 22 |

### Should the deployment run at minute ten if the API tests have already passed?

Only if the deployable unit is genuinely independent of the UI and has its own release contract. In this exercise one release contains both artifacts. Removing the dependency saves time by changing what green means. Splitting releases requires a compatibility strategy and a way to roll each part back.

GitLab's candidate handbook lists screening, role-dependent assessments or technical interviews, team interviews, references and offer/background steps. Your recruiter confirms which stages apply.

## Screening & role alignment

Prepare your motivation, relevant experience and questions about the team.

## Technical assessment, where required

Practice coding, code review and explaining tradeoffs. The format depends on the role.

## Team interviews

Use concrete examples of collaboration, engineering judgment and communicating decisions asynchronously.

## Practice questions

These are Opend practice prompts, not verified interview questions.

### How would you review a change that adds a background job?

- Check idempotency, retry behavior, authorization and failure observability.
- Ask whether the job can run twice or run after its source record changes.
- Separate correctness blockers from style suggestions; propose a focused test.

### How would you schedule a CI pipeline with dependencies?

- Represent jobs as a directed graph and detect cycles.
- Track dependency completion, bounded concurrency and failed or cancelled ancestors.
- Explain how restarts avoid rerunning completed external side effects.

### How do you explain a technical disagreement asynchronously?

- Write the shared problem, evidence and tradeoffs before recommending an option.
- Record the decision and what new evidence would change it.
- Use a real example and describe how you kept the work moving.

[Live roles](https://opend.in/jobs?company=GitLab)

## Sources

- [GitLab: candidate handbook](https://handbook.gitlab.com/handbook/hiring/candidate-faq/)
