FRESHERS INTERVIEW Q&A

 In Q&A

1. How to automate Testing in the DevOps lifecycle?
Developers are obliged to commit all source code changes to a shared DevOps repository.
Every time a change is made in the code, Jenkins-like Continuous Integration tools will grab it from this common repository and deploy it for Continuous Testing, which is done by tools like Selenium.

2. Why is Continuous Testing important for DevOps?
Any modification to the code may be tested immediately with Continuous Testing. This prevents concerns like quality issues and releases delays that might occur whenever big-bang testing is delayed until the end of the cycle. In this way, Continuous Testing allows for high-quality and more frequent releases.

3. What are the key elements of Continuous Testing tools?
Continuous Testing key elements are:
Test Optimization: It guarantees that tests produce reliable results and actionable information. Test Data Management, Test Optimization Management, and Test Maintenance are examples of aspects.
Advanced Analysis: In order to avoid problems from occurring in the first place and to achieve more within each iteration, it employs automation in areas like scope assessment/prioritization, changes effect analysis, and static code analysis.
Policy Analysis: It guarantees that all processes are in line with the organization’s changing business needs and that all compliance requirements are met.
Risk Assessment: Test coverage optimization, technical debt, risk mitigation duties, and quality evaluation are all covered to guarantee the build is ready to move on to the next stage.
Service Virtualization: Ensures that real-world testing scenarios are available. Service visualisation provides access to a virtual representation of the needed testing phases, ensuring its availability and reducing the time spent setting up the test environment.
Requirements Traceability: It guarantees that no rework is necessary and real criteria are met. To determine which needs require additional validation, are in jeopardy and performing as expected, an object evaluation is used.

4. Explain the difference between a centralized and distributed version control system (VCS).
Centralized Version Control System:
All file versions are stored on a central server
No developer has a copy of all files on a local system
If the central server crashes, all data from the project will be lost

Distributed Control System:
Every developer has a copy of all versions of the code on their systems
Enables team members to work offline and does not rely on a single location for backups
There is no threat, even if the server crashes

5. How do you push a file from your local system to the GitHub repository using Git?
First, connect the local repository to your remote repository:
git remote add origin [copied web address] // Ex: git remote add origin https://github.com/Simplilearn-github/test.git
Second, push your file to the remote repository:
git push origin master

6. How is a bare repository different from the standard way of initializing a Git repository?
Using the standard method:
git init
You create a working directory with git init
A .git subfolder is created with all the git-related revision history
Using the bare way:
git init –bare
It does not contain any working or checked out a copy of source files
Bare repositories store git revision history in the root folder of your repository, instead of the .git subfolder

7. What is the process for reverting a commit that has already been pushed and made public?
There are two ways that you can revert a commit:

Remove or fix the bad file in a new commit and push it to the remote repository. Then commit it to the remote repository using:
git commit –m “commit message”
Create a new commit that undoes all the changes that were made in the bad commit. Use the following command:
git revert
Example: git revert 56de0938f

8. What is Git stash?
A developer working with a current branch wants to switch to another branch to work on something else, but the developer doesn’t want to commit changes to your unfinished work. The solution to this issue is Git stash. Git stash takes your modified tracked files and saves them on a stack of unfinished changes that you can reapply at any time.

9. Explain the concept of branching in Git.
Suppose you are working on an application, and you want to add a new feature to the app. You can create a new branch and build the new feature on that branch.
By default, you always work on the master branch
The circles on the branch represent various commits made on the branch
After you are done with all the changes, you can merge it with the master branch

10. What is the difference between Git Merge and Git Rebase?
Suppose you are working on a new feature in a dedicated branch, and another team member updates the master branch with new commits. You can use these two functions:
Git Merge:
To incorporate the new commits into your feature branch, use Git merge.
Creates an extra merge commit every time you need to incorporate changes
But, it pollutes your feature branch history
Git Rebase:
As an alternative to merging, you can rebase the feature branch on to master.
Incorporates all the new commits in the master branch
It creates new commits for every commit in the original branch and rewrites project history
11. How do you find a list of files that have been changed in a particular commit?
The command to get a list of files that have been changed in a particular commit is:
git diff-tree –r {commit hash}
Example: git diff-tree –r 87e673f21b
-r flag instructs the command to list individual files
commit hash will list all the files that were changed or added in that commit

12. What is Jenkinsfile?
Jenkinsfile contains the definition of a Jenkins pipeline and is checked into the source control repository. It is a text file.
It allows code review and iteration on the pipeline.
It permits an audit trail for the pipeline.
There is a single source of truth for the pipeline, which can be viewed and edited.

13. What concepts are key aspects of the Jenkins pipeline?
Pipeline: User-defined model of a CD pipeline. The pipeline’s code defines the entire build process, which includes building, testing, and delivering an application
Node: A machine that is part of the Jenkins environment and capable of executing a pipeline
Step: A single task that tells Jenkins what to do at a particular point in time
Stage: Defines a conceptually distinct subset of tasks performed through the entire pipeline (build, test, deploy stages)

14. How can you copy Jenkins from one server to another?
Move the job from one Jenkins installation to another by copying the corresponding job directory.
Create a copy of an existing job by making a clone of a job directory with a different name.
Rename an existing job by renaming a directory.

15. Name three security mechanisms Jenkins uses to authenticate users.
Jenkins uses an internal database to store user data and credentials.
Jenkins can use the Lightweight Directory Access Protocol (LDAP) server to authenticate users.
Jenkins can be configured to employ the authentication mechanism that the deployed application server uses.

Recent Posts
Learn Devops

Become a Devops Engineer in 3 months