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 16–30 of 108 questions

16.What is the difference between the working directory, the staging area and a commit?BeginnerGit

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.

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

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.

18.What is the difference between git reset, git revert and git restore?BeginnerGit

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.

19.What is a pull request (merge request), and why use one?BeginnerGit

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.

20.Why use a virtual environment?BeginnerPython for DevOps

It gives each project its own Python packages, so versions never clash between projects and your system Python stays clean.

21.What is the difference between a list and a dict?BeginnerPython for DevOps

A list is an ordered group of items you reach by position. A dict stores values under names (keys), so you reach them by key.

22.How do you read a file safely?BeginnerPython for DevOps

Use a with block: with open(path) as f. It closes the file even when an error happens. pathlib makes paths work on every system.

23.What does exit code 0 mean?BeginnerPython for DevOps

Success. Any other number means failure. CI systems and shells read this number, so scripts should exit non-zero when they fail.

24.What is the difference between a function and a module?BeginnerPython for DevOps

A function is a named block of steps you can call again and again. A module is a .py file that holds functions and other code, so you can import and share them.

25.What is an artifact repository and why use one?BeginnerJFrog Artifactory & Nexus

It stores files that builds make and use, such as packages and images, with versions. It gives you one safe place, a cache of public libraries, access control and a record of what was built. Builds become faster and repeatable.

26.What does 'build once, deploy many' mean?BeginnerJFrog Artifactory & Nexus

You build an artifact one time and move that same file through dev, test and prod. You never rebuild for production, because a rebuild may differ from what you tested.

27.What are local, remote and virtual repositories?BeginnerJFrog Artifactory & Nexus

Local holds your own files. Remote caches another site such as Maven Central. Virtual gives one address in front of both, so tools need only one URL.

28.What is the difference between a release and a snapshot version?BeginnerJFrog Artifactory & Nexus

A release such as 1.4.2 is fixed and should never be overwritten. A snapshot such as 1.5.0-SNAPSHOT is work in progress and is replaced by each build. Keep them in separate repositories.

29.Why should passwords not go in pom.xml?BeginnerJFrog Artifactory & Nexus

The pom is committed to Git, so secrets would leak. Put credentials in settings.xml or in CI variables, and use tokens.

30.What is the difference between a pipeline, a stage and a job?BeginnerGitLab CI/CD

A job is a list of commands that runs in a fresh environment and passes or fails. A stage is a group of jobs that run at the same time. A pipeline is one run of all the jobs for one commit. Stages run in order, and the next stage starts only when every job in the stage before it passed.