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 branching strategy would you choose and why?Senior

Usually trunk-based development: short-lived branches merged to main several times a day, feature flags for unfinished work, and releases cut from main with tags. GitFlow suits slow, versioned releases but adds merge overhead.

2.How do you recover a branch you deleted by mistake?Senior

git reflog shows where HEAD has been; find the last commit of the branch and run git branch name <sha>. Commits stay recoverable until garbage collection prunes them.

3.How do you handle a huge repository that is slow to clone?Senior

Use shallow clones (--depth 1) in CI, partial clones (--filter=blob:none) and sparse checkout for monorepos. Move large binaries to Git LFS or an artifact store, and clean old large files out of history with git filter-repo if needed.

4.What is trunk-based development, and what does it need to work?Senior

Everyone merges small changes into main at least daily instead of keeping long-lived branches. It needs fast CI, good automated tests, feature flags to hide unfinished work, and code review that happens quickly.

5.How do you protect the main branch?Senior

Use branch protection: no direct pushes, required pull request reviews (and CODEOWNERS), required passing CI checks, signed commits if needed, and no force pushes. Combine with secret scanning on push.

6.How does Git store data internally?Senior

Git is a content-addressed store of objects: blobs (file content), trees (folders), commits (a tree plus parents and metadata) and tags. Each object is named by its hash. Branches are just files that point to a commit hash.