skip to content

GitHub

17 roadmaps77 questionsupdated

The platform most teams live in: repositories with branch protection, pull requests and review, Actions for CI, Issues and Projects for tracking, and a security layer from Dependabot to code scanning. Interviews here are about workflow and platform judgement more than about Git commands.

on this pageshow

guide

overview

~1 min

GitHub is where most teams keep their code, and also where they review it, build it, track the work around it and guard its supply chain. Interviews assume you already know Git; what they test here is platform judgement. How do you keep `main` trustworthy, and who must look at a change before it lands? What may a workflow do with the credentials it holds? Do security findings stop a merge, or pile up in a tab nobody opens? A good answer names the setting, the risk it closes and the friction it adds. The hub splits along those concerns. [Repositories and PR workflow](/topics/dev-github-repositories) is the largest section: the [pull request lifecycle](/topics/dev-github-pr-lifecycle), [branch protection and rulesets](/topics/dev-github-branch-protection-rulesets), [CODEOWNERS](/topics/dev-github-codeowners), [merge queues](/topics/dev-github-merge-queue) and the [permission model](/topics/dev-github-repo-permissions). [Code review](/topics/dev-github-code-review) covers the review buttons and the etiquette around them. [GitHub Actions](/topics/dev-github-actions) is the CI/CD layer. [Issues and Projects](/topics/dev-github-issues-projects) track the work beside the code, and [releases and packages](/topics/dev-github-releases-packages) turn a tag into something others can install. [Security features](/topics/dev-github-security) is the second-largest section: [Dependabot](/topics/dev-github-dependabot), [secret scanning](/topics/dev-github-secret-scanning), [code scanning with CodeQL](/topics/dev-github-code-scanning-codeql) and [SBOMs and attestations](/topics/dev-github-supply-chain-attestation). [API, apps and webhooks](/topics/dev-github-apps-api) is about automating GitHub itself. Junior rounds check vocabulary: drafts, review verdicts, where a workflow file lives. Middle rounds ask what a specific rule enforces and where its edges are. Senior and principal rounds become design and incident conversations: a review process for a whole organization, a leaked cloud key, a vulnerable library across hundreds of repositories, a scanner whose alerts nobody believes. Start with the pull request and the rules that guard the base branch: review, Actions checks, code scanning and Dependabot all end at a merge button those rules control.

primer

### The pull request is the unit of change Almost everything attaches to a pull request: reviews, status checks, linked issues, scanning annotations, even Dependabot's bumps. That makes the pull request both the gate a change passes through and the record someone reads a year later to learn why the code looks the way it does. ### Rules live on the branch, not in habits Branch protection and rulesets are enforced by GitHub's server, whatever the client does. The distinction interviewers probe is between features that *suggest* and rules that *enforce*: CODEOWNERS routes a review request, a status check reports a result, and neither blocks anything until a rule on the target branch requires it. Say which layer does the blocking. ### Green has to mean green on what lands A passing check proves that a branch was fine against the base it was tested with, at that moment. Other merges can land in between. Requiring branches to be up to date and running a merge queue both close that gap, at different costs in waiting and CI time, and choosing between them depends on how busy the branch is. ### Access resolves to the strongest grant A person's rights on a repository come from several sources at once — an org-wide base permission, team memberships, direct grants — and the highest one wins. Machines get their own identities: the per-job `GITHUB_TOKEN`, deploy keys, fine-grained personal tokens and GitHub App installation tokens. Good answers pick the narrowest identity with the shortest life that does the job. ### A workflow is code that holds credentials Actions runs your code and other people's actions next to repository tokens and secrets. Default token permissions, which third-party actions are allowed, how they are pinned, and whether cloud access uses short-lived federated credentials instead of stored keys are all security decisions, and senior rounds treat them that way. ### Prevention beats detection Most security features come in two strengths: an alert after something happened, and a rule that stops it at push or merge time. Scanning findings that never block anything turn into backlog. The dependency graph sits under Dependabot, SBOM export and organization-wide exposure queries, so its blind spots become theirs. ### Automate the platform, not the clicking Releases cut on tag, self-updating boards, grouped dependency updates and API bots keep process consistent across many repositories. The recurring questions are rate limits, trusting inbound payloads and choosing a machine identity.

Branch protection rule
The classic per-branch setting that requires pull requests, approvals or passing checks before a push or merge to a matching branch is accepted.
Ruleset
A named, layerable set of rules targeting branches, tags or pushes, definable per repository or across an organization, with an explicit bypass list and an evaluate mode.
Required status check
A named check that must report success on the pull request before the protected branch accepts the merge. A check that is not required only informs.
CODEOWNERS
A file mapping path patterns to users or teams who are requested as reviewers for changes to those paths; blocking needs a separate branch rule.
Merge queue
A branch feature that tests queued pull requests together with the base and everything ahead of them before merging, so combinations land only when tested.
Workflow
A YAML file under .github/workflows declaring the events that trigger it and the jobs, made of steps, that run on a runner.
GITHUB_TOKEN
A repository-scoped credential GitHub creates for each Actions job that expires when the job ends; its permissions are set per workflow or per job.
OIDC federation
Letting a workflow trade a short-lived signed identity token from GitHub for temporary cloud credentials, so no long-lived cloud key is stored as a secret.
GitHub App
An integration with its own identity and fine-grained permissions, installed on accounts or repositories, that acts through short-lived installation tokens rather than a user.
Fine-grained personal access token
A user token limited to one resource owner, selected repositories, specific permissions and an expiry date, an alternative to the broad scopes of classic tokens.
Dependency graph
GitHub's parsed view of a repository's declared dependencies, built from manifests and lockfiles; the input for Dependabot alerts and SBOM export.
Push protection
Secret scanning applied at push time, rejecting a push that contains a recognised credential unless the pusher explicitly bypasses it.
CodeQL
GitHub's semantic code analysis engine, which queries code as data to find vulnerability patterns and reports them through code scanning.
Build provenance attestation
A signed statement linking an artifact's digest to the repository, workflow and commit that built it, which consumers can verify before trusting it.

Follow one change through the platform. Work starts as an issue, often filed through a form and placed on a Project board. A developer pushes a branch and opens a pull request that names the issue it closes. Opening it does two things: CODEOWNERS requests reviewers for the paths touched, and workflows start on runners and report status checks. Code scanning annotates changed lines, and with push protection on, secret scanning has already inspected the push on the way in. The base branch's rules then decide whether the merge button works: which checks must pass, how many approvals and from whom, whether history must stay linear, and whether the change goes through a merge queue that re-tests it with whatever lands ahead of it. When it merges, the linked issue closes and board automation moves the card. Later, a version tag starts a release workflow that builds artifacts, publishes packages, attaches a provenance attestation and writes release notes from the merged pull requests. Throughout, Dependabot watches the dependency graph and opens its own pull requests, which go through the same gate as a human's. Most confusion in this hub comes from one link in that chain: a check becomes a gate only through a rule, and the rule matches the check by name. A workflow that the queue never triggers leaves the queue waiting on a check that will not arrive: ```yaml on: pull_request: merge_group: # the queue tests its own ref, so CI must run there too permissions: contents: read # start the job token read-only; widen per job jobs: test: # the check a ruleset requires, matched by this name runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: make test ``` The API and webhooks sit beside all of this: a bot can read, create or react to every object in the chain, which is how organizations apply the same rules and automation to hundreds of repositories.

  1. Pull Request Lifecycle →

    The object everything else attaches to: drafts, merge methods, auto-merge and how a pull request links to and closes issues.

  2. Branch Protection and Rulesets →

    What actually blocks a merge, and the difference between classic protection and rulesets that most workflow questions turn on.

  3. Code Review →

    Review verdicts, stale approvals and suggested changes, plus the etiquette and latency questions senior rounds ask.

  4. GitHub Actions →

    The CI layer that produces the required checks, and where token permissions, OIDC and action policy come in.

  5. Security Features →

    Dependabot, secret scanning and code scanning, best read once you know how checks and rules gate a merge.

  6. API, Apps, and Webhooks →

    Automating GitHub itself: token types, rate limits and verifying webhooks, which assume the rest of the platform.

  • Assuming a CODEOWNERS entry blocks a merge: it only requests the review until required review from Code Owners is switched on in a branch rule.

  • Treating a green check as proof that main will be green after merge, when other pull requests may have landed on the base since that check ran.

  • Reading CODEOWNERS as additive: when several patterns match a path, only the last matching line counts, so a late broad rule silently overrides earlier specific ones.

  • Rewriting history as the fix for a leaked secret; anyone who fetched it still has it, so revoking the credential comes first.

  • Giving automation a personal token with broad scopes where a GitHub App or the job's own GITHUB_TOKEN would do with narrower, shorter-lived access.

  • Granting the job's GITHUB_TOKEN write access it does not need, or running third-party actions pinned to a movable tag rather than a full commit SHA.

  • Processing a webhook before checking its X-Hub-Signature-256 HMAC over the raw body, or assuming every delivery arrives exactly once.

  • Turning on code scanning as a merge gate across an organization without separating the historical backlog from alerts a pull request introduces.

  • Retagging a published release to swap in a fixed artifact instead of cutting a new version that consumers can tell apart.

GitHub.com has no version numbers to quote; what it has is features that replaced older ones, and interviewers still ask about both sides. This guide assumes GitHub.com as of 2026. The pairs worth knowing: - **Classic branch protection and rulesets.** Both still exist and both are enforced. Rulesets add layering, organization-wide targeting, tag and push rules, bypass lists and an evaluate mode that reports without blocking; many repositories still run on classic rules, so expect to explain how the two combine. - **Classic and fine-grained personal access tokens.** Classic tokens remain in use; fine-grained tokens and GitHub Apps are the direction for new automation. - **Projects.** The current Projects, with custom fields and views, replaced the older board-only Projects (classic), which GitHub has retired. GitHub Enterprise Server is self-hosted and versioned, and it trails GitHub.com, so a feature available on the cloud may not exist on a given server release. Say which one you are describing when it matters.

Interviewers expect you to place GitHub, not only click through it. As a code host it competes with GitLab, which bundles repository, CI/CD, registry and security scanning into one product and is common in self-managed setups, and with Bitbucket, usually chosen alongside Jira and other Atlassian tools. Azure DevOps fills the same role in many Microsoft-centred organizations. The concepts carry over under other names, such as merge requests and pipelines. For CI, Actions is often weighed against Jenkins, which is self-hosted and endlessly pluggable at the price of running it yourself, and against hosted CI services that integrate with any Git host. Issues and Projects compete with Jira and Linear. On the security side, Renovate is the common alternative to Dependabot for dependency updates, and many teams run commercial scanners but upload their results into code scanning so findings sit on the pull request. When asked to choose, name the deciding factors: hosting constraints, appetite for one integrated platform, and what the organization already pays for.

explore

report an issue with this guide →

questions

77 · 7 sections

In GitHub, what happens when you push straight to main if a rule requires a pull request?

level: juniorimportance: must knowfreq 68%
basics
~20 s

GitHub's server refuses the push. The remote rejects the ref update with a protected-branch error, nothing lands on main, and your local commits are untouched — you push a topic branch and open a pull request instead.

open as a page

In a GitHub pull request description, what does the keyword "Closes #142" actually do?

level: juniorimportance: must knowfreq 62%
basics
~10 s

It links the pull request to issue 142 and closes that issue automatically when the pull request is merged into the repository's default branch. Merging into any other branch links but does not close.

open as a page

What are GitHub's repository access roles, and what can each one do?

level: juniorimportance: must knowfreq 70%
basics
~20 s

GitHub repositories have five access roles: Read (view and clone), Triage (manage issues and pull requests without pushing), Write (push code), Maintain (most repository settings, no destructive ones), and Admin (full control, including visibility, transfer and deletion).

open as a page

In GitHub, what does requiring branches to be up to date add to required status checks?

level: middleimportance: must knowfreq 64%
basics
~20 s

It forces the pull request branch to contain the base branch's newest commit before merging, so the required checks proved green on that exact combination. Without it, checks only prove the branch was green against an older base.

open as a page

In a GitHub CODEOWNERS file, which rule applies when several patterns match the same file?

level: middleimportance: must knowfreq 70%
basics
~20 s

The last matching line in the file wins, and only that line's owners apply. Ownership is never additive across rules, so an earlier specific rule loses to a later broad one — write general patterns first and specific ones last.

open as a page

On a GitHub pull request, what is the difference between Approve, Request changes, and Comment?

level: juniorimportance: must knowfreq 75%
basics
~20 s

Approve endorses the pull request and counts toward any required approvals. Request changes records a blocking objection that stays until the reviewer approves or the review is dismissed. Comment leaves feedback with no verdict either way.

open as a page

On a GitHub pull request, what happens to existing approvals and inline comments when the author pushes new commits?

level: middleimportance: should knowfreq 48%
basics
~20 s

By default approvals survive a new push and keep counting. Inline comments on lines that changed are marked outdated and collapse. A repository can opt in to dismissing stale approvals on every push, and anyone with write access can dismiss a review manually with a reason.

open as a page

What is a suggested change in a GitHub pull request review, and how does it reach the branch?

level: middleimportance: should knowfreq 52%
basics
~20 s

A suggested change is a review comment containing a fenced suggestion block with replacement lines. Anyone with write access to the pull request's branch can apply it in one click, creating a commit on that branch that credits the reviewer as co-author.

open as a page

You are asked to review a 2,000-line GitHub pull request. How do you review it effectively?

level: seniorimportance: should knowfreq 58%
basics
~20 s

Say what you can honestly review and push back on the size. Then work systematically: read the description and tests first, review commit by commit, use the file filter and viewed checkboxes, hide whitespace, and batch findings into one review separating blocking issues from notes.

open as a page

Your team's pull requests wait two days for a first review. How do you diagnose and fix that as a lead?

level: principalimportance: should knowfreq 38%
basics
~20 s

Measure first: pull time-to-first-review and review size from the pull request data rather than trusting impressions. Then attack the causes — oversized changes, unclear reviewer routing, no agreed turnaround, and manual work that automation should be doing.

open as a page

What is GitHub Actions, and where in a repository must a workflow file live to be run?

level: juniorimportance: must knowfreq 72%
basics
~10 s

GitHub Actions is GitHub's built-in automation and CI/CD system. A workflow is a YAML file in the repository's .github/workflows directory that declares the events triggering it and the jobs to run when one occurs.

open as a page

What is the GITHUB_TOKEN available to a GitHub Actions job, and how long is it valid?

level: middleimportance: must knowfreq 56%
basics
~20 s

GITHUB_TOKEN is a credential GitHub mints at the start of each Actions job, scoped to that one repository. It expires when the job finishes, and at most after 24 hours, so there is nothing to store or rotate.

open as a page

Why authenticate GitHub Actions to a cloud provider with OIDC instead of a stored long-lived key?

level: seniorimportance: should knowfreq 47%
basics
~20 s

With OIDC the job requests a short-lived signed token from GitHub and exchanges it for temporary cloud credentials. Nothing long-lived is stored in GitHub, so there is no key to leak, rotate, or exfiltrate from a workflow.

open as a page

How would you govern which third-party GitHub Actions the repositories in your organization may run?

level: principalimportance: should knowfreq 33%
basics
~10 s

Set an organization-level Actions policy that permits only GitHub-authored, verified-creator, and explicitly allow-listed actions, require third-party actions to be pinned to a full commit SHA, and default GITHUB_TOKEN permissions to read-only.

open as a page

In GitHub, how do you make a merged pull request close an issue automatically?

level: juniorimportance: must knowfreq 72%
basics
~20 s

Put a closing keyword and the issue number, such as "Fixes #123", in the pull request description or in a commit message. When that pull request merges into the repository's default branch, GitHub closes the linked issue.

open as a page

In GitHub Projects, what do custom fields and views add on top of issue labels?

level: middleimportance: should knowfreq 45%
basics
~20 s

A GitHub Project stores extra data per item — status, priority, estimate, iteration, target date — as typed fields that labels cannot express, and renders the same items as a table, a board, or a roadmap with independent filters, grouping and sorting per view.

open as a page

In GitHub, what does a YAML issue form give you that a Markdown issue template does not?

level: middleimportance: should knowfreq 52%
basics
~20 s

A GitHub issue form renders real input widgets — required text boxes, dropdowns and checkboxes — so the reporter cannot submit an empty or half-filled report. A Markdown template only pre-fills editable text that anyone can delete.

open as a page

In GitHub Issues, when is a milestone the right tool instead of a label?

level: middleimportance: should knowfreq 38%
basics
~20 s

Use a GitHub milestone when the question is "is this batch of work done yet" — it holds one due date and shows a completion percentage. Use labels for everything an issue can be several of at once, like type or component.

open as a page

How would you keep a GitHub Projects board updated as PRs move, without dragging cards?

level: seniorimportance: should knowfreq 40%
basics
~20 s

Lean on the project's built-in workflows first — auto-add items by filter, then set Status when an item is added, a review is requested or approved, a pull request merges, or an item closes. Reach for an Action or the GraphQL API only for what those cannot express.

open as a page

In GitHub, what does a release add on top of the Git tag it points at?

level: juniorimportance: must knowfreq 58%
basics
~20 s

A GitHub release is a platform object wrapped around a tag: it adds a title, release notes, uploadable binary assets, draft and prerelease flags, a stable download URL, and API and feed access. The tag itself stays a plain Git pointer.

open as a page

In a GitHub release, what do the draft, prerelease, and latest flags control?

level: middleimportance: should knowfreq 42%
basics
~20 s

Draft keeps a GitHub release private to users with push access and does not create its tag until published. Prerelease publishes it but marks it unstable and excludes it from Latest. The latest marker controls which single release the Latest badge and endpoint resolve to.

open as a page

In GitHub, how do you control what automatically generated release notes contain?

level: middleimportance: should knowfreq 44%
basics
~20 s

Ask GitHub to generate notes (generate_release_notes on the API, --generate-notes on the CLI) and shape the output with a .github/release.yml file, whose changelog block groups merged pull requests into categories by label and excludes chosen labels or authors.

open as a page

A GitHub release v1.2.0 shipped a broken artifact — do you retag it or ship v1.2.1?

level: seniorimportance: should knowfreq 34%
basics
~20 s

Ship v1.2.1. A published version is a fact other people have already fetched and cached, so replacing its contents makes two different artifacts share one name. Burn the bad version, mark it clearly, and move Latest to the good one.

open as a page

How do you cut a GitHub release automatically when a version tag is pushed?

level: seniorimportance: should knowfreq 48%
basics
~20 s

Trigger a workflow on pushes of tags matching your version pattern, grant it contents: write, build the artifacts, then create the release from the pushed tag with generated notes and upload the artifacts as assets before publishing.

open as a page

In GitHub, what is a Dependabot alert and where does its data come from?

level: juniorimportance: must knowfreq 60%
basics
~20 s

A Dependabot alert is GitHub telling you that a package your repository depends on has a known vulnerability. It comes from matching the repository's dependency graph, built from committed manifests and lockfiles, against the GitHub Advisory Database.

open as a page

In GitHub, what is secret scanning and what does push protection add to it?

level: juniorimportance: must knowfreq 60%
basics
~20 s

GitHub secret scanning matches known credential formats across a repository's commits and raises alerts after the fact. Push protection applies the same detection at push time and rejects the push, so the credential never reaches the repository at all.

open as a page

What is the difference between CodeQL default setup and advanced setup on a GitHub repository?

level: middleimportance: must knowfreq 58%
basics
~20 s

Default setup is a GitHub-managed configuration enabled from repository settings with no workflow file: GitHub picks languages, queries and triggers. Advanced setup commits a workflow you own that calls the CodeQL action, so you control build, queries, packs and paths.

open as a page

In GitHub, how do Dependabot security updates differ from version updates?

level: middleimportance: must knowfreq 65%
basics
~20 s

Security updates are driven by Dependabot alerts and open a pull request that bumps a vulnerable package to the lowest patched version. Version updates keep dependencies current on a schedule you declare in .github/dependabot.yml, whether or not anything is vulnerable.

open as a page

GitHub push protection blocked your push — what are your options and what does each cost?

level: middleimportance: must knowfreq 55%
basics
~20 s

Either remove the secret from every commit in the push and push again, or follow the unblock URL and bypass with a reason. Bypassing lets the credential land, creates an alert, and is recorded — so the credential must then be treated as leaked.

open as a page

On GitHub, how do classic PATs, fine-grained PATs, and App installation tokens differ?

level: middleimportance: must knowfreq 65%
basics
~20 s

Classic PATs carry coarse scopes across every repository the user can reach. Fine-grained PATs pin one resource owner, selected repositories, per-permission access and an expiry. GitHub App installation tokens belong to the app, expire hourly, and are the right choice for automation.

open as a page

How do you verify a GitHub webhook payload is authentic using X-Hub-Signature-256?

level: middleimportance: must knowfreq 70%
basics
~20 s

GitHub signs each webhook with the secret you configured: X-Hub-Signature-256 holds a hex HMAC-SHA256 of the raw request body. Recompute that HMAC over the exact bytes received and compare it in constant time, rejecting the request when it differs.

open as a page

What is the difference between GitHub's primary and secondary rate limits, and how should a client react?

level: seniorimportance: must knowfreq 60%
basics
~20 s

Primary limits are the published hourly request quota for your credential, reported in x-ratelimit-* response headers. Secondary limits are anti-abuse throttles on burst, concurrency and content creation, returned as 403 or 429. Back off on both; never retry straight away.

open as a page

Why would you use a GitHub webhook instead of polling the GitHub REST API for changes?

level: juniorimportance: should knowfreq 55%
basics
~20 s

A GitHub webhook pushes an HTTP POST to your server the moment an event happens, so you learn about it immediately and spend no request quota. Polling burns rate limit, adds latency, and can miss changes that happen between two polls.

open as a page

When would you choose GitHub's GraphQL API over its REST API, and what do you give up?

level: middleimportance: should knowfreq 50%
basics
~20 s

Choose GitHub's GraphQL API when one round trip should return exactly the fields you need across related objects, or for surfaces only it exposes, such as Projects v2. You give up simple HTTP caching, several REST-only endpoints, and request-count rate limiting.

open as a page