Skip to content
$ lynuxpro

INTERVIEW PREP

Interview questions

570 questions from real DevOps, SRE, platform engineering and MLOps interviews, with the answer an interviewer wants to hear. Try answering out loud first, then open the model answer.

Showing 1–15 of 23 questions

Learn GitHub & GitHub Actions →
1.What is the difference between Git and GitHub?Beginner

Git is the tool on your computer that tracks versions of files. GitHub is a website that stores Git repositories online and adds sharing, pull requests, issues and automation.

2.What is a pull request?Beginner

A request to merge your branch into another branch, usually main. It lets teammates review the changes and lets automatic checks run before the merge.

3.What are the main parts of a GitHub Actions workflow?Beginner

An event that starts it, jobs that run on runners, and steps inside each job. A step either runs a command or uses a ready-made action.

4.Where do workflow files live?Beginner

In the .github/workflows folder of the repo, as YAML files.

5.What is a runner?Beginner

The machine that runs a job. GitHub-hosted runners are fresh virtual machines for each job. Self-hosted runners are machines you manage.

6.How do you make jobs run in order?Mid

Use needs. A job with needs waits for the listed jobs to pass. Without it, jobs run in parallel.

7.How do you pass data between jobs?Mid

Declare outputs on the producing job, write them to $GITHUB_OUTPUT in a step, and read them in the next job with needs.<job>.outputs.<name>. For files, use artifacts.

8.What is the difference between secrets and variables?Mid

Secrets hold private values, are masked in logs and cannot be read back. Variables hold ordinary settings and are visible.

9.What does branch protection do and why does it matter?Mid

It sets rules for important branches: pull requests, approvals, passing checks and no force pushes. It keeps main safe and enforces your review process.

10.How does caching speed up a workflow?Mid

Dependencies are saved under a key, usually a hash of the lock file. When the key matches, they are restored instead of downloaded again.

11.When do you use a matrix?Mid

When the same job must run with several settings, like Node versions or operating systems. It creates one job per combination, running in parallel.

12.What is the difference between artifacts and cache?Mid

A cache speeds up repeated downloads and may be evicted. Artifacts are files from a run that you pass to other jobs or keep for download.

13.Reusable workflow or composite action?Senior

A reusable workflow shares whole jobs and is called at job level. A composite action shares a few steps and is used like a single step inside a job.

14.Why use OIDC to deploy to a cloud?Senior

The job exchanges a short-lived signed token for temporary cloud credentials, so no long-lived key is stored in GitHub. A trust policy limits it to a specific repo and branch.

15.How do you secure a workflow?Senior

Set minimal permissions, pin third-party actions to a commit SHA, avoid untrusted input in run steps, use environments with approvals, prefer OIDC to stored keys, and enable Dependabot, CodeQL and secret scanning.