DevOps / Github Interview questions
1. What is GitHub?
GitHub is a web-based platform for hosting Git repositories, owned by Microsoft since 2018. It started as a social code-hosting site for open source and has grown into a broader developer platform with pull requests, issue tracking, CI/CD through GitHub...
2. What is a GitHub repository?
A repository (or "repo") is the Git-backed container for a project's code, history, branches, and tags on GitHub. Every repository can additionally hold issues, pull requests, an Actions workflow configuration, and a wiki, but the repository itself is fundamentally just...
3. What is the difference between Git and GitHub?
Git is the distributed version control tool that tracks changes to files locally on a developer's machine. GitHub is a separate, hosted platform built around Git that stores repositories on the web and adds collaboration tooling like pull requests, issues,...
4. What is the difference between GitHub and GitLab?
GitHub and GitLab both host Git repositories and support code review, but they differ in scope and in how CI/CD is structured. GitHub grew as a social, open-source-centric hosting platform and added CI/CD later through the separate GitHub Actions product....
5. What are the main features of GitHub?
GitHub's feature set centers on a handful of core areas that cover most of the collaborative development workflow. Repositories - Git hosting, branches, and pull requests for code review....
6. What is a GitHub pull request?
A pull request (PR) is GitHub's mechanism for proposing that changes on one branch be reviewed and merged into another, typically a feature branch into main . It bundles the code diff, a discussion thread, CI status from any linked...
7. What is GitHub Actions?
GitHub Actions is GitHub's built-in automation and CI/CD system. It runs workflows, defined as YAML files inside a repository's .github/workflows/ directory, in response to events like a push, a pull request, a schedule, or a manual trigger....
8. What is a GitHub Actions workflow file?
A workflow file is a YAML file placed under .github/workflows/ that defines when a workflow runs, what jobs it contains, and what each job does. GitHub automatically discovers and evaluates every workflow file in that directory against incoming repository events....
9. What is a GitHub Actions runner?
A runner is the machine (virtual or physical) that actually executes a workflow's jobs: checking out code, running scripts, and reporting status back to GitHub. GitHub provides GitHub-hosted runners (Ubuntu, Windows, and macOS images spun up fresh for each job...
10. What are jobs and steps in a GitHub Actions workflow?
A job is a set of steps that run together on the same runner instance. A step is a single task within a job: either running a shell command ( run ) or invoking a reusable action ( uses )....
11. What is GitHub Issues?
GitHub Issues is the built-in tracker for bugs, feature requests, and general tasks tied to a repository. Each issue has a title, description, labels, assignees, and a discussion thread, and can be linked directly to the pull request that resolves...
12. What are GitHub Projects (boards)?
GitHub Projects is a flexible planning tool that displays issues and pull requests from one or more repositories as a board, table, or roadmap view. Unlike a plain issue list scoped to a single repo, a Project can pull items...
13. What is a GitHub organization?
A GitHub organization is a shared account used by companies and open-source projects to own repositories collectively rather than under any single person's personal account. Organizations support teams (nested groups of members), role-based permissions, and organization-wide settings like default
14. What is GitHub Packages?
GitHub Packages is a hosted package registry built into GitHub, supporting multiple ecosystems (npm, Docker/container images, Maven, NuGet, RubyGems) under a single project or organization namespace. It removes the need for a separate registry service just to publish and consume...
15. What is GitHub Pages?
GitHub Pages is free static site hosting built into every repository, commonly used for documentation, project landing pages, and portfolios. A site can be published straight from a branch (like gh-pages or the docs/ folder on main ) or built...
16. What are branch protection rules in GitHub?
Branch protection rules restrict what can happen to a specific branch (commonly main ), such as requiring pull requests before merging, requiring passing status checks, requiring a minimum number of approving reviews, and blocking force pushes or deletions. These rules...
17. What is GitHub Copilot?
GitHub Copilot is GitHub's AI coding assistant, integrated into editors like VS Code and JetBrains IDEs, that suggests code completions, whole functions, and chat-based explanations based on the surrounding code and natural-language prompts. Beyond inline suggestions, Copilot includes a chat...
18. What is forking in GitHub?
Forking creates a personal or organizational copy of someone else's repository, including its full history, under your own namespace. It's the standard way to contribute to a project without direct write access: fork it, push changes to your fork, then...
19. What are GitHub labels?
Labels are colored tags applied to issues and pull requests for categorization and filtering, such as bug , enhancement , or good first issue . Every repository comes with a small set of default labels, which can be edited, removed,...
20. What is the GitHub Wiki?
Every GitHub repository can have its own Wiki: a set of Markdown pages stored in a separate Git repository dedicated to that project's documentation. Because it's Git-backed, wiki pages have full edit history, and the wiki repository can even be...
21. What are the different GitHub plans?
GitHub offers personal account plans (Free and Pro) and organization plans (Free, Team, and Enterprise Cloud), each unlocking progressively more collaboration and governance features. Free Team Enterprise Unlimited public/private repos, basic Actions minutes.
22. What is a GitHub Gist?
A Gist is a lightweight way to share a snippet of code or text on GitHub without creating a full repository for it. Each Gist is itself a small Git repository, so it has full version history and can be...
23. What is GitHub Codespaces?
Codespaces provisions a full, cloud-hosted development environment for a repository, pre-configured with the tools, extensions, and dependencies a project needs, launched directly from the GitHub web UI or VS Code in a couple of clicks. Configuration lives in a .devcontainer/devcontainer.json...
24. What is a GitHub template repository?
A template repository is a repository marked as a template in its settings, which lets anyone create a brand-new repository pre-populated with its files and structure, without inheriting its Git commit history the way a fork does. This makes templates...
25. What are GitHub releases and tags?
A tag is a fixed pointer to a specific commit in Git, commonly used to mark version numbers like v1.2.0 . A GitHub release builds on top of a tag, adding a title, release notes, and the ability to attach...
26. Explain the execution flow of a GitHub Actions workflow from push to deployment?
When a developer pushes a commit, GitHub evaluates every workflow file under .github/workflows/ against the event, and any workflow whose on conditions match gets triggered as a new run. sequenceDiagram participant Dev as Developer participant GH as GitHub participant Runner...
27. Why would a team choose GitHub over GitLab for an open-source project?
For open-source specifically, the pull is mostly about reach and ecosystem rather than raw feature depth. GitHub hosts the largest concentration of open-source contributors, so a project there is simply more discoverable to potential contributors who already have accounts and...
28. How does a GitHub pull request differ from a GitLab merge request?
Both propose merging one branch into another with review attached, but GitHub PRs and GitLab MRs diverge in what's native versus what needs extra configuration or a third-party app. GitHub Pull Request GitLab Merge Request Required reviewers configured via branch...
29. What is the difference between GitHub.com and GitHub Enterprise Server?
GitHub.com is the fully managed, cloud-hosted SaaS product: sign up and start using it, with GitHub handling infrastructure, scaling, and uptime. GitHub Enterprise Server is a self-hosted version of GitHub that an organization installs and runs on its own infrastructure,...
30. How do you write a multi-job GitHub Actions workflow?
A multi-job workflow defines several named entries under jobs , each with its own runs-on runner and steps . Jobs run in parallel unless one declares a needs dependency on another, which forces it to wait until the referenced job...
31. When should you use repository secrets versus environment secrets in GitHub Actions?
A repository secret is available to every workflow run in that repository, regardless of which environment (if any) the job targets. That's appropriate for values that never differ by deployment target, like a shared internal API token used only for...
32. How do you troubleshoot a GitHub Actions job stuck queued?
A job stuck in a "Queued" state almost always means GitHub can't find an available runner that matches the job's requirements, rather than the workflow itself being broken. Check runner availability - for self-hosted runners, confirm at least one matching...
33. What is the difference between GitHub-hosted runners and self-hosted runners?
GitHub-hosted runners are virtual machines GitHub provisions fresh for each job and destroys afterward; self-hosted runners are machines a team registers themselves, which persist between runs. GitHub-hosted Self-hosted Zero setup; managed entirely by GitHub.
34. How does GitHub enforce required reviewers with CODEOWNERS?
A CODEOWNERS file, placed in the repository root, .github/ , or docs/ , maps file paths or patterns to specific users or teams who must review any pull request touching those paths. A line like /infra/ @platform-team means any PR...
35. Explain the internal working of GitHub Actions' merge queue?
The merge queue exists to solve a specific problem: when several pull requests are approved around the same time and merged one after another, each was only tested against the target branch as it existed before the others merged. Two...
36. What is the difference between GitHub Actions and Jenkins?
GitHub Actions is a native part of GitHub, configured through YAML workflow files that live alongside the code they build, and tightly integrated with pull requests, environments, and GitHub Packages. Jenkins is a standalone, general-purpose automation server that can integrate...
37. How do you implement GitOps with GitHub Actions and Kubernetes?
GitOps means the desired state of a system, particularly Kubernetes manifests, lives in a Git repository as the single source of truth, and something continuously reconciles the live cluster to match what's declared in Git. GitHub Actions itself is push-based,...
38. Why use GitHub's Dependabot instead of manually tracking dependency updates?
Dependabot automatically scans a repository's dependency manifests (like package.json , requirements.txt , or go.mod ) against known vulnerability databases and available new versions, then opens pull requests to bump outdated or vulnerable dependencies without a human having to notice the...
39. What is the difference between "uses" and "run" in a GitHub Actions step?
run executes shell commands directly on the runner, the same as typing them into a terminal. uses invokes a pre-packaged, reusable action, either from the GitHub Marketplace, another repository, or a local path within the same repo, referenced by an...
40. How does GitHub Actions cache dependencies between workflow runs?
The actions/cache action stores specified directories (like node_modules or a package manager's download cache) keyed by a string you define, typically incorporating the OS and a hash of the lockfile, so the cache only gets reused when the same dependency...
41. When would you choose GitHub Enterprise Cloud over GitHub Team?
Team adds the collaboration governance a growing group needs, required reviewers, Code Owners, protected branches, and a larger Actions minute allowance, on top of what Free provides. Enterprise Cloud is aimed at organizations that need identity and compliance controls a...
42. How do you configure branch protection to enforce a pull-request-only workflow?
To ensure no one can bypass review by pushing straight to a release branch, protection has to be configured on the branch itself rather than relied on as a team convention. Go to Settings > Branches and add a branch...
43. What is the difference between GitHub Actions "on: pull_request" and "on: push" triggers?
on: push triggers a workflow whenever commits are pushed to a matching branch or tag, running against exactly the code that landed. on: pull_request triggers whenever a pull request is opened, updated, or reopened, and by default runs against a...
44. Explain the lifecycle of a GitHub issue from creation to closure?
An issue moves through a fairly predictable path from being reported to being resolved, though the exact stops depend on how a team configures labels and projects. flowchart TD A[Issue created, often via a template] --> B[Triaged: labeled, assigned] B...
45. How do you optimize GitHub Actions workflow performance for a large monorepo?
In a monorepo, the biggest performance killer is running every job for every change, even when a commit only touched one small service out of dozens. Optimization mostly comes down to running less, running it in parallel, and reusing what's...
46. What is the difference between GitHub Packages and Docker Hub?
Both store and serve Docker-compatible container images, but they differ in where they sit relative to your source code and how access control is managed. GitHub Packages Docker Hub Tied to a repository or organization automatically....
47. How does GitHub Actions decide which workflow to trigger for a given event?
GitHub scans every workflow file under .github/workflows/ in the repository and evaluates each one's on block against the incoming event independently; there's no single "the workflow" concept, and multiple workflows can trigger from the same event simultaneously if their conditions...
48. Why should you use GitHub Environments to track deployments?
Without environments, a deploy job is just another workflow step whose outcome disappears into the run log. Adding an environment: key to that job turns it into something GitHub actively tracks over time: current deployment status per environment, full deployment...
49. What is the difference between repository-level and organization-level GitHub Actions secrets?
A repository-level secret is defined in a single repository's Settings > Secrets and variables > Actions and is only available to workflows running in that repository. An organization-level secret is defined once at the organization and can be made available...
50. How do you troubleshoot merge conflicts flagged in a GitHub pull request?
GitHub flags a pull request as having conflicts when the source and target branches have both changed the same lines (or GitHub can't auto-merge them cleanly) since the branch diverged. The PR page shows a "This branch has conflicts" warning...