Prev Next

DevOps / Github Interview questions

1. What is GitHub? 2. What is a GitHub repository? 3. What is the difference between Git and GitHub? 4. What is the difference between GitHub and GitLab? 5. What are the main features of GitHub? 6. What is a GitHub pull request? 7. What is GitHub Actions? 8. What is a GitHub Actions workflow file? 9. What is a GitHub Actions runner? 10. What are jobs and steps in a GitHub Actions workflow? 11. What is GitHub Issues? 12. What are GitHub Projects (boards)? 13. What is a GitHub organization? 14. What is GitHub Packages? 15. What is GitHub Pages? 16. What are branch protection rules in GitHub? 17. What is GitHub Copilot? 18. What is forking in GitHub? 19. What are GitHub labels? 20. What is the GitHub Wiki? 21. What are the different GitHub plans? 22. What is a GitHub Gist? 23. What is GitHub Codespaces? 24. What is a GitHub template repository? 25. What are GitHub releases and tags? 26. Explain the execution flow of a GitHub Actions workflow from push to deployment? 27. Why would a team choose GitHub over GitLab for an open-source project? 28. How does a GitHub pull request differ from a GitLab merge request? 29. What is the difference between GitHub.com and GitHub Enterprise Server? 30. How do you write a multi-job GitHub Actions workflow? 31. When should you use repository secrets versus environment secrets in GitHub Actions? 32. How do you troubleshoot a GitHub Actions job stuck queued? 33. What is the difference between GitHub-hosted runners and self-hosted runners? 34. How does GitHub enforce required reviewers with CODEOWNERS? 35. Explain the internal working of GitHub Actions' merge queue? 36. What is the difference between GitHub Actions and Jenkins? 37. How do you implement GitOps with GitHub Actions and Kubernetes? 38. Why use GitHub's Dependabot instead of manually tracking dependency updates? 39. What is the difference between "uses" and "run" in a GitHub Actions step? 40. How does GitHub Actions cache dependencies between workflow runs? 41. When would you choose GitHub Enterprise Cloud over GitHub Team? 42. How do you configure branch protection to enforce a pull-request-only workflow? 43. What is the difference between GitHub Actions "on: pull_request" and "on: push" triggers? 44. Explain the lifecycle of a GitHub issue from creation to closure? 45. How do you optimize GitHub Actions workflow performance for a large monorepo? 46. What is the difference between GitHub Packages and Docker Hub? 47. How does GitHub Actions decide which workflow to trigger for a given event? 48. Why should you use GitHub Environments to track deployments? 49. What is the difference between repository-level and organization-level GitHub Actions secrets? 50. How do you troubleshoot merge conflicts flagged in a GitHub pull request?

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 Actions, and package hosting. A repository ...

Read full answer

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 a hosted Git remote. Repos...

Read full answer

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, and Actions. Git GitHub A command-line v...

Read full answer

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. GitLab was built from the outset as a sin...

Read full answer

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. GitHub Actions - CI/CD workflows defined in YAML, triggered by repository events. Issues and Projects - light...

Read full answer

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 Actions workflow, and review approvals into a single page. Review...

Read full answer

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. A workflow is made up of one or more jobs, each running...

Read full answer

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. name: CI on: push: branches: [ ma...

Read full answer

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 and torn down after), and teams can ...

Read full answer

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 ). Job Step Runs on its own runner instance. Runs sequentially inside a job's runner. Multiple jobs run in paral...

Read full answer

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 it. Issues support Markdown formatting, task-list...

Read full answer

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 from multiple repositories into one shared view, which suits organizatio...

Read full answer

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...

Read full answer

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 internal packages...

Read full answer

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 via a GitHub Actions workflow for static site generato...

Read full answer

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 apply regardless of a user'...

Read full answer

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 inte...

Read full answer

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 open a pull request back to the original (up...

Read full answer

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, or extended with custom ones. Labels power filtering in the issu...

Read full answer

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 cloned and edited locally like any other Git repo. ...

Read full answer

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. Adds required reviewers, Code Owners,...

Read full answer

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 cloned like any other repo, just scoped to holding a handful of files instead of an entire proj...

Read full answer

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 fil...

Read full answer

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 the right tool for starting new projects from...

Read full answer

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 compiled binaries or other downloadable files to that specific version. Releases give a clean...

Read full answer

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 as Actions Runner par...

Read full answer

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 workflows built arou...

Read full answer

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 protection settings. Approval rul...

Read full answer

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, typically for compliance,...

Read full answer

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 succeeds. name: Build, Test, Deploy on: push: branches: [ main ] jo...

Read full answer

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 build-time steps. An environment secret is scop...

Read full answer

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 runner is online in Settings > Actions > ...

Read full answer

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. Requires installing and maintaining t...

Read full answer

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 modifying files under /infra/ automatically requests review from th...

Read full answer

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 individually-passing PRs can still break the target branch once...

Read full answer

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 with any Git host,...

Read full answer

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, so a pure GitOps setup typically pai...

Read full answer

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 update...

Read full answer

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 owner/repo and version, like actions/checkout@v...

Read full answer

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 set is genuinely still valid. - uses: act...

Read full answer

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 single team-level plan do...

Read full answer

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 protection rule for the target branch (e.g. main ) or a pattern (e.g. release/* )...

Read full answer

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 merge commit combining the PR's branch with its targ...

Read full answer

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 --> C[Added to a GitHub Project board] C --> ...

Read full answer

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 already built. Path filters - only trigger a service's j...

Read full answer

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. A separate, standalone registry service. Access controlled by e...

Read full answer

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 all match. Ma...

Read full answer

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 history, and a direct link from a...

Read full answer

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 to some or all repositories within it,...

Read full answer

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 and, for simple text conflicts, offers a "Resolve confl...

Read full answer

«
»

Comments & Discussions