DevOps - Interview Questions & Answer
Git
====================================
- Command to find empty files in a given directory ?
- find . -empty
- Commands you will use it for configuring ssh connectivity between 2 machines and what files will be present in .ssh folder ?
- First we need to private key & public key to connect
- ssh-keygen
- ~/.ssh
- id_rsa-------id_rsa.pub----know_hosts----authorised_key
- How to schedule a shell script in unix machine?
- Crontab
- Command to get load average?
- Why we need git? What makes git unique from other tools like SVN?
- Let's say i have maven repo cloned on to my local, did some changes and i have build the code now target folder will be generated. So now when i do git operations like git add, git commit or any other git operations target folder should not be considered, how would you achieve the same?
- difference between git pull and git fetch?
- How to clone specific branch in git?
- Lets say your organization has github and bitbucket to store code, you have cloned a repo onto your local and changed directory name. after some days one of your team members asks you to share clone link, how would you provide the same?
- I have shell script to delete particular dependency ( repo is maven project ). before running the script i need to clone repo to my local, here point to note i should only clone master branch and only last commit ( last commit has all the code ) how would you do this?
- what is submodule and why we need submodule?
- Lets say you have changed 5 files a,b,c,d and e in a repo and you did git add ., now all the files are in staging area, now i decided not to commit file d. how would delete it from staging area?
- What is git-cherry-pick? why we use it?
- Let’s say you’re working on new feature in some branch, now your manager says stop working on that and change few other things on old code. Here after changing the old code, I need to work on new code, so I need to place my new changes some place How would handle this scenario?
- What is a conflict in git?
- command to list all branches in a repo?
- What is git reset ? Types of reset ?
- How to delete local branch and remote branch in git ?
- Difference between git diff and git status ?
- What are hooks in git?
- what is the importance .git directory?
- what are the branches, diff between remote and local branches?
- what Branching strategy that you are familier with?
- What PR (Pull request) is? whats the importance of PR?
- Which version of git you have used?
- Difference between git merge and git rebase?
- What is git squash?
- Branching strategy used in your project?
- Command to list all commits?
- Branching strategy?
- Need a script which identify inactive branches ( no commits since 2 months )?
- How to set configs globally in git?
Maven
========================w
when i issue mvn install what all things happen in background?
- what are the settings you need to do before running mvn deploy?
- why maven takes much time for 1st execution and from 2nd execution it will take less time?
- what is multi module project in maven and what are the setting you want to do in multi module parent and child project? what is dependency management?
- what is transitive dependency?
- .m2 is local repository for maven, now I don’t want to use .m2 folder as my local repository I want to use some other folder as my local, is it possible in maven? If yes, how would you do that?
- maven follows convention over configuration that means it assumes code should be there under src/main/java, test cases under src/tests and many more.Here my requirement is I don’t want to follow that conventions I need to use different folder structure is that possible in maven?
- What are dependency and plugin in maven? Give one example for each?
- What are 3 build life cycles in maven?
- In Which tag we will mention output artifact type( like jar, war or any other)?
- What are things you need to set, if you want download dependency from private repository ?
- What are the issues you faced while working on maven projects?
- Command to skip the test cases in maven
- what is multi module project?
- what is the importance of dependency managment?
- what are the settings that you need to do for mvn deploy ( to push artifcats to repository )?
- mvn version that you have used?
- Tell me 3 build lifecycle in maven? What does mvn site does?
- Is there way by which we can set local repository as some other custom directory, other than .m2?
- Settings that you make for mvn deploy?
- What is the default value of packaging tag? What other values for other artifact types?
- What are GAV's?
- what are the tags that you came across in pom.xml?
- Explain maven life cycle?
mvn install -Dmaven.repo.local=/alternate/repo/location
mvn help:effective-pom -Doutput=pom_eff.xml
Jenkins
========================
- How to save only last 5 builds of jenkins job?
- Have you worked on Jenknsfile? can we use docker container as a node in Jenkinsfile? Who will handle docker container creation and deletion? If i am building a maven project always docker container is fresh instance it will try to download dependency from repository, what measures you will take to reduce build time?
- Why we need multi branch pipeline?
- If you forget Jenkins password, how would you login back?
- Have you worked on commit based job in jenkins? what settings you need to do in jenkins and github to setup commit based job?
- you want to create 50 freestyle jobs with same configurations, but only change is job name. how would you achieve the same?
- How can you copy job from your local jenkins instance to other local jenkins instance?
- How to Downgrade plugins in Jenkins?
- Have you worked on Jenkinsfile? Can we use different nodes for each stage?
- Can you list few ways by which we can trigger our build in Jenkins? What is the difference between Build Periodically and Poll SCM?
- How to set Jenkins build to fail based specific word in console output ?
- What are active and reactive parameters (Dynamic parameterization) in Jenkins ?
- How to customize the build number display to something else in Jenkins job page?
- What are multi branch pipeline?
- What is shared library in Jenkins ?
- what is the need of CICD tools?
- What type of Jenkinsfile you have worked on?
- In master slave setup if I want run job on specific node is is possible?
- what is the importance of Jenkins secrets?
- What are types jobs you have worked on??
- Can we have job for pr and once merge is done the source branch should be deleted?
- How do you take Jenkins backup?
- Can you tell me importance of post block??
- list of best practices to follow while writing Jenkins pipeline?
- Is it possible to run each stage on different agaent?
- Is it possible to change success or error message that we see in console ouput ?
- Have list of command that has to executed in certain directory in the code, is it possible to do the same?
- Can we have versioning on Jenkins freestyle job?
Docker
========================
- Any 3 best practices of docker?
- Difference between docker stop and docker kill?
- Command to list conatiners which state is exited?
- command to clean-up docker host ( deleting stopped conatiners, dangling images and unused networks)?
- What version of docker you have used? Specific reason to use that particular version?
- Can we have multiple CMD in Dockerfile?
- Have you worked on docker swarm and docker compose?
- Have you worked on multi-stage dockerfile and why we need that?
- Lets say i have container which is attached with a volume, if container crashes what happens to volume?
- can you copy a file form local to run container?
- Lets say I have 1 GB file that has to be sent to docker daemon, as its 1GB it will take muchtime and network too. By which option while building dockerfile we can send the fileIn better manner?
- What is the difference between ADD and COPY docker instructions in Dockerfile?
- Command to remove to stopped and running Containers?
- Inside the container I did many changes like Creating, modifying and deleting file but I Wanted to check which files has been changed And what action has been taken what is the Command we need to use ?
- What does ONBUILD instruction do in Dockerfile?
- What is the use of .dockerignore file?
- I have dockerfile that accepts arguments, if I supply value as “1” then it should use maven 2.x version for base image and if I supply “2” then it should take maven latest as base image
- What are docker compose and docker swarm?
- How to configure docker private registry?
- Types of network in docker? if you dont specify network to deploy on which network the conatiner will be created?
- Explain a sample dockerfile that you have used in your project?
- Can we launch linux conatiners windows and viceversa?
- Why we need docker compose and docker swarm
- What's the difference between docker volume and docker mounting
- What is the importance of .dockerigonre file, can name docker file with any other name?
- I need to delete all stopped containers and unused images command for that?
- How do you monitor docker in production
- Is it good to use docker compose in production
Kubernetes
========================

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home