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–6 of 6 questions

Learn Git →
1.What is the difference between git fetch and git pull?Beginner

fetch downloads new commits and updates remote-tracking branches without touching your work. pull is fetch plus merge (or rebase) into the current branch.

2.What is the difference between merge and rebase?Beginner

Merge joins two histories with a merge commit and keeps history as it happened. Rebase replays your commits on top of another branch for a linear history, creating new commit IDs. Never rebase commits others have already pulled.

3.What is the difference between the working directory, the staging area and a commit?Beginner

The working directory is your files as they are now. git add copies changes to the staging area (the index), which is what the next commit will contain. git commit saves the staged snapshot into history.

4.What does .gitignore do, and why doesn't it ignore a file I already committed?Beginner

It tells Git which untracked files to leave out, like node_modules/ or .env. Files that are already tracked keep being tracked; remove them from the index with git rm --cached file, then commit.

5.What is the difference between git reset, git revert and git restore?Beginner

git restore throws away changes in files. git reset moves your branch back to an earlier commit (rewrites local history). git revert makes a new commit that undoes an old one, which is safe on shared branches.

6.What is a pull request (merge request), and why use one?Beginner

It is a request to merge one branch into another, with a place to review the diff, discuss it and run CI. It adds a quality gate and a record of why a change was made.